ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Shopping Cart Totals - Show all the time?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Shopping Cart Totals - Show all the time?

 Post Reply Post Reply
Author
Message
mrjasonsweet View Drop Down
Newbie
Newbie


Joined: 03-June-2006
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrjasonsweet Quote  Post ReplyReply Direct Link To This Post Topic: Shopping Cart Totals - Show all the time?
    Posted: 22-September-2006 at 9:51am

Hi!  I'm using <!--#include file="SmallShoppingCart.asp"--> to show the cart totals.  It works fine but it only appears if the customer has adding at least one product to the shopping cart.

I would like it to appear all the time, even if it shows 0 items in cart.  Obviously a conditional statement is being used to hide/display this information. 

Can someone direct me to where I might be able to disable this?

Thanks very much for any guidance.



Edited by mrjasonsweet - 22-September-2006 at 9:52am
Back to Top
sawan View Drop Down
Newbie
Newbie
Avatar

Joined: 08-August-2006
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote sawan Quote  Post ReplyReply Direct Link To This Post Posted: 22-September-2006 at 10:05am

Hi,

this is the code that i am using, and it is working fine.

<% 'Show shopping cart total
    dim vcCartArr, vcCartIndex, v, scantidadCart7, vcTotal, vcItems

    vcCartArr=Session("pcCartSession")
    vcCartIndex=Session("pcCartIndex")
    vcTotal=Cint(0) 'calculates the cart total
    vcItems=Cint(0) 'counts items in your cart

    for v=1 to vcCartIndex
     if vcCartArr(v,10)=0 then
      vcItems=vcItems + vcCartArr(v,2)
      vcTotal=vcTotal+(vcCartA rr(v,2)*vcCartArr(v,17))
      vcTotal=vcTotal+(vcCartA rr(v,2)*vcCartArr(v,5))
      vcTotal=vcTotal-vcCartAr r(v,30)
      vcTotal=vcTotal+vcCartAr r(v,31)
      vcTotal=vcTotal-vcCartAr r(v,15)
      'vcTotal=vcTotal + vcCartArr(v,5) + (vcCartArr(v,3)*vcCartArr(v,2))
     end if
    next
 %>
 
    <%if vcItems > 0 then %>
    <%response.write vcItems%> Product(s)
        in cart Total: <%response.write scCurSign & money(vcTotal)%>
<%else%>
   
             0 Product(s) in cart Total &pound;0.00
    <%end if%>  
        
             &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp ;
             <a href="/pc/checkout.asp">Checkout</a>
    </div>

Sawan S Ruparel
Back to Top
Jackalope View Drop Down
Groupie
Groupie


Joined: 07-July-2006
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jackalope Quote  Post ReplyReply Direct Link To This Post Posted: 24-June-2007 at 9:05pm

I just found an easier way to show the cart contents even if the total is $0.00. Just change the following code in the SmallShoppingCart.asp file:

from:

if vcItems > 0 then

to:

if vcItems > -1 then

This programming stuff is pretty fun. I was trying all sorts of things to get this to work, until I looked a little higher in the code and realized I could use "negative" numbers.

Back to Top
Justplaying View Drop Down
Newbie
Newbie
Avatar

Joined: 16-August-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justplaying Quote  Post ReplyReply Direct Link To This Post Posted: 17-August-2007 at 2:52pm

Hi

Can anyone help with this issue im having

I have moved the <!--#include file="Store/pc/SmallShoppingCart.asp"--> into the header

I wanted to show the cart on the other side of page

When I view the site I get:

Microsoft VBScript compilation error '800a0411'

Name redefined

/Store/pc/SmallShoppingCart.asp, line 5

dim vcCartArr, vcCartIndex, v, scantidadCart7, vcTotal, vcItems
----^
Any input would be greatly received
Neil
 
Back to Top
Matt View Drop Down
Moderator Group
Moderator Group


Joined: 20-July-2006
Location: United States
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 17-August-2007 at 3:42pm
Hi Neil,

If you inlcude the file twice you will get that error because the variables are declared twice.  Check your footer to make sure its not in both files.

Matt
Back to Top
Justplaying View Drop Down
Newbie
Newbie
Avatar

Joined: 16-August-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justplaying Quote  Post ReplyReply Direct Link To This Post Posted: 18-August-2007 at 4:37am

Hi Matt

Thanks for the advice, in an effort to resolve another issue I moved a clean copy of the footer into the root directory.

I didnt realise you couldnt have 2 in the one place

Thanks

Neil

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.074 seconds.