UPS shipping returns incorrect quotes Always Free Shipping and other Shipping
I am having an issue with one of my customizations...
We have some products that we have free shipping enabled and wanted to offer expedited shipping. To accomplish this I simply removed the if statement here:
Code:
// disable only when entire cart is free shipping
// if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
// }
The problem is, while it still shows the ups quote, it doesn't update based on quantity. For example, an order of 5 items ships for the same cost as an order of one (ack!). I'm not sure where else to look to get the other shipping forms calculating correctly.
Thanks,
Phaylon
Re: UPS shipping returns incorrect quotes
Looks like i failed to mention that that line of code is in /includes/modules/shipping/ups.php
Until I figure it out, I just reversed my changes.
Does anyone know how to show expedited shipping options for items that ship free ups ground?
Re: UPS shipping returns incorrect quotes
Edit the shipping module and comment out the test ...
Code:
// disable only when entire cart is free shipping
// if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
// }
Next, go to the shipping class and add the code in RED:
Code:
function calculate_boxes_weight_and_tare() {
global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
// bof: add back Always Free Shipping weight
$total_weight += $_SESSION['cart']->free_shipping_weight;
// eof: add back Always Free Shipping weight
if (is_array($this->modules)) {
Make sure you have the FREE SHIPPING! freeshipper installed ... and now you will see the Free Shipping *and* the regular shipping ...
NOTE: make sure you add Product Weight to the Products marked as Always Free Shipping so that you get the rates quoted ...
Re: UPS shipping returns incorrect quotes
Ahh beautiful. Was having trouble finding the functions responsible. Thanks Ajeh!
Re: UPS shipping returns incorrect quotes
You are most welcome ... thanks for the update that this allows you to use both Always Free Shipping and UPS shipping quotes at the same time ... :smile:
Re: UPS shipping returns incorrect quotes
Well I thought this solution was the end of the issue, but it seems not... This DID fix the original problem of multiple products processing shipping as a single item, but it has created another issue.
The Quote's provided from UPS are correct, but the cost listed on the subtotal line used to calculate the order total is incorrect. It is over charging significantly. From my testing I have found it is charging for double the weight. *ack*
Removing the edits to calculate_boxes_weight_and_tare() effects the quote only not the actual charge listed in the subtotal.
Any Ideas?
Re: UPS shipping returns incorrect quotes
What are your settings in the Configuration ... Shipping/Packaging ...
When you go to the Modules ... Shipping ... and click on UPS ... what are the settings in the right panel?
Re: UPS shipping returns incorrect quotes
Quote:
Originally Posted by
Ajeh
What are your settings in the Configuration ... Shipping/Packaging ...
Enter the Maximum Package Weight you will ship 500
Package Tare Small to Medium - added percentage:weight 10:1
Larger packages - added packaging percentage:weight 10:3
Display Number of Boxes and Weight Status: 0
Order Free Shipping 0 Weight Status: 0
Shipping Estimator Display Settings for Shopping Cart 2
Display Order Comments on Admin Invoice 1
Display Order Comments on Admin Packing Slip 1
Quote:
Originally Posted by
Ajeh
When you go to the Modules ... Shipping ... and click on UPS ... what are the settings in the right panel?
Enable UPS Shipping: True
UPS Pickup Method: RDP
UPS Packaging? CP
Residential Delivery? RES
Handling Fee: 4
Handling Per Order or Per Box: Box
Tax Class: --none--
Tax Basis: Shipping
Shipping Zone: --none--
Sort order of display: 0
Shipping Methods are: 2d air, 3d standard, ground, and worldwide express.
I don't see anything in there that was changed.
I create a cart and get quoted $65 and in the totals area its $88.39. When I change the quantity to 2, the quote shows $88.39. Matching to the cent doesn't seem coincidental. But I also noticed that my cart displays: Total Items: 2 Weight: 0lbs.
Could it be the actual shipping line item in the order total isn't using calculate_boxes_weight_and_tare()?
Re: UPS shipping returns incorrect quotes
You need to make the setting for:
Quote:
Enter the Maximum Package Weight you will ship 500
a valid amount for UPS, such as the default of 50 or 70 ...
Your Tare Rates are adding 10% + 1 lb to the order for Small and Medium boxes and 10% plus 3 pounds to the order for Large boxes ...
Quote:
Package Tare Small to Medium - added percentage:weight 10:1
Larger packages - added packaging percentage:weight 10:3
If you have 0 weight on the order, then you are just getting quotes on the Tare Rates ...
What weight do you have set on the Product Weight?
Re: UPS shipping returns incorrect quotes
Embarrasing I didn't include that... It is set to 4 lbs. *blush*
Re: UPS shipping returns incorrect quotes
You do not have this Product marked as Virtual or Always Free Shipping and there isn't a Download on it ... correct?
Do you have a link to this Products URL to see what it is doing?
What charges are you expecting on UPS for this Product?
What charges are you seeing?
What is your Ship From?
What is the Ship To?
Re: UPS shipping returns incorrect quotes
First, I really want to say thanks for helping me out. Troubleshooting through forums cant be easy!
Quote:
Originally Posted by
Ajeh
You do not have this Product marked as Virtual or Always Free Shipping and there isn't a Download on it ... correct?
Well, it is set as Always Free Shipping because I want ground shipping to be free. I'm just trying to give customers the option of paying for 2day or 3day shipping.
Quote:
Originally Posted by
Ajeh
Do you have a link to this Products URL to see what it is doing?
http://lasersandlights.com/blissligh....html?cPath=18
I also turned on weights display from the shipping configuration and it does indeed show the quote as 7.6lbs and a line item weight of 14.6lbs.
Quote:
Originally Posted by
Ajeh
What charges are you expecting on UPS for this Product?
The actual quote is correct from UPS. When you move to checkout, the actual charge for shipping shows different than the quote.
Quote:
Originally Posted by
Ajeh
What charges are you seeing?
Sorry, I'm not sure what you are getting at with this question. I'm seeing two different charges. Quoted charge from UPS api (correct) and actual charge (just below subtotal in the checkout) as different (incorrect).
Quote:
Originally Posted by
Ajeh
What is your Ship From?
areacode 95959. Our shop address
Quote:
Originally Posted by
Ajeh
What is the Ship To?
areacode 01238. A customers address. Though the discreptancy shows up no matter where I ship to.
Re: UPS shipping returns incorrect quotes
For checkout_shipping I see:
Quote:
FREE SHIPPING!
Free Shipping Only $0.00
United Parcel Service (7.60lbs) United Parcel Service
2nd Day Air $56.25
3 Day Select $41.63
Ground $18.26
What do you want to see for shipping?
NOTE: I think you need to add these to your stylesheet
.hiddenField {
display: none;
}
.visibleField {
display: inline;
}
Re: UPS shipping returns incorrect quotes
Yes, that area of the screen is correct. The problem is up in the actual cart.
Sub-Total: $198.99
United Parcel Service (14.20lbs) (2nd Day Air): $88.39
: $0.00
Total : $287.38
The problem is in the actual charges. due to this line of code:
$total_weight += $_SESSION['cart']->free_shipping_weight;
I changed it to this:
Code:
// bof: add back Always Free Shipping weight
$free_ship_weight = $_SESSION['cart']->free_shipping_weight;
if ($total_weight != $free_ship_weight){
$total_weight += $free_ship_weight;
}
// eof: add back Always Free Shipping weight
That seems to fix the problem when the cart only has free shipping items, but adds the free shipping weight into mixed carts... think I am getting closer.
Re: UPS shipping returns incorrect quotes
Are you talking about the $0.00 in the:
/index.php?main_page=checkout
or the page:
/index.php?main_page=shopping_cart
and the:
Total Items: 1 Weight: 0lbs Amount: $198.99
On the checkout page, that looks like that is Tax ...
On the shopping_cart page, you would need to do more customization to the code to try to match up the adjusted weight ...
Re: UPS shipping returns incorrect quotes
the page I am worried about is /index.php?main_page=checkout
I know the line " : $0.00" refers to the taxes so I am not too worried about displaying like that, just the weight discreptancies.
Re: UPS shipping returns incorrect quotes
If you mean because the shopping_cart shows:
Weight: 0lbs
and the checkout shows:
7.60lbs
the simplest solution is to go the Configuration ... Layout Setting ... and change the setting for:
Shopping Cart - Show Totals
Show Totals Above Shopping Cart?
0= off
1= on: Items Weight Amount
2= on: Items Weight Amount, but no weight when 0
3= on: Items Amount
to 2 so that it does now show the weight on the shopping_cart page in the totals at the top ...
Re: UPS shipping returns incorrect quotes
I only have the weight's displayed so I can quickly tell if something is amiss. Let me see if I can clarify my problem.... Your original solution to display shipping methods worked great. This code in the shipping/ups.php:
Code:
// if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
// }
Except when ordering multiple items with free shipping (UPS was quoting for a 1 lb package). So you suggested this change to the classes/shipping.php:
Code:
$total_weight += $_SESSION['cart']->free_shipping_weight;
Which fixes the quote shown on index.php?mainpage=shopping_cart
But when you continue to 'index.php?mainpage=checkout' the shipping quote shows correctly (In the delivery information heading; bottom left) but the actual charges in the order total are doubled and this is what customers are actually charged.
Re: UPS shipping returns incorrect quotes
What is the products_id that you are testing?
Re: UPS shipping returns incorrect quotes
Quote:
Originally Posted by
Ajeh
What is the products_id that you are testing?
That would be 121. Blisslight Spright - Green.
From further testing, it looks as if $total_weight includes free shipping weight so this code:
Code:
$total_weight += $_SESSION['cart']->free_shipping_weight;
Ends up including the free shipping weight twice. Do you know if there is somewhere i can get a full description of what data is included in the $_SESSION object?
If there were, for example, a $_SESSION['cart']->shipping_weight so I could build the $total_weight correctly for shipping methods I want to estimate.
Re: UPS shipping returns incorrect quotes
So far, the only way I can see:
United Parcel Service (14.20lbs) (2nd Day Air): $88.39
on the checkout page is if I add Quantity 2 of products_id 121 with a 2lb attribute on it ...
So a 4lb item with a 2lb Attribute adding the Tare Rate that you have set of 10:1 and the Handling 4.00 ...
That gives a weight of 14.20lbs ... what is doubled here?
Re: UPS shipping returns incorrect quotes
SOLVED:
Its correctly quoting free shipping only carts with the change I made:
Code:
// bof: add back Always Free Shipping weight
$free_ship_weight = $_SESSION['cart']->free_shipping_weight;
if ($free_ship_weight > $total_weight){
$total_weight = $free_ship_weight;
}
This corrected the shipping for free shipping carts and normal shipping carts, but fails to address mixed carts. Once I got a dump of the $_SESSION object, I was able to correct it. Here is the solution:
Code:
// bof: add back Always Free Shipping weight
$total_weight = $_SESSION['cart']->free_shipping_weight + $_SESSION['cart']->weight;
// eof: add back Always Free Shipping weight
Thanks for your responses! So relieved! :)
Re: UPS shipping returns incorrect quotes
Thanks for the update of what you had to do ...