5

I want to override woocommerce templates from my theme. I follow all the steps from the official documents of woocommerce. And I'm sure that there is no woocommerce.php file in my theme. So, I can;t understand why it isn't working. I'm using twenty seven theme.

Any help will be appreciated.

Mobashir
  • 400
  • 1
  • 7
  • 26

7 Answers7

14

I had an issue with this relating to the WooCommerce template cache.

The cache can be cleared by navigating to:

WooCommerce > Status > Tools > Clear template cache

wickywills
  • 4,024
  • 2
  • 38
  • 54
  • 2
    I had the correct directory structure so the above answers didn't help me. Clearing template cache finally worked for me. High five! – Dorji Tshering Feb 05 '22 at 11:37
8

Try to declare Woocommerce support in your theme's function.php

  • 1
    Here's how: https://docs.woocommerce.com/document/woocommerce-theme-developer-handbook/#section-5 – Nathan Oct 25 '21 at 17:27
7

If you've already read this documents https://docs.woothemes.com/document/template-structure/

Please Note: When creating woocommerce.php in your theme’s folder, you will be unable to override the woocommerce/archive-product.php custom template in your theme, as woocommerce.php has priority over all other template files. This is intended to prevent display issues.

Also make sure that you don’t have “Template Debug Mode” activated that you can find under:

WP Dashboard -> WooCommerce -> System Status -> Tools

Mo'men Mohamed
  • 1,851
  • 20
  • 24
6

After lots of researching, finally I've found my answer from here WordPress - Failing to override woocommerce templates

Actually, I use all of my files inside the template folder and this is the reason why it didn't work.

So simple steps. But I can't understand how was I miss it!

Thank's Mo'men Mohamed for your suggetions.

Mobashir
  • 400
  • 1
  • 7
  • 26
  • 5
    To make it clearer, remove "templates" folder, as in: `your-theme/woocommerce/templates/checkout/form-checkout.php` turns into `your-theme/woocommerce/checkout/form-checkout.php` – Lucas Bustamante Jul 24 '18 at 07:06
1

Yes i agree with Mobashir. There are three steps to check why override not working :

  1. Check in functions.php for woocommerce supported added ( URL : https://docs.woocommerce.com/document/woocommerce-theme-developer-handbook/ )
  2. Check spelling of directory and files is proper in theme such as your-theme/woocommerce. ( URL : https://docs.woocommerce.com/document/template-structure/ )
  3. Woocommerce allow to change the location of woocommerce template. Hook is : woocommerce_template_path .If you are using the premium theme then check for filter hook in your theme's functions.php file. If that hook exits then use that location which is mention in that hook's callback function.
Mohan
  • 41
  • 3
1

I'm facing the same issue. I am using the JupiterX theme with Elementor and trying to override the checkout template in the JupiterX Child theme, but it's not loading. I have double checked the path, it's like themes/jupiterx-child/woocommerce/checkout/form-checkout.php.

Solution:

I have resolved the issue. Actually, the JupiterX theme has its own WooCommerce overriding structure, that is themes/jupiterx/lib/templates/woocommerce/checkout/form-checkout.php and the same for the child theme that is themes/jupiterx-child/lib/templates/woocommerce/checkout/form-checkout.php.

For more details: themes.artbees.net/docs/overriding-woocommerce-templates

0

I had this issue too.

Clear cache, then just swap/activate themes to a wordpress standard theme, then swap back to yours. Happy Days!

adz
  • 1
  • 1