Bug 5.1 RC1 WooCommerce Templates Override

Hi Team,

Whilst testing 5.1 RC1

It is not possible to override WooCommerce templates using a child theme

pro-child/framework/legacy/templates/woocommerce/single-product-reviews.php
pro-child/framework/legacy/templates/woocommerce/single-product/tabs/tabs.php

Hi @strobley,

We moved them in preparation for a bunch of things happening with the Theme Options reboot, but they will still override following the original template structure. Try placing those files like this:

pro-child/woocommerce/single-product-reviews.php
pro-child/woocommerce/single-product/tabs/tabs.php

Thanks @alexander there is something strainge going on.

It is not possible to override pro-child/woocommerce/single-product/tabs/tabs.php.

When I check Wordpress > Admin > WooCommerce > Status > Templates this does show pro-child/woocommerce/single-product/tabs/tabs.php is overridden from a WooCommerce configuration. Yet, on the frontend it does not override and maintains the Parent pro/framework/legacy/templates/woocommerce/single-product/tabs/tabs.php configuration.

If I go to Wordpress > Admin > Cornerstone > Theme Options > WooCommerce > Single Product (Tabs) I can only disable or enable the Parent Pro tabs, it only maintains the Parent Pro tabs.php file.

I’ve also tried to removing the filter defined in pro/framework/legacy/functions/plugins/woocommerce.php with the function below to try and force my WooCommerce template override, this does not work either.

function remove_x_woocommerce_hooks_filters()
{
    remove_filter('woocommerce_product_tabs', 'x_woocommerce_add_remove_product_tabs', 98);
}
add_action('after_setup_theme', 'remove_x_woocommerce_hooks_filters', 999);

EDIT: To prove Parent Pro pro/framework/legacy/templates/woocommerce/single-product/tabs/tabs.php is always inherited regardless of the override templates in pro-child I renamed Parent Pro tabs.php to tabs.test. As soon as I did this the pro-child tabs.php is correctly used.

Overriding pro-child/woocommerce/single-product-reviews.php works just fine.

Thank you! I looked into this a bit more and figured out what was going on. I’m sorry about that, you’re right it wasn’t allowing the tab file to be overridden. You’ll still need to keep the file locations I mentioned above, but it will allow the child theme to overwrite both files now (as of RC3 which is going to be published shortly).

Many thanks as always @alexander :smiley:

You’re welcome!