HERE IS HOW YOU FIX MULTIPLE SHIPMENTS
Posted: Thu May 12, 2011 7:44 am
I have been all over these forums looking for a solution to the following problem of which it seems many people have:
Scenario:
I currently ship via UPS. Shipping to Canada with UPS is outrageous and not economical. However shipping to Canada using USPS Flat Rate Box is awesome. AbleCommerce is restricted because it does not send dimensions to USPS, it only sends weight. The ShipSeparate function is useless and I am still not sure why dimensions even exist. So we needed a way to ship via USPS and UPS. The only solution AbleCommerce has is to put items in separate warehouses however when you do that it creates a multiple shipment scenario at checkout for the customer which is confusing and drives customers away. It would drive me away if I saw two different shipments at a checkout.
Solution:
The proper solution is to keep all products in one warehouse and still allow shipping via USPS Flat Rate and UPS internationally. The main challenge is the dimensions. Since AbleCommerce only sends weight USPS does not determines the packages based on that. For example, I have several 15 pound packages that USPS thinks can go into USPS Medium Flat Rate Box Shipping however the box dimensions are so far out it would never work. Below is code placed in the OnePageCheckout.aspx.cs file in the ShipmentList_ItemDataBound method. This accomplishes all that you will need. Here is the code:
//IF USPS INTERNATIONAL RATES ARE RETURNED AND THE PRODUCT IS IN THE NO USPS SHIPPING RANGE THEN DON'T ADD THIS QUOTE
if (quote.ShipMethodId == 80 || quote.ShipMethodId == 81 || quote.ShipMethodId == 82)
{
bool addshipmentquote = true;
for (int i = 0; i < shipment.Items.Count; i++)
{
if (addshipmentquote)
{
if (shipment.Items.ProductId == 701)
{
addshipmentquote = false;
continue;
}
}
}
if (addshipmentquote)
{
localQuotes.Add(new LocalShipRateQuote(quote.ShipMethodId, methodName, formattedRate));
}
}
else
{
localQuotes.Add(new LocalShipRateQuote(quote.ShipMethodId, methodName, formattedRate));
}
What this code does is this: If the quote returned is for one of the USPS methods (80,81,82) AND for every item in the basket if a product exists that cannot go via USPS then do NOT return a USPS quote into the ShipmentList drop down list. So this restricts it showing USPS quotes if a person has placed an item in the basket that cannot go USPS. And if all items in the basket can go USPS and UPS as well it will show all those quotes together and the customer can choose what they want.
This has been a nightmare for us and is finally fixed! I hope someone else can use this too.
Thanks,
Adam Jones
Director of Systems Engineering
http://www.superatv.com
Scenario:
I currently ship via UPS. Shipping to Canada with UPS is outrageous and not economical. However shipping to Canada using USPS Flat Rate Box is awesome. AbleCommerce is restricted because it does not send dimensions to USPS, it only sends weight. The ShipSeparate function is useless and I am still not sure why dimensions even exist. So we needed a way to ship via USPS and UPS. The only solution AbleCommerce has is to put items in separate warehouses however when you do that it creates a multiple shipment scenario at checkout for the customer which is confusing and drives customers away. It would drive me away if I saw two different shipments at a checkout.
Solution:
The proper solution is to keep all products in one warehouse and still allow shipping via USPS Flat Rate and UPS internationally. The main challenge is the dimensions. Since AbleCommerce only sends weight USPS does not determines the packages based on that. For example, I have several 15 pound packages that USPS thinks can go into USPS Medium Flat Rate Box Shipping however the box dimensions are so far out it would never work. Below is code placed in the OnePageCheckout.aspx.cs file in the ShipmentList_ItemDataBound method. This accomplishes all that you will need. Here is the code:
//IF USPS INTERNATIONAL RATES ARE RETURNED AND THE PRODUCT IS IN THE NO USPS SHIPPING RANGE THEN DON'T ADD THIS QUOTE
if (quote.ShipMethodId == 80 || quote.ShipMethodId == 81 || quote.ShipMethodId == 82)
{
bool addshipmentquote = true;
for (int i = 0; i < shipment.Items.Count; i++)
{
if (addshipmentquote)
{
if (shipment.Items.ProductId == 701)
{
addshipmentquote = false;
continue;
}
}
}
if (addshipmentquote)
{
localQuotes.Add(new LocalShipRateQuote(quote.ShipMethodId, methodName, formattedRate));
}
}
else
{
localQuotes.Add(new LocalShipRateQuote(quote.ShipMethodId, methodName, formattedRate));
}
What this code does is this: If the quote returned is for one of the USPS methods (80,81,82) AND for every item in the basket if a product exists that cannot go via USPS then do NOT return a USPS quote into the ShipmentList drop down list. So this restricts it showing USPS quotes if a person has placed an item in the basket that cannot go USPS. And if all items in the basket can go USPS and UPS as well it will show all those quotes together and the customer can choose what they want.
This has been a nightmare for us and is finally fixed! I hope someone else can use this too.
Thanks,
Adam Jones
Director of Systems Engineering
http://www.superatv.com