Closed edwardjosephbennett closed 10 months ago
Hey @edwardjosephbennett
Thanks for the kind words! That means a lot.
It would definitely help in development if we could get a list of templates that are out date to specifically check these instead of having to test everything.
Your question is something I actually thought about right at the start of developing this integration. But back then I couldn’t find an easy way to integrate with WooCommerce, without having to rewrite a lot of the logic that WooCommerce uses for the status page. WooCommerce provided only very few hooks in their scanning functionality. Too keep the integration slim, I didn’t pursue this further.
Quite some time has passed though and I didn’t check again what would be needed now to make this work. Maybe it’s not even that complicated. The tricky part is probably to make WooCommerce scan the Twig template folder and make it work with Twig comments (or maybe PHP Comments wrapped in Twig comments).
I you feel like it, you’re very welcome to dig around in WooCommerce and check what would be needed in this integration to make it work. I’m quite involved in client projects and don’t have too much time to work on this. But I’m happy to assist in any way I can.
And just like that, I got it working! I’m pretty excited about this. I stumbled over the solution when I looked into an error with the WooCommerce REST API.
With the latest 0.8.0 release, you can add @version
tags in Twig comments, which will get picked up by the WooCommerce system status.
Read more about this here: https://github.com/mindkomm/timber-integration-woocommerce/blob/main/docs/usage.md#template-versions-and-system-status.
Hi,
First off, this plugin for Timber makes developing with Timber, Twig and Woocommerce really simple and easy. The easy replacement of woocommerce with twig files is a godsend.
My question comes as part of that process. Normally, in the Woocommerce Status page, there is a section that tells you what template files that are out of date, allowing developers the chance to update their templates to the latest versions. I assume this is implemented through Woocommerce reading the Comment blocks at the top of each file and determining whether or not they are out of date. (based on this function in Woocommerce core)
However, I have noticed that when replacing a template with a custom one, this is not reflected in the list of overrides within the Status page.
Is there a way we can alter this plugin to reflect what twig templates are being used to override the PHP templates, so that we can see easily which templates might need tweaks?
For some background info, when developing I'm using this plugins
\Timber\Integrations\WooCommerce\WooCommerce::render_default_template()
function in mywoocommerce.php
file. Any other templates being replaced are happening automatically such as replacing theresult-count.php
template file in the loop folder.I look forward to hearing your response, and any thoughts you may have on implementing. Happy to try and find a solution if you could point me in the right direction :)
Thanks, Ed