Woocommerce overridden not work after Administrator logged in
Asked Answered
A

1

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

Asphaltite answered 30/3, 2016 at 11:58 Comment(12)
Which file in particular are you trying to add a template for?Guidry
@AndrewM all of the woocommerce template file, for example single-product.php or cart.php back to defaultsAsphaltite
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".Allemande
@Louis yes, i do it. and see all overridden page on there.Asphaltite
Just to clarify, you say that the problem happen with logged user roles "user" and "administrator". You certainly mean "customer" and "administrator", right?Allemande
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.Allemande
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.Allemande
Is this solved or it remain with the same problem? Another trick from very active helgatheviking is to use the default wordpress theme to see if the issue don't come from your theme.Allemande
I hope in your case after updating "Template Debug Mode" was enabled. That's why you can not override the templates anymore.Filiano
@Allemande sorry reply too late :( i template in debug mode. it's not updating version , clean install last version. problem not solved!Asphaltite
@hemnathmouli sorry reply to late. template in debug mode. problem not solved yetAsphaltite
Have you added WooCommerce support to your theme?Cohn
F
0

try disable debug mode from wp-config.php

define( 'WC_TEMPLATE_DEBUG_MODE', false );
Footless answered 6/7, 2023 at 1:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.