Forums / Addon Shipping Modules / USPS from Canadian Origin?

USPS from Canadian Origin?

Started by abcisme on 1 Aug 2013, 1:30 PM · Views: 10,343

Results 1 to 11 of 11
1 Aug 2013, 1:30 PM
#1
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

USPS from Canadian Origin?

We have been using the USPS XML by Marco for USPS shipping quotes. Since we no longer have that option, is there a way to possibly hard-code a US origin zip code in the new USPS module or possibly create a field for the origin zip code in the setup of the module? :(

1 Aug 2013, 8:37 PM
#2
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Re: USPS from Canadian Origin?

Hoping there is some way I could specify the SHIPPING_ORIGIN_ZIP instead of having it pull the post code from the store setup...?

1 Aug 2013, 8:59 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS from Canadian Origin?

Are you saying that when shipping from Canada that you are really using a 5 digit USPS Zip Code on the ZipOrigination?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Aug 2013, 9:21 PM
#4
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Re: USPS from Canadian Origin?

To be honest, I cannot recall how we originally had it set up. I was so long ago! :no: I think I set up the the Webtools account using our US warehouse address.. Maybe the old USPS module pulled the zip from the USPS account instead of from the store setup? All I know is that it has been working correctly until this latest USPS change. The store has always been set up with Canada as its shipping origin.

In any case, to work around it for the time being, in the includes/modules/shipping/usps.php file, I replaced SHIPPING_ORIGIN_ZIP with our US warehouse postal code, set our store's Shipping Origin Country to Canada, and commented out the following to disable the error:

    if (SHIPPING_ORIGIN_COUNTRY != '223') {
      $this->title .= '<span class="alert">' . ' - USPS can only ship from USA. But your store is configured with another origin! See Admin->Configuration->Shipping/Packaging.' . '</span>';
    }

It seems to be calculating correctly. I know this is not a great solution, but for the moment, it'll have to do!

1 Aug 2013, 9:25 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: USPS from Canadian Origin?

For the benefit of future readers of this discussion ....

So to be clear really this has nothing to do with getting the USPS module to quote shipments originating in Canada, because USPS doesn't actually do shipments FROM Canada, right?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Aug 2013, 9:30 PM
#6
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Re: USPS from Canadian Origin?

Sorry for the confusion. I was confused myself. After working through it, I believe what I should have asked is if I could get the module to work having a Canadian postal code in the store setup, but using a webtools account set up with a US zip code. I answered my own question though. Again, I apologize for the confusion.

1 Aug 2013, 9:33 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS from Canadian Origin?

Not a problem ...

You can do this if you are careful in the usps.php code ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Dec 2018, 12:39 AM
#8
dimsumgurl avatar

dimsumgurl

Zen Follower

Join Date:
Dec 2009
Location:
Canada
Posts:
160
Plugin Contributions:
0

Re: USPS from Canadian Origin?

Hello! I am trying to set up USPS module and I am shipping from Canada, I will be driving to the border to drop off the packages which is why I want to be able to use this module. I don't know exactly where you replaced SHIPPING_ORIGIN_ZIP with US postal code (I will be using the postal code of the postal office at the border.

Please guide me to where I need to make these changes. When I changed my postal to a ZIP in config>shipping/packaging I can no longer use the Canadian postal rates. So I am wondering how to change the code so it thinks I changed the store configs. THANKS!

abcisme:

To be honest, I cannot recall how we originally had it set up. I was so long ago! :no: I think I set up the the Webtools account using our US warehouse address.. Maybe the old USPS module pulled the zip from the USPS account instead of from the store setup? All I know is that it has been working correctly until this latest USPS change. The store has always been set up with Canada as its shipping origin.

In any case, to work around it for the time being, in the includes/modules/shipping/usps.php file, I replaced SHIPPING_ORIGIN_ZIP with our US warehouse postal code, set our store's Shipping Origin Country to Canada, and commented out the following to disable the error:

if (SHIPPING_ORIGIN_COUNTRY != '223') {
  $this->title .= '<span class="alert">' . ' - USPS can only ship from USA. But your store is configured with another origin! See Admin->Configuration->Shipping/Packaging.' . '</span>';
}
> 
> It seems to be calculating correctly.  I know this is not a great solution, but for the moment, it'll have to do!
5 Dec 2018, 3:28 AM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: USPS from Canadian Origin?

Not sure if you made those changes in the configuration area or directly in the code; however, if the code itself were modified to reflect those values, an alternate define was used to contain those changes or as able/applicable the observer/notifier system were used to override the values, then it would be possible to do what was requested.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2019, 1:47 AM
#10
dimsumgurl avatar

dimsumgurl

Zen Follower

Join Date:
Dec 2009
Location:
Canada
Posts:
160
Plugin Contributions:
0

Re: USPS from Canadian Origin?

I was able to get this to work with zencart 1.3.9 version and the Canada post module and USPS to work at the same time giving quotes

Now Im trying to upgrade to 1.5.5 and this trick to change the SHIPPING_ORIGIN_ZIP in includes/modules/shipping/canadapost.php to the postal code while in admin/config/shipping and packaging to the zip code, it doesn't work...

What can we do?

Thanks!

10 Jan 2019, 2:58 AM
#11
dimsumgurl avatar

dimsumgurl

Zen Follower

Join Date:
Dec 2009
Location:
Canada
Posts:
160
Plugin Contributions:
0

Re: USPS from Canadian Origin?

dimsumgurl:

I was able to get this to work with zencart 1.3.9 version and the Canada post module and USPS to work at the same time giving quotes

Now Im trying to upgrade to 1.5.5 and this trick to change the SHIPPING_ORIGIN_ZIP in includes/modules/shipping/canadapost.php to the postal code while in admin/config/shipping and packaging to the zip code, it doesn't work...

What can we do?

Thanks!

Actually it's working now... all because I switched to a different template.... I was recently using Tableau 2... but switched to Carlisle Fresh.