Jump to content

Resolved - Revised CODE here for v5.1.4 USPS Shipping


mitchellds

Recommended Posts

Version: Cubecart 5.1.4, Fresh Install

Since installation of 5.1.4, my USPS shipping module has worked perfectly.

Today, unfortunately, it just quit working.

The request below is for a package to be shipped from Georgia to Georgia. United States is selected in Store Settings, General Tab.

Delivery address is Georgia and United States.

Can anyone help me out?

I checked out the Request Log and found the following:

Request Sent - http://production.shippingapis.com/ShippingAPI.dllAPI=IntlRateV2&XML=<IntlRateV2Request USERID="238SECON5855"> <Package ID="0"> <Pounds>2</Pounds> <Ounces>8</Ounces> <Machinable>true</Machinable> <MailType>Package</MailType> <ValueOfContents>49.50</ValueOfContents> <Country>United States</Country> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Width>18</Width> <Length>1</Length> <Height>12</Height> <Girth/> </Package> </IntlRateV2Request>

Response received<?xml version="1.0"?> <IntlRateV2Response><Package ID="0"><Error><Number>-2147218040</Number><Source>IntlPostage;clsIntlPostage.GetCountryAndRestirctedServiceId;clsIntlPostage.CalcAllPostageDimensionsXML;IntlRateV2.ProcessRequest</Source><Description>The country name is a US Possession.</Description><HelpFile></HelpFile><HelpContext>1000440</HelpContext></Error></Package></IntlRateV2Response>

Link to comment
Share on other sites

Interesting that, for you, the CC514 USPS module is now malfunctioning, where, for others, it never worked at all.

Others have reported there is a fixed file that Devellion will send you when you submit a SALES ticket (not a support ticket).

I've been looking into this and have discovered that under a certain situation (what that is, I don't know yet), the test comparing the destination country and the store's location don't match, thus, the module uses International rates.

I'm wondering if the fixed module fixes that.

Link to comment
Share on other sites

  • 4 weeks later...

Here's what needs fixing on the 5.1.4 USPS Shipping Module shipping.class.php file:


## Set API to national or International

// the following should be 'country_id' NOT 'country'! If you think otherwise, talk to Bill!

$this->_api = ($delivery['country_id']==$GLOBALS['config']->get('config','store_country')) ? $this->_api_domestic : $this->_api_international;





AND





## Calculate Lbs/Oz

$this->weightLbsOz();



// the following should be 'country_id' NOT 'country'! If you think otherwise, talk to Bill!

if($delivery['country_id']==$GLOBALS['config']->get('config','store_country')) { // National "RateV3Request"

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...