Woocommerce Support Declaration in Third Party Theme
Woocommerce Support is very significant after WooCommerce 3.3.0 – in the event that your theme doesn’t contain this in your functions.php file, there’s a decent opportunity any Woocommerce templates you add to/wp-content/[your-theme]/woocommerce/ won’t be loaded. This implies you’ll lose all your customizations on update.
In case you have installed WordPress and Woocommerce and your theme does not say anywhere that it has Woocommerce support activated, you will get a message in the backend above that says something as per “your theme doesn’t have woocommerce support activated … “. This is not good for newer versions as it means your woocommerce templates will probably be ignored.
Declare Basic Woocommerce Support
You can declare the basic Woocommerce Support (without settings) by adding the following code to your functions.php file:
function arrow_design_mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } add_action( 'after_setup_theme', 'arrow_design_mytheme_add_woocommerce_support' );
Declare Advanced Woocommerce Support
To declare advanced Woocommerce Support with settings, use this code:
function arrow_design_add_advanced_woocommerce_support() { add_theme_support( 'woocommerce', array( 'thumbnail_image_width' => 150, 'single_image_width' => 300, 'product_grid' => array( 'default_rows' => 3, 'min_rows' => 2, 'max_rows' => 8, 'default_columns' => 4, 'min_columns' => 2, 'max_columns' => 5, ), ) ); } add_action( 'after_setup_theme', 'arrow_design_add_advanced_woocommerce_support' );
Conclusion
We hope this Woocommerce Support Declaration in Third Party Theme post was helpful and you are now able to integrate this also on your website! You can find more articles here:
Read another Woocommerce post : ‘Change the Autofocus Field at the WooCommerce Checkout‘
Arrow Design, based in Dublin, Ireland, provides quality website design services in Dublin and beyond at affordable prices. If you would like help with implementing the above code, or any wordpress website development project, contact us. We love website design and it shows! We provide custom wordpress plugin development, website design training and lots more.
We do it all, so you don’t have to!
Related Posts
Woocommerce Account Page Hook Guide
In this article you will find a visual hook guide for the Woocommerce Account Pages, like the Login/Register page, the Downloads page or the Orders page.
Woocommerce Single Product Page Hook Guide
In this article you will find a visual hook guide for the Woocommerce Single Product Page. This should help you to quickly and easily find the hook positions on the page.
Woocommerce PHP – Product Categories by Product ID
In this tutorial you will learn how to check if a product is assigned to a tag, a category or a custom taxonomy. You can check if a product is is on the shop page, in the cart, in an order & more.
…We do more, so you can do less 🙂