• WooCommerce template override for archive-product.php after update dosen’t work as expected. Template override for categories archive (like. /shop/category/) all works fine WooCommerce uses correct one template ( theme/woocommerce/archive-product.php ) but for shop/catalog page (like. /shop/) WooCommerce uses default one ( plugins/woocommerce/templates/archive-product.php ). Tnx for any help.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    The ‘shop’ page should use archive-product.php. What are you hoping it will use?

    ignore my message

    Thread Starter karlis_adams

    (@karlis_adams)

    Mike Jolley -> Sorry I mean archive page. Shop I use as example for catalog so I will just re formulate problem. After updating woocomerce 2.2.5 archive page uses woocomerce default archive-product.php instead one thats overrides ( myTheme/woocommerce/archive-product.php ). This problem appears only with archive with taxonomy-product_cat.php witch includes archive-product.php everything seems to be OK

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    The ‘catalog’ is the shop. It’s a post type archive (of products) and should use archive-product.php by default.

    Thread Starter karlis_adams

    (@karlis_adams)

    Mike Jolley -> Then how I can override Product Archive / Shop Page ? Because I copied template file from plugin directory to myTheme/woocommerce/archive-product.php and made some changes dosen’t it overrides default theme archive-product.php and why its work fine with taxonomy-product_cat.php which includes same file ? Before update everything was working fine ??

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    You mention the ‘theme’ /archive-product.php – does your theme have one too?

    Thread Starter karlis_adams

    (@karlis_adams)

    Yes, I have ‘theme’ /archive-product.php in theme root dirctory with content
    <?php woocommerce_content(); ?>

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    That one is probably taking priority. Tried editing that instead?

    Thread Starter karlis_adams

    (@karlis_adams)

    No, but I will try

    Thread Starter karlis_adams

    (@karlis_adams)

    No seams this file content changes doesn’t affect anything. Tried even remove it but still for Product Archive / Shop Page woocommerce prefer to use archive-product.php from plugin directory.

    somethumb

    (@somethumb)

    Hi Mike,

    Yes, this seems to be an issue. For some reason, the archive-product.php page only works for the category or tag. Here is my page that has the category for this product: https://rlarson.somethumb.net/product-category/gardening/

    As you can see, I’m printing out the query (modified with a custom field). The Shop page should at least not show the sidebar, as i have removed it from the archive-product.php template. So i KNOW it’s not using the template in my theme.

    https://rlarson.somethumb.net/shop/

    Is it possible that there is a database glitch that is doing this? I don’t have anything in my functions.php file that would cause this. And my index.php and page.php files don’t have a sidebar either.

    I think something is causing the shop page to NOT use the theme’s woocommerce template.

    It took me a while to find it but this is discussed in the docs. It’s best to use hooks:

    Please note: when creating woocommerce.php in your theme’s folder, you won’t be able to override the woocommerce/archive-product.php custom template as woocommerce.php has the priority over archive-product.php. This is intended to prevent display issues.

    https://docs.woothemes.com/document/third-party-custom-theme-compatibility/

    I had that issue also…I tried to override the shop with this template file archive-product.php and just didn’t enter in my theme’s template – it always took the original one.
    I was able to solve this by disable Template Debug Mode in woocommerce tools.
    I personally enabled that but i was not paying attention at the small explaining text:”This tool will disable template overrides for logged-in administrators for debugging purposes.”
    Maybe this will help someone ??

    @Adinusmall: We had the same problem and your solution solved it for us. I recommend to all that you go to Woocommerce -> System-status -> Tools and see if Template Debug Mode is checked. Uncheck it to make overrides fully work.
    Thanks for the tip, Adinusmall!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘After updating to 2.2.5 template override for archive-product.php dosen't work’ is closed to new replies.