Releases: mindkomm/timber-integration-woocommerce
0.6.1-rc.1
- Fixed a couple of issues with
$product
global not being kept in sync. - Added improvements to documentation.
You can install the release candidate with the following command:
composer require mindkomm/timber-integration-woocommerce:0.6.1-rc.1
0.6.0
- Improved when this integration applies Product classes and Product Iterators to single posts and lists of posts. This should make it easier to have collections of WooCommerce products and other WordPress post types on the same page. Internally, this integration now uses a Class Map for the
product
post type. This means that you can also extend this integration’sTimber\Integrations\WooCommerce\Product
class with your ownProduct
class. - Improved default archive-product.twig template and added default templates for loop/loop-start.twig and loop/loop-end.twig.
- Added a default checkout/form-checkout.twig template.
- Added a
$context
parameter to therender_default_template()
function. When you pass a context to this function, it will be merged with Timber’s default context. - Added a
post
variable to the context in Twig template partials. - Fixed a bug when calling
Timber\Post::__construct()
messed up the$product
global. - Fixed a compatibility issue with admin-ajax.
0.6.0 Release Candidate 1
- Improved when this integration applies Product classes and Product Iterators to single posts and lists of posts. This should make it easier to have collections of WooCommerce products and other WordPress post types on the same page. Internally, this integration now uses a Class Map for the
product
post type. This means that you can also extend this integration’sTimber\Integrations\WooCommerce\Product
class with your ownProduct
class. - Improved default archive-product.twig template and added default templates for loop/loop-start.twig and loop/loop-end.twig.
- Added a default checkout/form-checkout.twig template.
- Added a
$context
parameter to therender_default_template()
function. When you pass a context to this function, it will be merged with Timber’s default context. - Added a
post
variable to the context in Twig template partials. - Fixed a bug when calling
Timber\Post::__construct()
messed up the$product
global.
0.5.3
- Added Twig function
wc_action()
that can be used instead ofaction()
when calling hooks from Twig. In Twig, you would use it like this:{% do wc_action('woocommerce_single_product_summary') %}
. This was added to fix compatibility problems when hooks were used with parameters. (See #14, thanks @pascalknecht) - Added support for Automatic Twig partial selection when using
wc_get_template_part()
. You could only usewc_get_template()
before. Now, you can use both. - Fixed a bug when the
$post
global was not properly set when looping over products. - Updated default templates.
- Updated internal repository folder structure.
0.5.2
- Fixed a bug that prevented the integration from working with different versions of Twig. Thanks @chrislind and @VincentLoy!
- Removed non-working support for installing the integration as a WordPress plugin. The integration can only be installed through Composer. Future versions of Timber will will drop support for installation as a plugin. That’s why drop it here, too.
Introducing a WooCommerce Integration for Timber
This project is the first take for an integration that tries to make it easier to develop WooCommerce themes with Timber. Here’s a short list of features it adds and problems it tries to solve:
- Automatic handling of the
$product
global. Whenever you loop through a list of WooCommerce products, the integration will set the$product
global for you. This will improve compatibility for WooCommerce and its integrations. - Enhance Timber’s context.
- Automatic Twig partial selection
- Provide default templates, tips and examples.
You can start out with the project’s Readme, where all the relevant documentation is linked.
If you already have a WooCommerce theme that you developed with the help of Timber, you might benefit from this integration, too. We’re already using the integration in a couple of WooCommerce projects, and so far, it has been working great for us.
The integration may be a little opinionated, so we’re eager to hear what you think about it. What are your pain points when developing for WooCommerce? How do you think we could make it easier? Do you have additional features? Create an issue, or even a pull request!
In the future, we might integrate this into Timber as an official integration.