Open
Divi Themer can be used to create custom headers and footers.
These work well with versions of Toolset WooCommerce Blocks up to version 2.9.4.
But after upgrading to version 3.0 (current version 3.1) the custom header and footer no longer appear on the shop page if a custom archive is created with Toolset for products (i.e. the shop page).
If you have Toolset WooCommerce Blocks active then please add the following lines of code, e.g. in a snippet at Toolset > Settings > Custom Code (make sure the snippet is active).
add_action( 'template_redirect', 'ts_maybe_fix_divi_templates', 1 );
function ts_maybe_fix_divi_templates(){
if ( is_post_type_archive( 'product' ) || is_tax( 'product_cat' ) || is_singular( 'product' ) ) {
add_action( 'get_header', 'et_theme_builder_frontend_override_header' );
add_action( 'get_footer', 'et_theme_builder_frontend_override_footer' );
}
}
This assumes you have created a custom product archive with Toolset and a custom template for single products, as well as a custom product category archive. If you have created additional custom archives you may need to update the conditional tags in the above code sample.
I’m wondering if any efforts have been made to fix this issue.
I’ve checked the internal ticket and I don’t see any progress, I’m afraid. I’ve added a comment to it to give a heads up to the developers.
Hey Nigel, I’ve discovered that product sorting no longer works with WooCommerce Blocks 2.9.4. There must have been an update with the other Toolset plugins that influenced this functionality, as it had worked in the past. I currently have an active ticket open to see if a fix can be made to address this.
It’s been nearly two years since this was posted, and the issue with Divi clearly hasn’t been addressed.
is this still an issue? Not sure if I should try Toolset again – currently using Divi
This issue is still open, but it would affect you only if using Toolset to design the custom shop page. If you use Divi itself to customise the shop page then this wouldn’t be a problem.
Nigel, using the Divi WooCommerce elements has many limitations and lacks much of the freedom and functionality we rely on Toolset with. The fact that we can mark up the loop items and layout in any way we see fit is a huge boon in and of itself that Divi’s WooCommerce elements don’t afford us.
I’ve taken another look at this while waiting for an update from the developers, and have identified where the problem arises and so have updated the text above to include a workaround that you should be able to apply to fix the problem with the missing custom headers and footers. Please try that on your site.
Well, the conflict only affects Product archive and single Product post layouts, so would it absolutely be necessary to include other post types in this function when all we care about is fixing those layouts tied to WooCommerce Product posts?
I’m not sure what you mean. The workaround applies only to single product pages and produt archives, not to other post types.
Perhaps I just misunderstood when you said, “If you have created additional custom archives, e.g. for product category archives, then you may need to update the conditional tags in the above code sample.”
Hey Nigel, sorry I’m bugging you again with this. I get now why you said, “If you have created additional custom archives, e.g. for product category archives, then you may need to update the conditional tags in the above code sample,” because the code doesn’t currently affect the archives for taxonomies used with WooCommerce Products as you suggested. What would be the best way to include Product Categories/Tags or other custom taxonomies into the conditionals provided by your code so I can use it as a working solution until a more permanent one is made (if ever)?
No problem. I updated the code sample in the workaround to include a test for is_tax( ‘product_cat’ ), which will check if the current page is a product category archive.
See https://developer.wordpress.org/themes/basics/conditional-tags/#a-taxonomy-page
Sharon, I can confirm that this is still an issue. Attempting to use the latest version of WooCommerce Blocks breaks our Divi Theme Builder global header and footer areas.
Sharon, please note there is an update to this post with a workaround you would be able to apply if you are using Toolset with Divi for shop and product pages.
I just tested it on my current project and your workaround appears to be effective. My header and footer layouts are displaying as they should be. Hopefully, the developers can work your fix into the main build so we don’t have to rely on applying this snippet to our child themes or code snippet plugins ourselves.