FlyHost Posted February 13, 2017 Share Posted February 13, 2017 Hello friends "cart.php?a=view" How can I show the page variables on the header page? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 13, 2017 Share Posted February 13, 2017 there's no default way to do this... and it really depends *exactly* what you want to show in the header. you could possibly tweak one of the Data Feeds to do it (cart total or cart items) - or you could modify the header.tpl template directly (or perhaps with the help of an action hook), to show the information you want. depending on what you want to show, you may just need to query the session variable. 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 13, 2017 Author Share Posted February 13, 2017 For example, how can I show the total amount of cart? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 13, 2017 Share Posted February 13, 2017 if using a feed, you could change the code below in header.tpl... <!-- Shopping Cart --> <div class="pull-right nav"> <a href="{$WEB_ROOT}/cart.php?a=view" class="quick-nav"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs">{$LANG.viewcart} (</span><span id="cartItemCount">{$cartitemcount}</span><span class="hidden-xs">)</span></a> </div> to... <!-- Shopping Cart --> <div class="pull-right nav"> <a href="{$WEB_ROOT}/cart.php?a=view" class="quick-nav"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs">{$LANG.viewcart} (</span><span id="cartItemCount">{$cartitemcount} - <script language="javascript" src="feeds/carttotal.php"></script></span><span class="hidden-xs">)</span></a> </div> it should work fine, although you might occasionally lose it during domain ordering as WHMCS v7 uses jQuery to rewrite the span - so if that is an issue, you will likely need to tweak the cart js too. 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 13, 2017 Author Share Posted February 13, 2017 Thank you for your help. 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 13, 2017 Author Share Posted February 13, 2017 How can I hookla instead of script? 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 13, 2017 Author Share Posted February 13, 2017 if using a feed, you could change the code below in header.tpl... <!-- Shopping Cart --> <div class="pull-right nav"> <a href="{$WEB_ROOT}/cart.php?a=view" class="quick-nav"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs">{$LANG.viewcart} (</span><span id="cartItemCount">{$cartitemcount}</span><span class="hidden-xs">)</span></a> </div> to... <!-- Shopping Cart --> <div class="pull-right nav"> <a href="{$WEB_ROOT}/cart.php?a=view" class="quick-nav"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs">{$LANG.viewcart} (</span><span id="cartItemCount">{$cartitemcount} - <script language="javascript" src="feeds/carttotal.php"></script></span><span class="hidden-xs">)</span></a> </div> it should work fine, although you might occasionally lose it during domain ordering as WHMCS v7 uses jQuery to rewrite the span - so if that is an issue, you will likely need to tweak the cart js too. How can I hookla instead of script? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 14, 2017 Share Posted February 14, 2017 How can I hookla instead of script? I think if you didn't want to edit any template and wanted to use an action hook instead (and keep the existing Six design), about the only way to do it would be to rewrite the value of {$cartitemcount}... and i'm not even sure if that would work 100% 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 14, 2017 Author Share Posted February 14, 2017 I think if you didn't want to edit any template and wanted to use an action hook instead (and keep the existing Six design), about the only way to do it would be to rewrite the value of {$cartitemcount}... and i'm not even sure if that would work 100% Would you say the foreach code in order to list the products in your shopping cart? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 14, 2017 Share Posted February 14, 2017 you won't easily be able to list the products in the cart as I think the session array only stores their product IDs and NOT their product names.... with an ID value, you could use the API or query the database to get the product name. 0 Quote Link to comment Share on other sites More sharing options...
FlyHost Posted February 14, 2017 Author Share Posted February 14, 2017 you won't easily be able to list the products in the cart as I think the session array only stores their product IDs and NOT their product names.... with an ID value, you could use the API or query the database to get the product name. Now, if I make boxes in the title section, can not I show the items that are added to the box section? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 14, 2017 Share Posted February 14, 2017 if you mean can you use the variables from ordersummary.tpl in your header template, then the answer is no... not all the templates can access the same variables. 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.