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

Thread: UPS Maximum Weight

  1. #1
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation UPS Maximum Weight

    While we are using negotiated prices of UPS.
    In admin we have an option to enter the maximum Weight for UPS.
    which is good.
    But I have a issue hear.
    lets say i gave 150 lbs as maximum size for UPS negotiated rates.
    When customer adds Products in shopping cart, and if reaches any thing above 150 lbs.

    Cart is not calculating the shipping and gives a message showing call for Shipping cost.

    why is it not considering anything above as a second box. ie., if shopping cart has products weight 190 lbs the cart should count it as 1 box of 150 lbs and 2nd box of 40 lbs and give the shipping rates.

    How can we achieve it.

    can one help me with this.

    thanks
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  2. #2
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    This will most definitely take a mod to the shipping calculation class. We had the same issue and I resolved it by putting in code to take the total weight and break it up into equal 70 lb increments (thats the max we pack in a box). Lets say a customer ordered 300 lbs worth, I would have 5 boxes. 4 boxes at 70lbs each and then 1 at 20 lbs. I then call ups api with that data.

    its not perfect, obviously you cant break the weight perfectly but this gets us very close and has worked well.

    I dont remember the details of what I changed but it was fairly simple. I think if you search you will see where I asked this same questions long ago. I suggested they create an app config called "splitpackat" and you give it the weight you want to break shipments into. Obviously they never took my advice.

  3. #3
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation Sounds great

    Can you please share your code,
    I would like to implement it on my site.
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  4. #4
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Ill see if I can figure out what/where all it changed.

  5. #5
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Ok, I cant send you the actual code as we have some proprietary calculations in this class. But in the RTSHipping class below is the code ive added/modified. See if this gets you started, feel free to post back here with any questions and ill help as best I can.

    Code:
    //created a local variable to figure out total num of packages based on 70lb weight break
    int numPackages = (int)Math.Ceiling(ShipmentWeight / 70);
    //kill this array that was based on Shipment.Count
    //rateRequest.Shipment.Package = new ups2.ShipmentPackage[Shipment.Count];
    //create this array based on what I determined total package count to be
    rateRequest.Shipment.Package = new ups2.ShipmentPackage[numPackages];
    //set a local variable remainingWeight to total weight
    decimal remainingWeight = ShipmentWeight;
    //down below turn the foreach loop into a while using our numPackages as the control variable
    // foreach (RTShipping.Package p in Shipment)
    while (numPackages > 0)
    
       //right here check if our remaining weight is under our break point, if so set this package to that weight and kill the numPackages control variable
                        // package weight
                        if (remainingWeight <= 70) 
                        {
                            upsPackage.PackageWeight.Weight = remainingWeight;
                            numPackages = 0;
    
                        } else 
                        {
                            //remainingWeight was over 70, set this package to 70, reduce remainingWeight and reduce numPackages by 1
                            upsPackage.PackageWeight.Weight = 70;
                            remainingWeight -= 70;
                            numPackages--;
                        }
                        //upsPackage.PackageWeight.Weight = p.Weight;

  6. #6
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation what Code file you edited this in?

    Can you please tell me which code file you edited to make this work?

    I do not have source code, can i get this done with out source code?
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  7. #7
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Quote Originally Posted by harsha.gus View Post
    Can you please tell me which code file you edited to make this work?

    I do not have source code, can i get this done with out source code?
    Its in RTShipping.cs and no, you will need source to make this change.