westernway Posted July 7, 2016 Share Posted July 7, 2016 I am trying to add the topbar to my Wordpress header. How do I get the $cartitemcount and display it with php? <!-- Shopping Cart --> <div class="pull-right nav"> <a href="/whmcs/cart.php?a=view" class="quick-nav"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs">View Cart (</span><span id="cartItemCount"><?php $cartitemcount ?></span><span class="hidden-xs">)</span></a> </div> Thank you Troy 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 7, 2016 Share Posted July 7, 2016 i'm not sure than an external site can access WHMCS session variables - but there is a built-in alternative... Data Feeds. http://docs.whmcs.com/Data_Feeds they aren't specifically mentioned in the documentation, but there are two feeds that you can use to show the cart total, and the number of items in the cart... <script language="javascript" src="feeds/carttotal.php"></script> <script language="javascript" src="feeds/cartnumitems.php"></script> you should be able to use them to display the information you want in your WordPress header. 0 Quote Link to comment Share on other sites More sharing options...
westernway Posted July 7, 2016 Author Share Posted July 7, 2016 Thank you Brian! 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.