Tagged: x
-
AuthorPosts
-
October 20, 2016 at 4:00 am #1223617
instadesignParticipantHi! 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!
October 20, 2016 at 5:20 am #1223698
LelyModeratorHi 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.
October 20, 2016 at 5:43 am #1223718
instadesignParticipantPerfect, thank you! So simple, I had no idea the WooCommerce template worked that way!
October 20, 2016 at 10:29 am #1224027
LelyModeratorYou’re welcome!
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1223617 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
