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

26,484

Solution 1

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.

Solution 2

I just had the same issue, What worked for me, is removing the woocommerce.php file, because before, it applied the template woocommerce.php to the shop, and not the archive-product.

Solution 3

The answer is that when you updated to the newest version of WooCommerce, you have to "reinstall" the WooCommerce pages because the old system did not use the wc_get_page_id() function, which looks for the shop page.

Luckily this is super easy! Go to your admin, then to WooCommerce, then to System Status, then click on the Tools tab. Then click the button to the right of Install WooCommerce Pages. This will only install the missing WooCommerce pages and, get this, will reinstall the shop page with the proper wc_get_page_id.

NOTE: if you have content in the original WordPress shop page, although it didn't erase it for me, you might just want to copy the content first just in case.

Share:
26,484
RyanMac
Author by

RyanMac

Updated on December 04, 2020

Comments

  • RyanMac
    RyanMac over 3 years

    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?