Print Page | Close Window

Shopping Cart Totals - Show all the time?

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=459
Printed Date: 21-April-2025 at 12:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Shopping Cart Totals - Show all the time?
Posted By: mrjasonsweet
Subject: Shopping Cart Totals - Show all the time?
Date 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.




Replies:
Posted By: sawan
Date 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


Posted By: Jackalope
Date 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.



Posted By: Justplaying
Date 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
 


Posted By: Matt
Date 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


Posted By: Justplaying
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net