Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1223617
    instadesign
    Participant

    Hi! I have run into an issue I can’t seem to find a solution to on here. I would like to use a custom template for the WooCommerce shop page, using an Essential Grid rather than default Woo layout.

    Here’s the relevant part of the site: https://regather.info/trades-projects/food-drink/fruit-veg-box/

    I followed instructions to copy woocommerce.php into my child theme/framework/views/integrity and replaced <?php woocommerce_content(); ?> with <?php echo do_shortcode('[ess_grid alias="shop"]') ?>

    The template works perfectly as I wanted it to on the WooCommerce shop page, however it has also affected all my product pages, i.e. when you go into a product I see the Essential Grid rather than the product page. (Actually the URL and breadcrumbs are correct for the product, but in place of the product content I see my EG).

    What am I doing wrong? Is there a different template I should be using, or do I need to add an ‘if’ to the template to check it’s the shop page?

    Any help greatly appreciated!

    #1223698
    Lely
    Moderator

    Hi There,

    Instead of replacing this line:
    <?php woocommerce_content(); ?>
    With this:
    <?php echo do_shortcode('[ess_grid alias="shop"]') ?>
    Try this instead:

    
    <?php 
      if(is_shop()){
          echo do_shortcode('[ess_grid alias="shop"]');
      }else{
         woocommerce_content();
      }
     ?>

    Hope this helps.

    #1223718
    instadesign
    Participant

    Perfect, thank you! So simple, I had no idea the WooCommerce template worked that way!

    #1224027
    Lely
    Moderator

    You’re welcome!

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1223617 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>