For example i have category Hostels & Bikes, and one template for Hostels single product template, but for category Bikes i want to have different single-product.php template, how to implement this?


You can create a taxonomy-product_cat-bikes.php template inside a woocommerce folder in your theme. For more info here is the github link of the template file.

Here are some resources for you:

More solutions to fit your needs

WooCommerce template docs

| improve this answer | |
  • Thank You. but how to call this file in woocommerce? – P. Sheth Aug 31 '16 at 9:10
  • Woocommerce uses it if the current category being viewed matches with the slug (bikes). Make sure to create a woocommerce folder inside of your main theme directory and add the template file inside of it (taxonomy-product_cat-bikes.php). Add a line like echo 'test'; to that file and go to the category page depending on how you set it up in the permalinks, you should see the word "test". – Leo Fisher Aug 31 '16 at 18:39

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.