Skip to content

Commit

Permalink
fix: Update Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
gchtr committed Feb 14, 2024
1 parent e4b078a commit c65fa47
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Timber Integration for WooCommerce

## 0.8.0 - 2024-02-14

- Fixed a bug when Twig templates would be falsely rendered on the /system_status endpoint of the WooCommerce REST API.
- Added the possibility to make the system status work with [outdated WooCommerce templates](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#template-versions-and-system-status).
- Changed Twig template loader to not load views from the caller directory.

## 0.7.1 - 2023-01-13

- Fixed a bug when product global is not present on singular product pages.
Expand All @@ -19,7 +25,7 @@
- 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 the `render_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](https://github.com/mindkomm/timber-integration-woocommerce/blob/master/docs/usage.md#automatic-twig-partial-selection).
- Added a `post` variable to the context in [Twig template partials](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#automatic-twig-partial-selection).
- Fixed a bug when calling `Timber\Post::__construct()` messed up the `$product` global.
- Fixed a compatibility issue with admin-ajax.

Expand All @@ -30,7 +36,7 @@
## 0.5.3 - 2020-07-29

- Added Twig function `wc_action()` that can be used instead of `action()` 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](https://github.com/mindkomm/timber-integration-woocommerce/blob/master/docs/usage.md#automatic-twig-partial-selection) when using `wc_get_template_part()`. You could only use `wc_get_template()` before. Now, you can use both.
- Added support for [Automatic Twig partial selection](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#automatic-twig-partial-selection) when using `wc_get_template_part()`. You could only use `wc_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.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This integration tries to make it easier to develop Timber themes for WooCommerc

Here’s a short list of features it adds and problems it tries to solve:

- [Automatic handling of the `$product` global](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/usage.md#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](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/usage.md#woocommerce-context).
- [Automatic Twig partial selection](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/usage.md#automatic-twig-partial-selection).
- [Automatic handling of the `$product` global](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#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](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#woocommerce-context).
- [Automatic Twig partial selection](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#automatic-twig-partial-selection).
- Provide default templates, tips and examples.

## Why would I need this?
Expand All @@ -15,9 +15,9 @@ This integrations makes sense if you need to develop a highly customized WooComm

## Documentation

- [Installation](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/installation.md)
- [Getting Started](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/getting-started.md)
- [Usage Guide](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/usage.md)
- [Images](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/images.md)
- [Examples](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/examples.md)
- [Mini Cart](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/mini-cart.md)
- [Installation](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/installation.md)
- [Getting Started](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/getting-started.md)
- [Usage Guide](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md)
- [Images](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/images.md)
- [Examples](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/examples.md)
- [Mini Cart](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/mini-cart.md)
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ if ( class_exists( 'WooCommerce' ) ) {
}
```

From here on, you should be good to go. The integration hooks into the [context](https://github.com/MINDKomm/timber-integration-woocommerce/blob/master/docs/usage.md#woocommerce-context) and adds features specific for WooCommerce. If you’re starting your theme from scratch, you’ll probably want to look at the following optional sections. You might also benefit if you already have Timber theme.
From here on, you should be good to go. The integration hooks into the [context](https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#woocommerce-context) and adds features specific for WooCommerce. If you’re starting your theme from scratch, you’ll probably want to look at the following optional sections. You might also benefit if you already have Timber theme.

## Understanding how WooCommerce uses page-plugin.twig

If you don’t add any [WooCommerce template files](https://docs.woocommerce.com/document/template-structure/) to your theme, WooCommerce will take the default templates that ship with the WooCommerce plugin. To display a WooCommerce site, it will use **header.php** as well as **footer.php** of your theme.

In most Timber themes, the [**header.php**](https://github.com/timber/starter-theme/blob/master/theme/header.php) looks a little bit like magic. What it does in the context of WooCommerce is:
In most Timber themes, the [**header.php**](https://github.com/timber/starter-theme/blob/main/theme/header.php) looks a little bit like magic. What it does in the context of WooCommerce is:

- Save Timber’s context in a `$timberContext` global.
- Start an output buffer with `ob_start()`. An output buffer doesn’t echo out anything, but saves everything in a buffer that you can retrieve later and save it in a variable.
Expand Down Expand Up @@ -108,7 +108,7 @@ The `$context` that you pass in here will be merged with the default Timber cont

## Optional: Copy default templates to your theme

In the **defaults** folder of the integration, you’ll find [default Twig templates](https://github.com/MINDKomm/timber-integration-woocommerce/tree/master/defaults) for a couple of WooCommerce templates. They are examples for how you could translate templates from PHP to Twig.
In the **defaults** folder of the integration, you’ll find [default Twig templates](https://github.com/mindkomm/timber-integration-woocommerce/tree/main/defaults) for a couple of WooCommerce templates. They are examples for how you could translate templates from PHP to Twig.

You can copy the templates over to a **woocommerce** folder in the Twig views folder of your theme.

Expand Down

0 comments on commit c65fa47

Please sign in to comment.