0

I am building a website from scratch on WordPress using WooCommerce. I'll be having products from numerous brands and to have an easier time organizing them, I've made each brand a category. Currently, when I go to mywebsite.com/product-category/brand_name it's using my page.php template. I would like it to use a different one, but I'm not sure what file I need to add. I tried page-product-category.php, page-product.php, page-category.php and nothing seems to work. I understand that "woocommerce/content-product.php" is what I need to edit in order t ochange what the woocommerce output looks like, but I also need to edit everything else, header, navigation, footer and so on. I tried a few more different pages too, such as "woocommerce/woocomerce.php", "category.php", but still no luck, it still uses my page.php template. Thank you in advance!

  • Also, if anyone is able to help, what about the other pages such as /product/, /cart/ and /checkout/? Thank you! – stefanplc Sep 5 '18 at 15:57
0

product-cateogry URL uses taxonomy-product-cat.php which calls archive-product.php

you will need to override it by creating the same file with the same name in themefolder/woocommerce/archive-product.php

You can open any file in templates folder in the woocommerce plugin and you will find a line in the very top comment describes how to override the file.

don't forget to add add_theme_support( 'woocommerce' ); in the theme functions.php If It's not there.

  • Thank you so much for offering to help! So I took my page.php and duplicated it, renamed it to taxonomy-product-cat.php and then changed something in it so I can tell the difference and I uploaded it in my theme folder. I then refreshed the /product-category/ page and it's still picking up the page.php file :( What am I missing? – stefanplc Sep 5 '18 at 16:16
  • Ok I figured it out. I also needed add_theme_support( 'woocommerce' ); in my functions.php file. Could you please edit your answer by adding that so I can mark it as the full correct answer? Thanks! – stefanplc Sep 5 '18 at 16:28
  • oh, This line should be in any theme now. I will update the answer, – Ash0ur Sep 5 '18 at 16:36
  • Yeah, I didn't know, my first time using WooCommerce :p. Thanks for your help! – stefanplc Sep 5 '18 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.