0

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.

Malcom
  • 468
  • 8
  • 21

2 Answers2

17

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.

rnevius
  • 26,578
  • 10
  • 58
  • 86
  • I am using the WPLMS theme. It comes with already modified woocommerce files (location : wplms/woocommerce/single-product.php for example) which work. I tried adding and modifying 'my-account.php' by putting it in the "theme/woocommerce" direction and it didn't work either. I am definitely missing something here. On a side note, it is indeed very confusing. – Malcom Jun 10 '15 at 09:21
  • I don't understand why you're moving anything. Edit it right where it is...`wplms/woocommerce/single-product.php`. Don't move it... – rnevius Jun 10 '15 at 09:26
  • I finally found what I was doing wrong. Your answer is right, I was trying to override a file in "/plugins/woocommerce/templates/myaccount" but I was putting it in the wrong path. The correct path is "/themes/mytheme/woocommerce/myaccount". I was putting it in "/mytheme/woocommerce/templates/myaccount", and then I tried in "mytheme/woocommerce/" and neither of them worked. Thank you. – Malcom Jun 10 '15 at 09:34
-2

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

vimal Arya
  • 71
  • 1
  • 1
  • 5
  • Example: To overide the admin order notification, copy: woocommerce/templates/emails/admin-new-order.php to yourtheme/woocommerce/emails/admin-new-order.php – vimal Arya Jun 10 '15 at 08:53