6

I've copied the folder plugin/woocommerce/template to theme/mytheme/woocommerceand designed a new template and just checked Woocommerce/System Status to make sure overridden is worked.

The template works fine but when the user or the admin logged in , the overridden code does not work and the template defaults to plugin/woocommerce/template and shows the default template

the problem happened for this particular pages:

  • Product-single.php
  • taxonomy-product_cat.php
  • archive-product.php

And this problem happen just when Administrator logged in

How can this problem be addressed?

I Also Disable All plugin (except woocommerce), copy original woocommerce template file to twentysixteen Template and modify that.

But The Problem not Solved Anyway!

I use woocommerce 2.5.5 And Wordpress 4.4.2

Ruvee
  • 8,611
  • 4
  • 18
  • 44
Hamed mayahian
  • 2,465
  • 6
  • 27
  • 49
  • Which file in particular are you trying to add a template for? – Andrew M Mar 31 '16 at 13:35
  • @AndrewM all of the woocommerce template file, for example `single-product.php` or `cart.php` back to defaults – Hamed mayahian Mar 31 '16 at 15:11
  • Have you checked in your **backend menu** > **WooCommerce** > **System status** page, in the section named **Templates** (located at the end), you have the list of all **active** overrides templates. If for example, you see in there `single-product.php`, `cart.php` and some others templates, that mean that they **are really active**. If you don't see anything (empty, no list items), it is certainly a path problem: you just have to copy the "templates" folder (located in the woocommerce plugin folder) to your theme folder. Then you have to rename it "woocommerce". – LoicTheAztec Mar 31 '16 at 20:07
  • @Louis yes, i do it. and see all overridden page on there. – Hamed mayahian Apr 01 '16 at 21:04
  • Just to clarify, you say that the problem happen with logged user roles "user" and "administrator". You certainly mean "customer" and "administrator", right? – LoicTheAztec Apr 01 '16 at 21:49
  • 2
    Ok, next lasts things: This kind of problem can come also when template overrides is in debug mode: WooCommerce -> System Status -> Tools -> Template debug mode "on". Also have you checked if the problem don't come from "woocommerce.php" file located in your theme folder. – LoicTheAztec Apr 01 '16 at 22:11
  • Last try :) - When you updated to the newest version of woocommerce, you may have to "reinstall" the woocommerce pages because the old system did not use the `wc_get_page_id()` function, which looks for the shop page: WooCommerce -> System Status -> Tools ->"Install WooCommerce Pages". This will not override your existing pages. – LoicTheAztec Apr 01 '16 at 22:27
  • Is this solved or it remain with the same problem? Another trick from very active [helgatheviking](http://stackoverflow.com/users/383847/helgatheviking) is to use the default wordpress theme to see if the issue don't come from your theme. – LoicTheAztec Apr 04 '16 at 08:39
  • I hope in your case after updating "Template Debug Mode" was enabled. That's why you can not override the templates anymore. – hemnath mouli Apr 05 '16 at 15:58
  • @LoicTheAztec sorry reply too late :( i template in debug mode. it's not updating version , clean install last version. problem not solved! – Hamed mayahian Apr 12 '16 at 20:04
  • @hemnathmouli sorry reply to late. template in debug mode. problem not solved yet – Hamed mayahian Apr 12 '16 at 20:06
  • 1
    Have you added [WooCommerce support](https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/#section-3) to your theme? – Raunak Gupta Aug 31 '16 at 13:27

1 Answers1

0

try disable debug mode from wp-config.php

define( 'WC_TEMPLATE_DEBUG_MODE', false );