Closed langhenet closed 1 year ago
If it's of more help, here's the call stack for the warning
wp-includes/post-template.php:319
get_the_content()
wp-includes/post-template.php:244
the_content()
wp-content/plugins/woocommerce/templates/single-product/tabs/description.php:30
wc_get_template()
wp-content/plugins/woocommerce/includes/wc-template-functions.php:1761
woocommerce_product_description_tab()
wp-content/plugins/woocommerce/templates/single-product/tabs/tabs.php:47
wc_get_template()
wp-content/plugins/woocommerce/includes/wc-template-functions.php:1544
woocommerce_output_product_data_tabs()
wp-includes/class-wp-hook.php:303
do_action_ref_array('woocommerce_after_single_product_summary')
wp-content/themes/timber-starter/vendor/mindkomm/timber-integration-woocommerce/lib/WooCommerce.php:456
Timber\I\W\WooCommerce->Timber\I\W\{closure}()
wp-content/themes/timber-starter/vendor/twig/twig/src/Environment.php(418) : eval()'d code:85
__TwigTemplate_934fcef5ad4a9993bf1d6c9dd28107bc312d6cebf476eeabaa3ecdb3882c3c66->block_content()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:182
Twig\Template->displayBlock()
wp-content/themes/timber-starter/vendor/twig/twig/src/Environment.php(418) : eval()'d code:74
__TwigTemplate_c2ef67348d5d5901ac42b05ad9304639da94daece14209cb091911200dd934e3->doDisplay()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:405
Twig\Template->displayWithErrorHandling()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:378
Twig\Template->display()
wp-content/themes/timber-starter/vendor/twig/twig/src/Environment.php(418) : eval()'d code:42
__TwigTemplate_934fcef5ad4a9993bf1d6c9dd28107bc312d6cebf476eeabaa3ecdb3882c3c66->doDisplay()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:405
Twig\Template->displayWithErrorHandling()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:378
Twig\Template->display()
wp-content/themes/timber-starter/vendor/twig/twig/src/Template.php:390
Twig\Template->render()
wp-content/themes/timber-starter/vendor/twig/twig/src/TemplateWrapper.php:45
Twig\TemplateWrapper->render()
wp-content/themes/timber-starter/vendor/timber/timber/lib/Loader.php:79
Timber\Loader->render()
wp-content/themes/timber-starter/vendor/timber/timber/lib/Timber.php:334
Timber\Timber::compile()
wp-content/themes/timber-starter/vendor/timber/timber/lib/Timber.php:383
Timber\Timber::fetch()
wp-content/themes/timber-starter/vendor/timber/timber/lib/Timber.php:410
Timber\Timber::render()
wp-content/themes/timber-starter/vendor/mindkomm/timber-integration-woocommerce/lib/WooCommerce.php:404
Timber\I\W\WooCommerce::render_default_template()
wp-content/themes/timber-starter/woocommerce.php:8
Hey @langhenet
Thanks for checking out the integration and for taking the time to fill out an issue with an error call stack!
I could reproduce your issues and I think I found the solution for both your problems. I added it in a pre-release in 0.6.1-rc.1, because I want to test it out a bit more myself. I’d be glad if you could check it out and tell me whether it’s working now.
composer require mindkomm/timber-integration-woocommerce:0.6.1-rc.1
Hi @gchtr, sorry for the delay in my answer, I missed the notification.
First of all thanks for your answer :-) I've tried with the new RC.
Apparently it solves the fatal on single when there is no woocommerce.php.
Without the woocommerce.php file, woocommerce will use the twig partials in the views/woocommerce/ folder, but not for the single product, which, I guess, is the right behaviour according to the updated documentation in the RC, correct?
When woocommerce.php is present, it still throws the notice, but I've found a workaround by adding a single-product/tab/description.twig file with
{% set heading = __('Description', 'woocommerce')
|apply_filters('woocommerce_product_description_heading')
|e('esc_html')
%}
{% if heading %}
<h2>{{ heading }}</h2>
{% endif %}
{{ post.content }}
which prevents the notice :-)
I'm not a PHP wizard but i'd like to contribute to this repository in any way possible...
Without the woocommerce.php file, woocommerce will use the twig partials in the views/woocommerce/ folder, but not for the single product, which, I guess, is the right behaviour according to the updated documentation in the RC, correct?
Yes, that’s correct. At least for the moment. Maybe I can optimize that in the future.
I think I’m having a hard time reproducing your issue.
Can you tell me what WooCommerce-related template files (both PHP and Twig) you have in your theme?
Do you have any WooCommerce PHP template files other than woocommerce.php? And do you a have Twig file for the singular product view (views/woocommerce/single.twig or views/woocommerce/single-product.twig)?
I finally stumbled into the same issue as you and found a solution that should work. See the latest 0.7.1 release: https://github.com/mindkomm/timber-integration-woocommerce/releases/tag/0.7.1.
Hi!
I'm testing out this integration (I like the way it allows you to use twig partials intead of overriding the complete wc templates!) but I'm fighting against a couple of issues...
I'm on the latest wc (5.5.1).
I've tried the integration with my theme, but also with the Timber starter, facing the same 2 issues.
Any help / advice would be much appreciated :-)
Thanks!