Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce Template Override for Archive-Product.php (Main Shop Page) Not Working

I can't for the life of me manage to override the main shop page.

My understanding is that it's archive-product.php

I've attempted to copy it into the Woocommerce directory I created in my theme's root directory and modify it. No dice.

I've also attempted to modify it directly in the Woocommerce plugin directory. No dice there either.

I've even gone as far as adding an underscore before the archive-product.php file name in both locations (woocommerce directory and my theme template directory) in an attempt to hopefully BREAK it - just to see if I could impact SOME change - and that doesn't seem to have any effect either.

I'm not running any cache plugins and every other Woocommerce template file I've attempted to modify up until this point has worked fine.

Any ideas?

like image 739
RyanMac Avatar asked Sep 03 '13 18:09

RyanMac


People also ask

How do I override a WooCommerce shop page?

Yes, you will have to set the Shop page of your site in Woocommerce > Settings > Products > Shop page. That way, the site will have a shop base which will show in the breadcrumbs. Hope this helps.

How do I override a WooCommerce template?

To override WooCommerce template files in your theme (or better yet, child theme) simply make a folder named 'woocommerce' within your theme directory, and then create the folders/template file you wish to override within it.

How do I override WooCommerce theme plugins?

To do that just copy the WooCommerce template you need to customize and add it to your plugin folder. Now all the customizations you need to make to the WooCommerce cart page can be made in the 'cart. php' file in your plugin folder.


1 Answers

You are doing this correctly. You'll have to double check the locations as per:

  • Shop template is in plugins/woocommerce/templates/archive-product.php

  • You can copy to my-themes/woocommerce/archive-product.php to override the core woocommerce file.

like image 183
raison Avatar answered Nov 03 '22 01:11

raison