The WooCommerce template files are different from the WordPress Template files look at this to see how it works and the template file for shop pages is archive-product.php
Usually, all themes provide a separate sidebar area for the shop page, did you check if your theme is compatible with WooCommerce?
If yes then you should have a sidebar available under Appearance->Widgets with name similar to 'Shop Sidebar'
How to override a template?
To override the shop page,
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to wp-content/themes/your_theme_name/woocommerce/archive-product.php
and then make the necessary changes to the template in your themes folder.
What happens is WooCommerce checks for the archive-product.php file in theme directory first and if it finds a file in woocommerce/ directory then it will use that file instead of the default one.
So now you have to edit the file inside your_theme_folder/woocommerce to make any changes.
wordpress - Woocommerce template overriding not working - Stack Overflow
WooCommerce Cart Template Override Not Working
Sage 10 - Override default woocommerce templates
Overwriting WooCommerce templates
The WooCommerce template files are different from the WordPress Template files look at this to see how it works and the template file for shop pages is archive-product.php
Usually, all themes provide a separate sidebar area for the shop page, did you check if your theme is compatible with WooCommerce?
If yes then you should have a sidebar available under Appearance->Widgets with name similar to 'Shop Sidebar'
How to override a template?
To override the shop page,
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to wp-content/themes/your_theme_name/woocommerce/archive-product.php
and then make the necessary changes to the template in your themes folder.
What happens is WooCommerce checks for the archive-product.php file in theme directory first and if it finds a file in woocommerce/ directory then it will use that file instead of the default one.
So now you have to edit the file inside your_theme_folder/woocommerce to make any changes.
If you are using custom WooCommerce template overrides in your theme you need to declare WooCommerce support using the add_theme_support function. WooCommerce template overrides are only enabled on themes that declare WooCommerce support. If you do not declare WooCommerce support in your theme, WooCommerce will assume the theme is not designed for WooCommerce compatibility and will use shortcode-based unsupported theme rendering to display the shop.
Declaring WooCommerce support is straightforward and involves adding one function in your theme's functions.php file.
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Now override the template file
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to wp-content/themes/your_theme_name/woocommerce/archive-product.php
[SOLVED]
I’m trying to override the WooCommerce cart template (cart/cart.php) in my custom theme, but it’s not working. I’ve placed the override file in the correct location:wp-content/themes/your-theme/woocommerce/cart/cart.php
I even replaced the original WooCommerce cart template (wp-content/plugins/woocommerce/templates/cart/cart.php) with my custom code, but it still doesn’t work. The cart page continues to load the default template.
What I’ve Tried:
Cleared all caches (browser, plugin, server).
I added this: add_theme_support( 'woocommerce' );
Can someone plz help me figure out why the override isn’t working? I’ve followed all the standard steps, but nothing seems to work. I am also using underscores to build upon if that might help and I highly suspect this is the cause.
Solution
To fix this, you need to disable the block-based cart system and revert to the legacy cart system. Here’s how:
Step 1: Disable the Block-Based Cart
Add the following code to your theme’s functions.php file:
To fix this, you need to disable the block-based cart system and revert to the legacy cart system. Here’s how:
// Disable block-based cart
add_filter('woocommerce_blocks_enable_cart', '__return_false');This forces WooCommerce to use the legacy cart system, which respects the cart/cart.php template override.
Step 2: Recreate the Cart Page
Go to Pages → Cart in your WordPress dashboard.
Delete all the existing content (blocks).
Add the
[woocommerce_cart]shortcode:plaintextCopy[woocommerce_cart]Click Update to save the page.
Hey folks,
I’m writing a new WooCommerce site from scratch, and I’m faced with making changes to the WC templates.
Part of me, wants to make heavy modifications to all the templates (in my theme folder), since my client wants these to look a certain way - but part of me also suspects, that this might end up being a maintenance nightmare.
I am essentially just thinking about changing the markup here and there. I understand that messing with the logic of these templates, is a bad idea, mostly.
Does anyone have any experiences to share regarding this? Is it likely, that I will end up spending a bunch of time on maintenance in the future, if I do this?