Jump to content

Display Topbar in Wordpress


Recommended Posts

I am trying to add the topbar to my Wordpress header.

 

topbar.jpg

 

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

Link to comment
Share on other sites

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. :idea:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated