Editing All WooCommerce Templates

I’m looking to customize every default template provided by WooCommerce. I’ve copied over the default template (http://docs.woothemes.com/document/template-structure/) but it doesn’t take any of the changes I make to the files.

I’ve followed these directions here http://roots.io/using-woocommerce-with-roots/ but nothing seems to be changing. Should the single-product.php be the root of the theme? If so, that wouldn’t be ideal anyway since I’d like to edit many of the pages provided by WooCommerce.

Appreciate the help as always.

Even as a temporary solution, I can’t seem to remove the sidebar from any of the WooCommerce templates. Nothing I do to the actual files seems to have any affect.

I know it’s the weekend but if anyone has any information on this to lead me in the right direction, that’d be great.

Pinging Mr. @chriscarr

Just tested and these methods are working with a clean install of Roots and WooCommerce.

Putting the template files in a woocommerce folder, following the structure from the plugin’s ‘templates’ folder, works just fine. The default post type/taxonomy templates can go in the root of the theme, any of the other WooCommerce specific files are required to be in a woocommerce folder in your theme for them to be picked up by WooCommerce.

Is the folder you are putting these files into: 1) in the root of your theme, and 2) correctly spelled woocommerce?

Any other changes you have made that may be conflicting? or duplicate files in both the theme root and theme’s woocommerce folder?

Hi @chriscarr. Thanks for the help. That pointed me int he right direction.

I had incorrect file paths. I had roots/woocommerce/templates/ instead of just roots/woocommerce. Then I did as you suggested by putting all the root files from woocommerce/templates/ and moved it into the root of Roots.

As for the sidebar that I was talking about, I fixed that as well and just wanted to document it here. I edited the config.php to include is_woocommerce which removes the sidebar from all WooCommerce pages.

As always, thank you for your help.

did you end up styling all the woo templates to accept bootstrap classes? I’m trying to do the same and would be interested in how this turned out. Thanks.

I highly discourage editing all of the WC templates as it will create more work in the end as WC makes updates. However, I did end up editing a few of the required templates to make this. I’m a fan of Roots but it’s worth noting that if Roots followed the standard WordPress behavior, this would not be an issue.

I’ve already started and yea, its a lot of work. There’s plenty of hooks you can use though, which will help avoid having to override templates, which is a big concern when you need to make an update.

Not sure if I understand what you mean when you refer to the issue that Roots could avoid. Do you mean the theme wrapper? Are you referring to the single-product and product-archive templates that need to be changed?

You can always disable the theme wrapper. It is a bit of a pest IMO.

Hi @Skylab, I’m having the same issue, WC doesn’t read copied && altered templates. I tried roots/woocommerce/ and roots/*.php

What else could be wrong? File permissions? They seem ok. Working on MacOS, MAMP.

It’s probably not a Roots issue. I’ve built a few WC sites using Roots and have always been fine overwriting files… you want to do that in theme-name/woocommerce/*.php just like they tell you to.

Once you do the template rewrites like documented on roots.io, it seems to work totally fine.

I don’t try to replace the WooCommerce styles with Bootstrap, way too much work…

Also, you can use woo-edit-templates plugin for that. See more https://wordpress.org/plugins/woo-edit-templates/ :slightly_smiling_face: