Woocommerce customization template not working for registered users

I have a problem with a custom template with Woocommerce.

When I view my page (archive-product.php) when I am a visitor, I see my custom template.

But if I see with admin then Archive-product.php file in woocommerce plugin template is displayed.

I am not using woocommerce.php in my theme.

** I have a copy plugins/woocommerce/templates/*

beforemyTheme/woocommerce/*

Any idea with this weird problem?

Thank you!

+3


source to share


1 answer


I'm sure you need woocommerce.php in your template folder. Woocommerce.php is for displaying WC taxonomies pages etc.

This issue can potentially affect the store page, individual product page and taxonomy (categories and tags), since WooCommerce uses its own templates to display those pages, and it is impossible for WooCommerce to know exactly what markup your theme is using.

For a better understanding take a look at the official docs page: https://docs.woothemes.com/document/third-party-custom-theme-compatibility/



This is because WC requires "woocommerce_content ()" to display WC special pages.

You must also declare that your theme is WC-enabled. Use this simple snippet in your functions.php file (also described in the link above):

add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

      

0


source







All Articles