Allow customer to choose shipping
Is there any tutorial on setting up shipping for USPS to allow a customer to choose the type of shipping i.e. parcel post vs. priority?
Thanks
Is there any tutorial on setting up shipping for USPS to allow a customer to choose the type of shipping i.e. parcel post vs. priority?
Thanks
I'm not sure about the documentation. I do know how to do it:
1) Open up your snippits panel and find the dropdown list associated with USPS shipping types and drag it into place on your checkout page.
2) Open up your confirm page and store the posted value from the ship type list into a session variable
3) Update the USPS server behavior on that page specifying the ship type from the Session variable you just stored.
So I got this working but I have one problem. I am getting errors when selecting Priority:
-2147219431DomesticRatesV3:clsRateV3.ValidateContainer;RateEngineV3.ProcessRequestInvalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.1000440
API=RateV3&XML=PRIORITY481974819710LARGE
I think it has to do with the package type. How can I tell it to use one package type for one shipping type vs another?
Hmmmm....I think this will work:
if ( $_SESSION['USPS_Shipping'] == 'PRIORITY' ) {
echo '$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "FLAT RATE BOX"; ';
} else {
echo '$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "YOURPACKAGING"; ';
}
Hard to tell since I have other shipping errors going on that we're trying to figure out with a support ticket.
That seems right, but I think you may need to pass a code instead of the text itself.
You mean instead of using the text PRIORITY as the value on the checkout page and session variable place a numerical value like 1?
I forget what their codes are.... I just looked it appears YOURPACKAGING is correct.
If you are using a flat rate box, you probably don't need it calculated at all... it is a flat rate.
You may only want to calculate when you aren't using a flat rate box and always use "YOURPACKAGING" when calculating the rate.
Oh I see what you're getting out. However I think it would be just easier to set itto return a price from USPS for all options than to code a flat rate for the priority and variable rates for the others...I mean you guys have already done the work so why mess with success right. :)
I don't think the shipping calculator works for flat rate boxes. I'm not sure but I think it is only designed for custom packaging. That might be the reason for the packaging error.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.