Woocommerce - templates for archive + single product page

Hi!

We have been using the awesome X theme for years for many sites and are now using PRO on some new sites, I am well versed in editing php templates, but am a bit lost with the Pro theme.

I think maybe the issue also lies with Woocommerce 3.0 files, but we are building a webshop with Woocommerce and Pro theme and I need to modify 2 pages in Woocommerce:

Woocommerce archive page.

example: http://coffeeandmagicdev.net/tonylopes/product-category/south-coast/

Woocoommerce single product page:
example: http://coffeeandmagicdev.net/tonylopes/product/fleeting-crookhaven-heads/

Where is the woocommerce content-archive php page that used to control the archive page - and all the single-product php templates that used to control the single product?

Thank you!

Flemming
Coffee and Magic Websites

Hello There,

Thanks for writing in! Basically most of the WooCommerce pages is using the default WooCommerce templates. In Pro theme, these are the only WooCommerce template overrides included in the theme:
pro/woocommerce/cart/cart-empty.php
pro/woocommerce/cart/cross-sells.php
pro/woocommerce/loop/loop-end.php
pro/woocommerce/loop/loop-start.php
pro/woocommerce/loop/pagination.php
pro/woocommerce/notices/error.php
pro/woocommerce/notices/notice.php
pro/woocommerce/notices/success.php
pro/woocommerce/single-product/related.php
pro/woocommerce/single-product/tabs/tabs.php
pro/woocommerce/single-product/up-sells.php
pro/woocommerce/single-product-reviews.php

If you wish to modify other WooCommerce page, just place it in your child theme under woocommerce folder. For more information how you can override the archive and single product page, please check this out: https://docs.woocommerce.com/document/template-structure/

Hope this helps. Please let us know how it goes.

2 Likes

Hi and thank you so much for this!

I will try it out and let you know how it goes!

Thank you!

You’re welcome :smiley:

Hi !

So I manage to do almost everything I wanted by simply using the Woocommerce hooks and removing some of the actions that control some of the things I wanted removed.

I have one thing that really bugs me, on the product archive page there is a hover Add To Cart button on each item, example:

http://coffeeandmagicdev.net/tonylopes/product-category/south-coast/

I cannot seem to remove this action no matter what I do, it should be as simple as:

remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );

(password sent in hidden message)

But this does nothing.

Has Pro theme altered anything in this loop, the Add To Cart on this must come from a Woocommerce action yes?

1 Like

Addition, I have managed to remove the price on the product category page using exactly the same remove_action, like this:

add_action( ‘woocommerce_after_shop_loop_item_title’, function(){
remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
}, 1 );

This works! But no matter what I try, removing the add to cart button just does not seem to work, any ideas?

1 Like

GOT IT !!! :smiley:

Snooped around the PRO code and found out there was an x_woocommerce action added, I removed it like this in my child theme:

remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘x_woocommerce_after_shop_loop_item_title’, 10);

and that did the trick!!!

ok, all good, I can close this thread now :slight_smile:

1 Like

Hey there, may I ask where you found the mentioned code? I’m struggling to implement the FacetWP Plugin and think, this could be exactly the hint I need :slight_smile:

Hi. It struck me that I probably could not remove that action because the PRO theme had probably re-defined it and had it’s own version.

So I looked here: themes/pro/framework/functions/global/plugins

And found woocommerce.php and discovered that Pro theme had it’s own version of the action I was trying to remove.

So I simply added a little bit of code to my child theme functions.php to remove this Pro theme action and it worked :slight_smile:

3 Likes

@coffeeandmagic,

Thank you!

@fuel2water,

Hope this helps what you are trying to achieve.

1 Like

Thank you very much for your help!

You’re welcome!
Thanks for letting us know that it has worked for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.