Question

I've been building a template for WooCommerce and all is well, but I'm getting at the point for making the product template and getting confused. I read all about using the WooCommerce template structure and copying that into my own theme folder. BUT I just created single-product.php without copying that woo commerce folder in my theme folder and I can just style, and get my data with queries etc. Is that the correct way? Or should I really copy that folder into my theme and use that way?

Was it helpful?

Solution

Woocommerce templates are loaded in the following hierarchy:

  1. theme/template_path/template_name
  2. theme/template_name
  3. default/template_name

,so if you put the copied template into theme folder Woocommerce will find that template, but it is more practical to separate the theme templates from a plugin templates to have the overall file structure cleaner.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top