Hello,
I have a client that ships small items, and ever since the USPS changed their rates and methods on the 2nd, he has been getting hammered with people choosing First-Class Postcards as a shipping method--kind of hard to stick products "in" a postcard. This seems to be the method the USPS serves for orders under 3.5 oz. The current module (that worked with the old USPS API) does have checkboxes to include/exclude certain shipping options, but these no longer work.
Has anyone else run into this? If so, have you found a fix for it or is there a fix from the devs in the works?
Thanks,
Jon
I have a client that ships small items, and ever since the USPS changed their rates and methods on the 2nd, he has been getting hammered with people choosing First-Class Postcards as a shipping method--kind of hard to stick products "in" a postcard. This seems to be the method the USPS serves for orders under 3.5 oz. The current module (that worked with the old USPS API) does have checkboxes to include/exclude certain shipping options, but these no longer work.
Has anyone else run into this? If so, have you found a fix for it or is there a fix from the devs in the works?
Thanks,
Jon
Hi This is Old Ken,
I'm having the same problem. I went to the post office and they classified my 6in by 9in bubble wrap envelope as a "small parcel" and for 3 onces the rate should be $1.56 and not $0.28 as my shopping cart shows. There is no "small parcel" option available in the menu.
But I'm sorry that I can't offer a solution. I'm strictly a user not a programmer.
I'm having the same problem. I went to the post office and they classified my 6in by 9in bubble wrap envelope as a "small parcel" and for 3 onces the rate should be $1.56 and not $0.28 as my shopping cart shows. There is no "small parcel" option available in the menu.
But I'm sorry that I can't offer a solution. I'm strictly a user not a programmer.
Found the cause of this problem but don't have time to fix and test this morning.
Cause:
1. shippingapis.com retruns RateV3Response with multiple <Postage CLASSID="0"> tags last of which is postcard postage
2. catalog/model/shipping/usps.php has a foreach loop on CLASSID, since there are multiple it overwrites until the last is finally in there hence the postcard becoming our price.
Other notes:
Under the Postage tag there is a MailService tag that has the name "First-Class Mail<sup>®</sup> Package" I do believe is the everyone wants and it comes first.
Sorry this isn't a fix yet, If someone else can find a proper one without breaking anything else before I return this evening cool if not I will hopefully find one then.
Cause:
1. shippingapis.com retruns RateV3Response with multiple <Postage CLASSID="0"> tags last of which is postcard postage
2. catalog/model/shipping/usps.php has a foreach loop on CLASSID, since there are multiple it overwrites until the last is finally in there hence the postcard becoming our price.
Other notes:
Under the Postage tag there is a MailService tag that has the name "First-Class Mail<sup>®</sup> Package" I do believe is the everyone wants and it comes first.
Sorry this isn't a fix yet, If someone else can find a proper one without breaking anything else before I return this evening cool if not I will hopefully find one then.
"Design, Develop, and have fun."
http://www.chrislockard.com
OC: v1.4.9.5
Well I believe I have this one licked but would like others to let me know if it took care of the issue for them as well.
This fix was created on OpenCart 1.4.9 and also had Qphoria's fix for the garbled code found here:
http://forum.opencart.com/viewtopic.php ... 28#p123964
make the following change to the catalog/model/shipping/usps.php file
find:
and replace with
If you did not fix the garbled code using Qphoria's update above you may want to replace the "First-Class Mail Package" with the following bit "First-Class Mail<sup>®</sup> Package"
This should fix it to where you are no longer having Postcards show up for your first class shipping.
I am also adding a vQmod that does this for those who are using it.
This fix was created on OpenCart 1.4.9 and also had Qphoria's fix for the garbled code found here:
http://forum.opencart.com/viewtopic.php ... 28#p123964
make the following change to the catalog/model/shipping/usps.php file
find:
Code: Select all
$quote_data[$classid] = array(
'id' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
'cost' => $this->currency->convert($cost, 'USD', $this->currency->getCode()),
//'tax_class_id' => 0,
'tax_class_id' => $this->config->get('usps_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->currency->getCode()), $this->config->get('usps_tax_class_id'), $this->config->get('config_tax')))
);
Code: Select all
$ms = $postage->getElementsByTagName('MailService')->item(0)->nodeValue;
if($classid == 0 && $ms == 'First-Class Mail Package'){
$quote_data[$classid] = array(
'id' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
'cost' => $this->currency->convert($cost, 'USD', $this->currency->getCode()),
//'tax_class_id' => 0,
'tax_class_id' => $this->config->get('usps_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->currency->getCode()), $this->config->get('usps_tax_class_id'), $this->config->get('config_tax')))
);
}
if($classid != 0){
$quote_data[$classid] = array(
'id' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
'cost' => $this->currency->convert($cost, 'USD', $this->currency->getCode()),
//'tax_class_id' => 0,
'tax_class_id' => $this->config->get('usps_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->currency->getCode()), $this->config->get('usps_tax_class_id'), $this->config->get('config_tax')))
);
}
This should fix it to where you are no longer having Postcards show up for your first class shipping.
I am also adding a vQmod that does this for those who are using it.
"Design, Develop, and have fun."
http://www.chrislockard.com
OC: v1.4.9.5
Sorry TalonRAge, I just tried your change but still have "First-Class Mail Postcards" showing up.
I appreciated the link to Qphoria's fix for the garbled code, that was the next thing I was going to look for. Got that fixed anyway.
(Yes, I did apply your change to his usps.php file)
I appreciated the link to Qphoria's fix for the garbled code, that was the next thing I was going to look for. Got that fixed anyway.
(Yes, I did apply your change to his usps.php file)
Just wanted to let you know I happened to be browsing through the forums as you had entered this and am looking at it in a few different ways to see if I can replicate what you are seeing.
**Edit**
Sent you a PM regarding this.
**Edit**
Sent you a PM regarding this.
"Design, Develop, and have fun."
http://www.chrislockard.com
OC: v1.4.9.5
I have been having a problem with 1.4.9.3 also. I fixed the garbled code in the checkout and the fix works fine. The problem I am having is that the USPS first class mail option does not show up as an option for checkout even though the weight is below 13oz. If it was the only thing selected in the admin it won't show up at all. I don't get the USPS postcard option but don't need that one. USPS First Class is the cheapest way to sent the packages I have and it does not work at all. does anyone know how to fix this in 1.4.9.3 any help would be appreciated.
Mean
Mean

If you do the following you will get some logging on what is being sent out and what is getting returned when you make your shipping rate quote request.
To see what you are sending.
find:
replace with:
To see what you are receiving.
find:
replace with:
All you are doing is adding the log writing function to the xml you are sending and receiving and it is being place in you logs to view. You will find that in the Administration under System>Error Logs.
To see what you are sending.
find:
Code: Select all
$request = 'API=IntlRate&XML=' . urlencode($xml);
} else {
$status = FALSE;
}
}
if ($status) {
$ch = curl_init();
Code: Select all
$request = 'API=IntlRate&XML=' . urlencode($xml);
} else {
$status = FALSE;
}
}
$this->log->write($xml);
if ($status) {
$ch = curl_init();
find:
Code: Select all
if ($result) {
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadXml($result);
Code: Select all
$this->log->write($result);
if ($result) {
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadXml($result);
"Design, Develop, and have fun."
http://www.chrislockard.com
OC: v1.4.9.5
I think it's just broken. First class does not work with a fresh install of opencart 1.4.9.3 to the server it does not even give you an option for fist class even though the item is below 13oz. The US postal service must have changed something or it just never worked in this version. Other options do work like express mail and priority mail packages and boxes but first class mail is defunct. So the code above won't see what is not being sent or replied to because The USPS is not sending data back or Open cart is not sending data out. The fact is it is definatly broken, how can I be sure? I tried wo diffrent servers hosting 1.4.9.3 and they were fresh installs of opencart everything else works except First Class mail and First class post cards. So I assume the USPS must have changed their code in some way.
Thanks to Talon for that code change. That worked perfectly and i had a fresh install of the latest version. The code was still the old code for some reason in the USPS file. Once i changed it it fixed the First class issue so now i get First Class Mail package and the right rate as well.
also just a note for people who had or have issues getting the dumb usps module to work. I had to change my box size from rectangular to Variable before it would even start quoting rates for me.
also just a note for people who had or have issues getting the dumb usps module to work. I had to change my box size from rectangular to Variable before it would even start quoting rates for me.
Who is online
Users browsing this forum: No registered users and 5 guests