SureWeb Posted October 5, 2019 Share Posted October 5, 2019 Hi, Is there a hook so that I can add content to a product group page eg. cart.php?gid=1 so that the content shows after the pricing tables? Thanks! James 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 6, 2019 Share Posted October 6, 2019 Hi James, 13 hours ago, SureWeb said: Is there a hook so that I can add content to a product group page eg. cart.php?gid=1 so that the content shows after the pricing tables? this will probably be dependent upon which orderform template you're using - if you're using Standard_cart, you should be able to use ShoppingCartViewCategoryBelowProductsOutput... <?php # Conditional Footer Output on Products Page Hook # Written by brian! add_hook('ShoppingCartViewCategoryBelowProductsOutput', 1, function($vars) { if ($_GET['gid'] == '1') { return "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; } }); obviously is this simple example, i'm just outputting Lorem Ipsum text, but you could equally use html code in there if that's the content you had in mind. I don't think it would be supported in the other Comparison/Slider templates, nor with the old Modern or Boxes templates either... for those, you might need to edit the template, but it depends what the content you want to add it... because there could be ways to do it with language overrides and/or jQuery. 0 Quote Link to comment Share on other sites More sharing options...
SureWeb Posted October 6, 2019 Author Share Posted October 6, 2019 Hi Brian, Thanks for your reply. Unfortunately it places the content before the <!DOCTYPE> even if I change the template to Six and use the Standard Cart order form. 0 Quote Link to comment Share on other sites More sharing options...
SureWeb Posted October 6, 2019 Author Share Posted October 6, 2019 I was able to add it to the template with {if $smarty.get.gid eq 1} <p>Hello!</p> {/if} But it would be easier to keep track of edits with a hook. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 7, 2019 Share Posted October 7, 2019 14 hours ago, SureWeb said: Unfortunately it places the content before the <!DOCTYPE> even if I change the template to Six and use the Standard Cart orderform. on any recent version, probably most of v7, it should work as shown... obviously, if you're using an older version of WHMCS, or custom templates that don't include the required template code, then as I said, it might not work and you'd need to edit the template. though i'm surprised it outputted anything in the wrong place, perhaps there is a corruption in your hook code. 15 hours ago, SureWeb said: I was able to add it to the template with, but it would be easier to keep track of edits with a hook. using Smarty in the template will work, but what version of WHMCS are you using and which orderform template is assigned to this product group ?? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.