kmm2908 Posted September 25, 2016 Share Posted September 25, 2016 I have a sidebar hook that adds some extra content but I only want it to do that for shopping cart and check out pages, how can I best achieve that? Add if statements to the hook, how do I check it's a cart page?. Appreciate any help. - - - Updated - - - If I am in a sidebar hook how can I access the template variables? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 25, 2016 Share Posted September 25, 2016 what variables you are looking for exactly? if (APP::getCurrentFileName()=="cart"){ // Anything here will be applied inside cart.php page/sections } 1 Quote Link to comment Share on other sites More sharing options...
kmm2908 Posted September 25, 2016 Author Share Posted September 25, 2016 Was just wondering in general how I access template variables in a hook. Thank you for the if statement, was just what I was looking for. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 25, 2016 Share Posted September 25, 2016 use Contexts http://docs.whmcs.com/Editing_Client_Area_Menus#Context it will provide list of values based on what page you are in, and if client is logged-in or not 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.