A lot has changed in WooCommerce and in Sage since Chris Carr wrote about using WooCommerce with Sage; this post is just a brief update on how to get WooCommerce to play nicely with Sage 8.x.
WooCommerce has a remarkable ability to break after updates. Even if you follow their override best practices you could end up having to update the templates that you’ve overridden, so I like to avoid template overrides unless absolutely necessary (I make ample use of action hooks and filters to reduce overrides). So, to get WooCommerce up and running smoothly and without any major template overrides, here’s what I like to do:
add_theme_support('woocommerce');to the setup function in
remove_all_actions('woocommerce_sidebar');to the bottom of
- In the theme’s root directory, create
footer-shop.phpfiles and leave them blank
After these additions you should be up and running with WooCommerce and Sage without any errors or duplicate content.
Thanks. It worked. Easy enough!
Is this also valid for Sage 9 (not Sage 8)?
I get Notices:
Notice: Theme without header.php is deprecated since version 3.0 with no alternative available. Please include a header.php template in your theme. in /var/www/html/site/trunk/wp-includes/functions.php on line 3136
Notice: Theme without footer.php is deprecated since version 3.0 with no alternative available. Please include a footer.php template in your theme. in /var/www/html/site/trunk/wp-includes/functions.php on line 3136
Also see https://github.com/roots/sage/issues/1052 .
This has only been tested in Sage 8 :-/