You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
We do a lot of shipping with the USPS where we use the click and ship feature of the post office web site for Regular Priority Mail, Priority Mail Flat Rate Envelopes, Priority Mail Small Flat Rate Box, Priority Mail Medium Flat Rate Box, and Priority Mail Large Flat Rate Box. We also print the postage labels using the click and ship feature. On all five of those priority mail options, we are able to use the lower on-line rates. The on-line rates are actually commercial rates for the various priority mail containers. We also use the express and global mail services through click and ship and the CCP7 shipping cart is out of date with keeping up with those services.
I ran a test using "priority commercial" as a service name and made an entry in the REALTIMESERVICES table and I modified the USPS.PHP program to allow the service to go through by changing the hard coded array $usps_domcodes to include the service name. I turned debug on and verified that API with the USPS worked okay and returned valid data. So, I have proven it's possible to set the CCP7 cart up so I can use the various service names to go through and return the commercial rates.
Here's the trace info which indicates this part of the process worked okay.
CORE_Remote::connect: Sending request to URL http://production.shippingapis.com/shippingapi.dll: Array ( [API] => RateV3 [XML] => <RateV3Request USERID="277TJENT5778"><Package ID="0"><Service>Express</Service><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>Regular</Size><Width>6</Width><Length>6</Length><Height>1</Height><Girth>14</Girth><Machinable>True</Machinable></Package><Package ID="1"><Service>First Class</Service><FirstClassMailType>Parcel</FirstClassMailType><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>Regular</Size><Width>6</Width><Length>6</Length><Height>1</Height><Girth>14</Girth><Machinable>True</Machinable></Package><Package ID="2"><Service>Parcel</Service><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>Regular</Size><Width>6</Width><Length>6</Length><Height>1</Height><Girth>14</Girth><Machinable>True</Machinable></Package><Package ID="3"><Service>Priority Commercial</Service><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>Regular</Size><Width>6</Width><Length>6</Length><Height>1</Height><Girth>14</Girth><Machinable>True</Machinable></Package></RateV3Request> )
CORE_Remote::connect: Received response from URL http://production.shippingapis.com/shippingapi.dll: <?xml version="1.0"?> <RateV3Response><Package ID="0"><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="3"><MailService>Express Mail</MailService><Rate>13.05</Rate></Postage></Package><Package ID="1"><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><FirstClassMailType>PARCEL</FirstClassMailType><Size></Size><Zone>1</Zone><Postage CLASSID="0"><MailService>First-Class Mail</MailService><Rate>1.73</Rate></Postage></Package><Package ID="2"><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>REGULAR</Size><Machinable>TRUE</Machinable><Zone>1</Zone><Postage CLASSID="4"><MailService>Parcel Post</MailService><Rate>4.90</Rate></Postage></Package><Package ID="3"><ZipOrigination>99205</ZipOrigination><ZipDestination>99205</ZipDestination><Pounds>0</Pounds><Ounces>4</Ounces><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="1"><MailService>Priority Mail</MailService><Rate>4.95</Rate><CommercialRate>4.80</CommercialRate></Postage></Package></RateV3Response>
The USPS.PHP lacks the code to pull out and display the CommercialRate 4.80 and it lacks the code to identify and list "Priority Commercial" $4.80 as an option the customer can select in the Realtime list of rates at checkout time. It seems to me that the USPS.PHP program has not been kept up with what is going on in the world of all the container types that are now possible with the USPS.
In our experience of using click and ship on the USPS web site, we have often found that the priority mail online rates, which are the same as the commercial rates, are less than what it would cost to send goods via parcel post. There is also free delivery confirmation when using the online click and ship for the USPS.
What's it going to take to get the USPS.PHP program and associated REALTIMESERVICES table brought up to date so they match the click and ship services in the USPS web site as far as displaying the online rates in the shopping cart? The USPS.PHP program needs work so our customers can take advantage of the reduced on line (commercial) rates in the CCP7 shopping cart.
Regards,
Thomas Giannou
Offline
Thank you for the post, Thomas. Please provide a list of the entries needed for the class vars:
$usps_domcodes
$usps_intlcodes
And the entries into the ecom_shiprealtimep table that are necessary. We'll add them in the first update to CCP7 if you provide them this week. Thanks.
Offline
Nick,
I think it will also require some other coding to be done, once all the $usps_domcodes, $usps_intlcodes, and the table entries are made into the ecom_shiprealtimeep table.
For example: I did a test on the mail service named "priority commercial" and what the post office returned was
this: "...<MailService>Priority Mail</MailService><Rate>4.95</Rate><CommercialRate>4.80</CommercialRate>
They gave the regular rate for priority mail which would be 4.95 and they returned the Commercial Rate of $4.80. The commercial rate is the same thing as the online click and ship rate when you purchase postage on line. I think I can figure out all the service codes to use including the flat rate service codes by simply doing traces. I found that if you put in a service code they don't recognize, they return all the service codes you can use as a description in an error message. From the above string, we might want to see something like this in the selection list on the cart depending upon which entries were turned on in the ecom_shiprealtimeep table:
Priority Mail Commercial $4.80
Priority Mal $4.95
In order for those to show up in the selection list, someone is going to have to write the code into the USPS.PHP program sort of like the First Class Mail had to be coded into that program. What I am saying here is that "Priority Mail Commercial" might be in the ecom_shiprealtimeep table, but there has to be logic in the USPS.PHP to look for the CommercialRate string and pick up that discounted rate.
I think I can get all the mail service codes together and what each code is going to return from the post office. There is a code I haven't tried that might do the trick.. "All". That might return all the service codes and rates from the post office in one return string. Then, paramaters could be set up in the ecom_shiprealtimeep table so we could select which one of those services and rates we want to appear in the selection list on the shopping cart.
The thing that makes this different is I sent out a mail service = 'priority commercial' and got back 'priority mail' rate=4.95 and commercialrate=4.80.
I can see that if we could send out the service name "All" and got back one response with all the domestic rates on it that applied to the weight and package dimentions, it could make this external communication run faster because we would get everything we need in a single service request. The code in the USPS.PHP program might get a little hairy depending upon what the reply string looks like back from the post office. I think one could still use the ecom_shiprealtimeep to identify what rates actually end up in the selection list on the shopping cart.
As we go out with certain weights and dimensions, certain options might drop off the return list. I would expect to see that happen in the flat rate envelopes, and flat rate boxes which have certain weight limits into certain countries. When those limits are exceeded, they flip into priority mail international and drop the flat rate containers. That would automatically be done by the post office return string so you wouldn't have to have any of those rules coded on this end. Even the 70 lb limit might be handled differently by simply detecting the error return from the post office to notify the shopping cart that the upper weight limit had been exceeded.
Regards,
Thomas Giannou
Offline
Nick,
The information about USPS service codes is located in this document from the USPS:
http://www.usps.com/webtools/htm/Rate-C … s-v2-3.htm
That file is supposed to contain everything you want to know about service codes and other required fields that need to be present along with the service codes. For the domestic mail service codes, search for "RateV3 Service Request" to locate a table of the domestic service codes and what other fields are required to go along with those service codes.
The current cart seems to rely mainly upon service codes going out, but if you look at the "RateV3 Service Request" table, you will see that what is required is a service code plus several other fields that must be present with that service code in order to resolve to a specific postage rate.
For example there are eight iterations of the service <Priority> and the service <Priority Commercial> that require other fields to be include in what is sent out to the post office web site in the API data stream. These other fields seem to be missing from CCP logic and need to be included in order to get back the correct postage rate.
For example: <service><priority></service><container><Lg Flat Rate Box></container> are the two fields that have to be in the API stream sent out in order to have the postal system return a rate for a "Priority Mail Lg Flat Rate Box".
The data stream returned for the above service request and container size will contain a stream of data that will look like this:
<Postage CLASSID="22"><MailService>Priority Mail Large Flat-Rate Box</MailService><Rate>13.95</Rate></Postage>
Unfortunately, what they actually return "Priority Mail Large Flat-Rate Box" doesn't match up with their documentation which shows 22 Priority Mail Flat-Rate Large Box. So, you can't trust the return descriptions in the USPS documentation about what the description is going to look like that they send back. Some descriptions match their documentation and some don't match their documentation. The only way to know for sure is to run a debug test that shows all the possible combinations.
The above info should be enough for you to get through the domestic mail service options.
When it comes to handling the international mail, they don't use a <service> tag going out. They use a <MailType> tag with the following possible values "Package, Postcards or aerogrammes, Matter for the blind, Envelope". There's also some other required fields you must include in the request going out. What they send back is a service id code and i.e. <Service ID="4">
and a bunch of associated fields you get to pull data from. <SvcDescription>Global Express Guaranteed</SvcDescription> is an example of what their descriton looks like for ID="4", but I wouldn't rely on their documentation for the accurate descriptions. I would run a debug test to see what their descriptions really look like if you are going to try to match a description in an sql table up with what the IntlRateResponse looks like.
There's other options like insurance, or signed delivery confirmation, etc., that you might want to include that would end up being part of the total postage for any given package. Insurance seems to be covered in the international rate calculation, but I didn't see it on the domestic side. I suspect those options are handled with a different API string for domestic mail.
I hope this makes sense.
Regards,
Thomas Giannou
Offline
Has this gotten addressed? I'm asking because I notice on my checkout, where the package size should call for a Priority MailŪ Small Flat Rate Box it is instead providing pricing for a Priority MailŪ Flat Rate Envelope, The difference is only $.05, but I wonder what else is different. I'd also like to be able to offer the commercial rate as discussed above.
Priority MailŪ Small Flat Rate Box - $4.95
USPS Supplied Small Box: 8-5/8" x 5-3/8" x 1-5/8"
Priority MailŪ Flat Rate Envelope - $4.90
USPS Supplied Envelope: 9-1/2" X 12-1/2
Do I need to have my package dimensions Larger than the USPS Flat rate box to get that pricing to appear?
Offline
The shopping cart doesn't currently support the various flat rate parcel sizes nor their discounted rates should you purchase postage on line. I'm hoping the shopping cart will get modified to provide support for those different shipping options with the US Postal service. We use this kind of shipping a lot and we end up having to modify the shipping costs for most of our orders because the shopping cart doesn't currently support the flat rate shipping options for domestic priority mail.
Offline
Was this update released? What versions of each component do I need to have for this to work?
Thanks
Offline
polarize wrote:
Was this update released? What versions of each component do I need to have for this to work?
Thanks
The latest version of CCP has been updated. Not 100% sure going back when it was released, but I did confirm the latest with Nick.
Offline
Thanks for your reply. What do we need to look at to make the domestic flat boxes show up as an option? Thank you
Offline
7.1.2 was not released. The last update to V7 was in October of last year (10/06/2009: Version 7.1.1 (Number KRYPT10062009A))
Offline
So, back to the original question...What do we need to make this work? If the answer is 7.1.2 then when will that be out?
Thanks all.
Nancy
Offline
I have done the update and still don't see the options for adding in USPS Flat Rate boxes. Was this feature included in this update?
Offline
There was no mention of flat rate boxes in the update John. Just a comment about making the APIs current.
Offline
Well it's now 2012 and we still don't have Flat Rate Boxes as a USPS shipping option. This will result in some lost sales because a $14.95 flat rate is a lot less that a $35 regular rate. Any word on when we'll see USPS Flat Rate shipping options?
Offline
This will be part of the V8 release. We are on track to have this out in a few weeks.
Offline
Jeff,
Just a quick question.... Will these Flat Rate Box options appear alongside realtime rates for us? Also, will there be an automatic exclusion of those rates for items that exceed the dimensions of the flat rate box capacities?
Thanks
Offline