VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-Cart StoreFront Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Session Variables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - April 05 2004 :  07:18:16  Show Profile  Reply with Quote
Hi Guys, I'm new to the forums, but plan to hang around for a while - i'm working on a shop for a client www.shades.co.uk.

My question is this - are there any specific Session variables (or functions) in VP ASP which contain the number of items in the shopping cart, total value of items in the shopping cart, and the current logged in user's name.

If not, what would people consider the best method of getting this data?

I have identified the minicart ASP page as a potential source of this information, but I thought I'd ask here first.

These values are to appear on every page of the site, hence the question.

Thanks to all in advance,


Senior Member

United Kingdom
1898 Posts

Posted - April 05 2004 :  15:55:41  Show Profile  Visit devshb's Homepage  Reply with Quote
please feel free to correct me anyone if I'm wrong, but....

if you use:
that'll put the count of cart "items" into x. But in that case I think "item" refers to the number of different products in the cart, not the physical total quantity.
ie that'll show count(products) not sum(qty)

To get what you're after, I think your best bet is to create a hacked-about copy of the NavigateShowMiniCart function that's in shopproductsubs.asp (which I've done before for exactly this scenario), where you copy that function to another one (say, NavigateShowTinyCart), strip out all the html-printing commands in that copied function, and just use the totalling/counting logic. Then at the end of the function (when you've got the total count/amt), just print a simple/small html table with your cart icon and the total amt/count. I couldn't find anywhere that did this calculation/summing without printing spurious html output (even the "SHORT" version was too long and did lots of html stuff I didn't want it to do), so I ended up building a self-contained copy of the function with the minimal amount of html that was needed for the "tinycart".

When hacking about that copied function, you'll only need the bits which are relevant to the "SHORT" cart format.

But, the mini-cart might be good enough for what you're doing; it depends. You could try it and see; just add:
<% NavigateShowMiniCart("SHORT") %>
to the header file and see if it's ok for you.
My guess is that it won't be ok, because you'll want to display this miniform even if the cart is empty, and will also want to make other changes (such as adding the username as you mentioned), in which case you'll probably be better off just doing the above so that you've got more control over the html/format etc.

Also, I remember having problems when just using the session's cart total for the amount as it was sometimes out of synch with the true total of the cart, so the only way to get a true count/sum of qty/cost of the cart was to go through all the calc logic that's in something like the minicart function.

Simon Barnaby
Freelance Developer
Java-E UK
[email protected]

Edited by - devshb on April 05 2004 16:47:02
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000