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: Shopping Cart Shipping Estimate

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Exclamation Shopping Cart Shipping Estimate

    We currently have a shipping estimate on the product pages based on the weight of the product to mainland UK.

    We want to add in to the shopping cart a basic estimator for shipping to the UK. I am guessing we need to loop the products in the basket and add the total weight up. Then compare this again the database to show a basic estimate of the shipping.

    So far I have the SQL statement but no idea where I should loop the products and how to include the weight in the sql statement.

    Code:
    SELECT ShippingCharge
    FROM  dbo.ShippingByWeight ON ISNULL(@weight, 0.0) >= dbo.ShippingByWeight.LowValue AND ISNULL(@weight, 0.0) < dbo.ShippingByWeight.HighValue 
    WHERE (dbo.ShippingByWeight.ShippingMethodID = 2)
    We have the source code and have access to the c#.
    Any advice would be helpful.
    (We know there is a shipping estimator already however we need to use our own.)
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    Dusty is offline Member
    Join Date
    Jun 2009
    Posts
    176

    Default

    You should have no need to loop through the products, all you'd need to to use the WeightTotal() method of the ShoppingCart in question. Just pass that into your SQL query and you should get the results you're looking for.

    Dusty
    ASPDotNetStorefront Staff

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    I cant see the WeightTotal() anywhere in the coding? How would I call it and retrieve the value?
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Fixed
    Code:
    cart.WeightTotal()
    That was what I was looking for.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience