• Resolved Alex Phelps

    (@alexphelps3)


    I’m using Storefront with WooCommerce and followed the standard way to override woocommerce templates in my child theme like here – http://local.wordpress.dev/product/woo-single-2/.

    If I change a template, I can only see the changes when not logged in. When logged in as an admin, I still see the normal unchanged templates.

    Any idea what might be causing this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello Alex Phelps,

    Have you checked is their any setting in theme option about the templates override if not it should work in all case.Can you please check.

    Thanks

    The only thing I can think is that your changes are wrapped in an is_user_logged_in() query?

    FYI template overrides are generally best avoided if possible. If there’s a filter or hook you can use I’d suggest doing so. Much safer for backwards compatibility 🙂

    Cheers!

    Thread Starter Alex Phelps

    (@alexphelps3)

    The only thing I’ve done for now is change the archive-product.php html. I tried it forward and backwards, but have no clue why the default woocommerce templates are loaded when I’m looged in but the woocommerce templates from my theme are loaded when I’m not logged in.

    I think I’ve narrowed this down to not being a storefront theme issue for now.

    Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey Alex,

    Have you tried disabling all of your sites plugins as a test aside from WooCommerce to see if it’s a plugin conflict issue of some kind as maybe a plugin is adding some code that’s causing the issue.

    I did a quick cross test for you and don’t seems to be able to recreate the issue using the latest version of storefront and the same template is displaying for me when logged in or out of WordPress.

    As James indicated though it’s better if you can avoid overriding template files and instead look for a hook or a filter that can accommodate your changes. This is a much safer approach with regards to backward compatibility when new versions of WooCommerce are released.

    Cheers

    Thread Starter Alex Phelps

    (@alexphelps3)

    I’ve narrowed it down to not being storefront, but still not sure why my install (VVV) does this.

    hi alex ;
    What is the problem that was ?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Issue Overriding WooCommerce Templates only when not logged in’ is closed to new replies.