Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: current Item count in shoppingcart.aspx

  1. #1
    tytyguy is offline Senior Member
    Join Date
    Nov 2007
    Posts
    307

    Default current Item count in shoppingcart.aspx

    Hello, I am curious what I could do to get the total number of items in the shopping cart on shoppingcart.aspx? I am trying to calculate the shipping on that page instead of having "shipping is calculated during checkout" because i have a per item price for shipping based on how many items there are. Thanks

  2. #2
    John Reasons is offline Senior Member
    Join Date
    Oct 2009
    Posts
    119

    Default

    Just from a preliminary look,

    You could run through each item in the cart, then get the quantity of the cart item, Depending on where you do this, I would imagine it would be a fairly small mod. If you have source you could take a look at the ShoppingCart class in the AspDotNetStorefront core.

  3. #3
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Have you already taken a look at the shipping estimator? It may be exactly what you're looking to do. You could also use the token (!NUM_CART_ITEMS!) to get an integer representing the number of items in the cart (though normally this would be used for display on the site rather than calculations...hence the skin token format) or programmatically you could pass the CustomerID and the CartType to the ShoppingCart.NumItems method
    Code:
    ShoppingCart.NumItems(ThisCustomer.CustomerID, CartTypeEnum.ShoppingCart)
    to get an integer value back representing the number of items in the cart.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  4. #4
    tytyguy is offline Senior Member
    Join Date
    Nov 2007
    Posts
    307

    Default

    worked perfect.. thanks