WordPress - Failing to override woocommerce templates

7.5k views Asked by At

I am trying to override Woocommerce's templates files by duplicating them in my custom theme directory / woocommerce / templates, but the changes don't appear (I tried simply adding classes to begin with) on the website. Is there something I am doing wrong ?

Thank you for your concern.

2

There are 2 answers

4
rnevius On BEST ANSWER

While the directory structure in the WooCommerce plugin itself is:

/plugins/woocommerce/templates/

You should define it like the following in your theme (note the missing templates dir):

/yourtheme/woocommerce/

In other words, you should put all of the overrides directly within the woocommerce/ directory (there will be no templates/ directory). This is definitely confusing.

1
vimal Arya On

make a Woocommerce folder inside the theme directory and then follow the folder structure symmetry as in the plugin for the fallback to work properly.

Hope it will work