0

I know this may be slightly off topic, but this really is the best place to ask a question related to WooCommerce & WordPress.

I've search high and low for an answer to this question and there does not seem to be one.

I have a specific product under the category 'course'. I would like to create a custom template for this product which I can drop into my themes template files.

What would I need to name the file for it to override on this specific product only?

  • single-product-[slug].php
  • single-product-[category].php
  • single-product-[pageid].php
  • single-product-[productid].php

Please advise.

1

Override the template with a template_include filter.

0

you need to check the last specifications from woocommerce to override his template files.

https://docs.woocommerce.com/document/template-structure/

The last time i did it, i copy the template file with the structure of the folder from the woo plugins template directory under the active theme inside a folder named woocommerce with the same structure. You can get more info in the above link.

-2

As woocommerce is basically just posts have you not tried single-productID.php so single-234.php

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Gabriel Oct 27 '15 at 20:06
  • Yes it does it states that if you add single- and the post / product id the it is specific for that post if you try it then you will see that does exactly what he is asking for – Dava Gordon Oct 27 '15 at 20:16
  • Please elaborate on the answer. I can understand how this is a genuine attempt to provide an answer but it is phrased as a question, albeit a carelessly punctuated one. – s_ha_dum Oct 27 '15 at 20:49
  • Basically copy single-product.php and rename to single-[productid].php and upload in your theme folder – Dava Gordon Oct 27 '15 at 21:02

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.