Post by exibar » Mon Mar 25, 2019 1:56 pm

hi all!
I'm installing a scratch install of 3.0.3.1 as an upgrade to my 1.5.6 install because my hosting provider is going to shut off PHP 5.6 completely in a week. So I'm forced to re-install my opencart and I figure I'd go with the latest version.

the biggest issue I ahve right now is that I've installed and configured my USPS shipping extention, however, that shipping option will not display... only the "flat rate" option I had as a test will show up, but USPS never shows up.
I remember a couple years back I had to modify my USPS extension in 1.5.6, but I hope that I wouldn't ahve to do that in the new version of opencart...

any help would be greatly appreaciated!
thanks!
Mike B

New member

Posts

Joined
Fri Dec 06, 2013 12:50 pm

Post by straightlight » Wed Mar 27, 2019 5:53 am

One of the ways to troubleshoot this issue would be in your catalog/model/extension/shipping/usps.php file.

Find:

Code: Select all

if (!$this->config->get('shipping_usps_geo_zone_id')) {
			$status = true;
		} elseif ($query->num_rows) {
			$status = true;
		} else {
			$status = false;
		}

		$weight = $this->weight->convert($this->cart->getWeight(), $this->config->get('config_weight_class_id'), $this->config->get('shipping_usps_weight_class_id'));
		
		// 70 pound limit
		if ($weight > 70) {
			$status = false;
		}
replace with:

Code: Select all

$status_text = '';

		if (!$this->config->get('shipping_usps_geo_zone_id')) {
			$status_text = 'shipping_usps_geo_zone_id has not been configured!';
			
			$status = true;
		} elseif ($query->num_rows) {
			$status_text = 'database rows have been found for USPS zones!';
			
			$status = true;			
		} else {
			$status_text = 'USPS settings do not match!';
			
			$status = false;
		}

		$weight = $this->weight->convert($this->cart->getWeight(), $this->config->get('config_weight_class_id'), $this->config->get('shipping_usps_weight_class_id'));
		
		// 70 pound limit
		if ($weight > 70) {
			$status_text = 'Weight is over 70 pounds and currently at: ' . (int)$weight);
			
			$status = false;
		}
		
		$this->log->write($status_text);
Test another checkout transaction. Then, visit your OC admin error logs noticing the status text.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by exibar » Fri Mar 29, 2019 12:11 am

I resolved the issue... it was the same issue I had a few years back as well... found the fix in my notes from back then

I replaced "First-Class Mail Parcel" with "First-Class Package Service - Retail" (as written in the XML
Here is the array text from catalog/model/extension/shipping/usps.php

$firstclasses = array (
'First-Class Package Service - Retail',
'First-Class Mail Large Envelope',
'First-Class Mail Stamped Letter',
'First-Class Mail Postcards'
);

in both these files:
catalog/model/extension/shipping/usps.php,
catalog/model/shipping/usps.php

works like a champ now!
Mike B

New member

Posts

Joined
Fri Dec 06, 2013 12:50 pm

Post by straightlight » Fri Mar 29, 2019 4:33 am

Already fixed on GitHub.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by exibar » Fri Mar 29, 2019 4:46 am

huh? when was it fixed up on github? what version of ocart? I just downloaded and installed 3.0.3.1 and the USPS module did not work out of the box.

I had to apply the above fix to the code before it would work properly.

New member

Posts

Joined
Fri Dec 06, 2013 12:50 pm

Post by straightlight » Fri Mar 29, 2019 4:55 am

See the catalog/model/extension/shipping/usps.php file by looking for: - Retail on GitHub Opencart. You will see it in the array already as you described above.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by exibar » Fri Mar 29, 2019 5:57 am

well, this is a 2 year old thing... it should be built into the ocart installer... I would have not thought of looking on github for something that should have been fixed 2 years ago

New member

Posts

Joined
Fri Dec 06, 2013 12:50 pm

Post by exibar » Thu Apr 04, 2019 1:02 pm

aaaand, now it's broken again ;-(

I can't win.... I grabbed the usps.php from github and replaced it on mysite, but still broken ;-(

New member

Posts

Joined
Fri Dec 06, 2013 12:50 pm
Who is online

Users browsing this forum: No registered users and 163 guests