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 8 of 8

Thread: [Q] - What are my real-time shipping options when combined weight exceeds max weight?

  1. #1
    jasolution is offline Member
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    49

    Default [Q] - What are my real-time shipping options when combined weight exceeds max weight?

    V: ML 7.0.1.2

    I'm using RTS to pull UPS rates with my maxweight appconfig set to 150 lbs. I have a product that weighs 1 lb. A customer orders 100 of these and then eight other products that have a combined weight of 55 lbs. The total cart now weighs 155 lbs., which is 5 lbs over the UPS max weight.

    When the customer tries to checkout, he receives the "No shipping methods available...blah blah blah" message, thus preventing him from completing the checkout.

    Does ASPDNSF have a method to handle this situation other than just leaving the customer dead in the water during the checkout process? Can someone help me?

    Thanks much!

    Jason

    P.S. It does not make sense to set each of the 1lb items to ship separately, and this is the only option I've found that would seem to provide a remedy.

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    That was actually a known issue in 7.0.1.2 which has been corrected in the latest version. Instead of the "no valid shipping method" error, customers will see a (customizable) prompt asking them to contact you for shipping prices. They can finish the order with no shipping fees added, then have to contact you to set up shipping and you can do an ad-hoc charge to add the fees.

  3. #3
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    This is a problem we all face. Your store works great until someone places an order for 100 widgets, then they cannot get a shipping cost. And marking the widget as "Ships Separately" breaks everyone elses carts.

    In reality, you'll divide the shipment into four or five 30-40 lb boxes (light enough to lift, but not too heavy enough to split the box), and possibly use UPS Hundredweight shipping.

    The box packing routine is contained in the GetRates method of the ShoppingCart class inside AspDotNetStorefrontCommon. It handles ship-separate items and downloadware, but lumps everything else into a common box.

    To change this behavior, you need to divide the weight of the "common box" by the maximum weight you want to ship; I use 50 lbs, but it can be whatever:
    Code:
                    //divide remaining items into (maximum) 50 lb packages
                    int numPackages = Convert.ToInt32(Math.Ceiling(remainingItemsWeight / 50.0M));
                    decimal avgPackageWeight = remainingItemsWeight / numPackages;
    Then iterate once for each numPackages, adding each package to the shipment.

    You are in source-code modification territory here, but you can easily come up with your desired behavior in 20 lines of code.
    Jon Wolthuis

  4. #4
    jasolution is offline Member
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    49

    Default

    Jon,

    Terrific, that's exactly the type of response I was seeking. I knew that we were not the only ones having this problem, but before I started on any custom solution, I wanted to hear how other people were solving it so I wasn't reinventing any wheels.

    Thanks for taking the time to respond and for sharing your know how.

    Jason

  5. #5
    kpaul is offline Member
    Join Date
    Nov 2009
    Posts
    54

    Default

    Would it be possible to get a more complete snipet of code for this? I'm using ML 8.0.1.2. Here's what I have so far but I think there's somewhere else that the weight is being calculated because it's still showing the "call for shipping rates" message. This starts at around line 6427 of ShoppingCart.vb.

    Code:
     
    ' Now get all itmes that do not ship separately, but group them into shipments by distributor
    Dim DistID AsInteger = 0
    Using con As SqlConnection = New SqlConnection(DB.GetDBConn())
         con.Open()
         Using drs As IDataReader = DB.GetRS("SELECT max(DistributorID) as DistID from ProductDistributor", con)
    If drs.Read() Then
    DistID = DB.RSFieldInt(drs, "DistID")
    EndIf
    EndUsing 
    EndUsing
     
    Dim i AsInteger = 1
     
    DoWhile i <= DistID
    remainingItemsWeight = 0.0D
    remainingItemsInsuranceValue = 0.0D
     
    shipment = New RTShipping.Packages()
     
         ' Set destination address of this shipment group:
    shipment = ShipmentDestination(shipmentAddress, shipment)
    realTimeShipping.DestinationResidenceType = shipment.DestinationResidenceType
     
    'set origin address of this shipment group
         shipment = ShipmentOrigin(shipment, i)
     
    Dim Weight AsDecimal = 0.0D
    ForEach c As CartItem In m_CartItems
    'Only calculate rates for products that require shipping
    If (Not c.m_IsDownload) AndAlso (Not c.m_IsShipSeparately) AndAlso (Not c.m_IsSystem) AndAlso c.m_DistributorID = i AndAlso c.m_Shippable AndAlso (Not GiftCard.s_IsEmailGiftCard(c.m_ProductID)) Then
    Weight = c.m_Weight
     
                   If Weight = 0.0D Then
    Weight = AppLogic.AppConfigUSDecimal("RTShipping.DefaultItemWeight")
    EndIf
    If Weight = 0.0D Then
    Weight = 0.5D ' must have SOMETHING to use!
    EndIf
    remainingItemsWeight += (Weight * c.m_Quantity)
    remainingItemsInsuranceValue += (c.m_Price * c.m_Quantity)
    EndIf
    Next c
         If remainingItemsWeight <> 0D Then
    ' divide remaining items into (maximum) 75 lb packages
    Dim numPackages AsInteger = Convert.ToInt32(Math.Ceiling(remainingItemsWeight / 75D))
    Dim avgPackageWeight AsDecimal = remainingItemsWeight / numPackages
    Dim smallerPackage AsInteger = 1
     
    DoWhile smallerPackage <= numPackages
    ' Create package object for this item
    Dim p As RTShipping.Package = New RTShipping.Package()
     
    p.PackageId = PackageID
    PackageID = PackageID + 1
     
    p.Weight = avgPackageWeight
    p.Weight += AppLogic.AppConfigUSDecimal("RTShipping.PackageExtraWeight")
     
    ' Set insurance. Get from products db shipping values?
    p.Insured = AppLogic.AppConfigBool("RTShipping.Insured")
    p.InsuredValue = remainingItemsInsuranceValue
     
    shipment.AddPackage(p)
     
    p = Nothing
    smallerPackage += 1
              Loop
     
    EndIf
     
    shipments.AddPackages(shipment)
    shipment = Nothing
    i += 1
     
    Loop

    Quote Originally Posted by ASPDNSF Staff - Jon View Post
    This is a problem we all face. Your store works great until someone places an order for 100 widgets, then they cannot get a shipping cost. And marking the widget as "Ships Separately" breaks everyone elses carts.

    In reality, you'll divide the shipment into four or five 30-40 lb boxes (light enough to lift, but not too heavy enough to split the box), and possibly use UPS Hundredweight shipping.

    The box packing routine is contained in the GetRates method of the ShoppingCart class inside AspDotNetStorefrontCommon. It handles ship-separate items and downloadware, but lumps everything else into a common box.

    To change this behavior, you need to divide the weight of the "common box" by the maximum weight you want to ship; I use 50 lbs, but it can be whatever:
    Code:
     
                    //divide remaining items into (maximum) 50 lb packages
                    int numPackages = Convert.ToInt32(Math.Ceiling(remainingItemsWeight / 50.0M));
                    decimal avgPackageWeight = remainingItemsWeight / numPackages;
    Then iterate once for each numPackages, adding each package to the shipment.

    You are in source-code modification territory here, but you can easily come up with your desired behavior in 20 lines of code.
    Keith


    http://goo.gl/s20Ot

    ASPDNSF v9.3/64 Bit
    Windows Web Server 2008 R2
    IIS 7.5

  6. #6
    kpaul is offline Member
    Join Date
    Nov 2009
    Posts
    54

    Default

    Figured it out! The same logic needs to be applied to GetHeaviestPackageWeightTotal() in ShoppingCart.vb. That function also checks the weight and shows the "call for rates" message if it exceeds the max.
    Keith


    http://goo.gl/s20Ot

    ASPDNSF v9.3/64 Bit
    Windows Web Server 2008 R2
    IIS 7.5

  7. #7
    Alkaline is offline Senior Member
    Join Date
    May 2006
    Posts
    459

    Default

    hi,

    Please see www.beadsbythedozen.com

    We do this however, the max amount of boxes you can send UPS is 50, they will not accept orders over 500 boxes.
    Simrun AspDotNetStoreFront Development
    Preferred AspDotnetStorefront Development Partner
    ahsan[@]simrun[.]com
    remove the "[]" for email

    Have a Nice Day

  8. #8
    nellanayrb is offline Junior Member
    Join Date
    Oct 2011
    Posts
    1

    Default

    Sorry for reviving an old thread, but we're trying to work around the same problem. Does anyone have a full sample of working code for this? I've found a few snippets from different threads but only part of the solution. If someone can post more details about what needs to be modified or all of the code changes needed, we would very much appreciate the help.