Forums / Addon Shipping Modules / Canada Post module

Canada Post module

Views: 188,608

Results 421 to 440 of 481
1 Oct 2019, 1:12 AM
#421
debbiew4960 avatar

debbiew4960

New Zenner

Join Date:
Mar 2009
Location:
Canada
Posts:
6
Plugin Contributions:
0

Canada Post module

Thanks Dr. Byte for doing the upgrade!

I've put in the single updated .php file from your latest Canada Post module as recommended and it didn't work for me either.

I've been using the Canada Post shipping module for years. Running with ZC V1.5.5f and Canada Post module 1.5.3.

In case it helps, here is the debug error:
[30-Sep-2019 18:58:26 America/New_York] PHP Fatal error: Class 'VersionServer' not found in /home/.../zencart/includes/functions/plugin_support.php on line 37

I've cleared history and tried again, it just knocked out the whole page and site so I switched the file back to the old one.

Thanks to all of you who give so much to help us with this work.

1 Oct 2019, 5:36 AM
#422
phil_c avatar

phil_c

New Zenner

Join Date:
Apr 2014
Location:
Kitchener, Ontario
Posts:
6
Plugin Contributions:
0

Re: Canada Post module

Phil C:

Thanks for the update, but it doesn't seem to work for me, I think perhaps there have been other modifications made in the file, are there just certain lines of code that need to be changed, if so could you refer me to line numbers? Any help appreciated as my site is pretty much down for shipping right now.

Do I have to change anything in the settings, I noticed the addition of the _XML, not sure if that is anything... sorry I am not a coder, I have contacted one to hire to fix this, but have not heard back yet, and very much need this fixed, we are a halloween shop and this is our busy season.

I installed the whole module again, not just the one file, and after re-entering the module settings in ADMIN, it is working again! WHEW!

1 Oct 2019, 12:33 PM
#423
yardsale avatar

yardsale

New Zenner

Join Date:
Jul 2009
Location:
Canada
Posts:
7
Plugin Contributions:
0

Re: Canada Post module

Hello Everyone,

Hope everyone is doing well.

Does anyone else have it working for them?

1 Oct 2019, 6:08 PM
#424
thebeadyeye avatar

thebeadyeye

New Zenner

Join Date:
Feb 2007
Posts:
47
Plugin Contributions:
0

Re: Canada Post module

DrByte:

I've updated the SellOnline module to use the HTTPS requests, and drop the old TCP requests on port 30000.

If your site was already using SellOnline, you can simply replace the /includes/modules/shipping/canadapost.php file found in the updated plugin zip at: https://www.zen-cart.com/downloads.php?do=file&id=4 (ie: you don't need to touch the other files)

You can also tell your hosting company that they no longer need to open TCP port 30000 on your firewall (if you made a special request for them to open it).

Thank-you so much for the update. I dropped the new file in like you instructed and it worked perfectly. I didn't need to contact my web host at all.

1 Oct 2019, 7:00 PM
#425
thebeadyeye avatar

thebeadyeye

New Zenner

Join Date:
Feb 2007
Posts:
47
Plugin Contributions:
0

Re: Canada Post module

Spoke too soon, now I am getting this:

An internal problem occurred. Please contact the Sell Online Customer service Desk at mailto:/[email protected]
If you prefer to use Canada Post as your shipping method, please contact the <Company Name> via Email.

1 Oct 2019, 7:56 PM
#426
phil_c avatar

phil_c

New Zenner

Join Date:
Apr 2014
Location:
Kitchener, Ontario
Posts:
6
Plugin Contributions:
0

Re: Canada Post module

I had the exact same problem.

I re-installed all the files, like I was installing the CP module from scratch.

Adjusted the settings in ADMIN - turned the module back ON, cleared my cache and it started to work.

1 Oct 2019, 8:32 PM
#427
thebeadyeye avatar

thebeadyeye

New Zenner

Join Date:
Feb 2007
Posts:
47
Plugin Contributions:
0

Re: Canada Post module

Phil C:

I had the exact same problem.

I re-installed all the files, like I was installing the CP module from scratch.

Adjusted the settings in ADMIN - turned the module back ON, cleared my cache and it started to work.

Ugh, I haven't changed anything and now it's working again. Maybe it was Canada Post.

2 Oct 2019, 3:09 PM
#428
drbyte avatar

drbyte

Sensei

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

Re: Canada Post module

Debbiew4960:

In case it helps, here is the debug error:
[30-Sep-2019 18:58:26 America/New_York] PHP Fatal error: Class 'VersionServer' not found in /home/.../zencart/includes/functions/plugin_support.php on line 37
That suggests something else wrong with outdated files in your Zen Cart install. To fix you'll need to grab the zip file for your actual Zen Cart version, unzip it, and check for all missing files that haven't been uploaded to your server. Tools like winmerge can help with this. You could start with the /admin/includes/classes directory.

But that's not a bug in this updated module. (It's just exposed by this update because this module now looks for newer versions.)

.
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.

2 Oct 2019, 3:38 PM
#429
drbyte avatar

drbyte

Sensei

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

Re: Canada Post module

DrByte:

Debbiew4960:

In case it helps, here is the debug error:
[30-Sep-2019 18:58:26 America/New_York] PHP Fatal error: Class 'VersionServer' not found in /home/.../zencart/includes/functions/plugin_support.php on line 37
That suggests something else wrong with outdated files in your Zen Cart install. To fix you'll need to grab the zip file for your actual Zen Cart version, unzip it, and check for all missing files that haven't been uploaded to your server. Tools like winmerge can help with this. You could start with the /admin/includes/classes directory.

But that's not a bug in this updated module. (It's just exposed by this update because this module now looks for newer versions.)

Apologies. I was wrong.

It's a bug because it was trying to check plugin version stuff even on storefront.

.
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.

2 Oct 2019, 3:41 PM
#430
drbyte avatar

drbyte

Sensei

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

Re: Canada Post module

Debbiew4960:

In case it helps, here is the debug error:
[30-Sep-2019 18:58:26 America/New_York] PHP Fatal error: Class 'VersionServer' not found in /home/.../zencart/includes/functions/plugin_support.php on line 37

I've posted an updated zip.
Again, you can simply replace the **/includes/modules/shipping/canadapost.php file found in the updated plugin zip at: https://www.zen-cart.com/downloads.php?do=file&id=4 (ie: you don't need to touch the other files)
**

.
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.

2 Oct 2019, 9:54 PM
#431
yardsale avatar

yardsale

New Zenner

Join Date:
Jul 2009
Location:
Canada
Posts:
7
Plugin Contributions:
0

Re: Canada Post module

DrByte:

I've posted an updated zip.
Again, you can simply replace the **/includes/modules/shipping/canadapost.php file found in the updated plugin zip at: https://www.zen-cart.com/downloads.php?do=file&id=4 (ie: you don't need to touch the other files)
**

Thank you, DrByte! The one file works great.

3 Oct 2019, 12:42 AM
#432
debbiew4960 avatar

debbiew4960

New Zenner

Join Date:
Mar 2009
Location:
Canada
Posts:
6
Plugin Contributions:
0

Re: Canada Post module

DrByte:

I've posted an updated zip.
Again, you can simply replace the **/includes/modules/shipping/canadapost.php file found in the updated plugin zip at: https://www.zen-cart.com/downloads.php?do=file&id=4 (ie: you don't need to touch the other files)
**

I thank you too Dr. Byte! It worked perfectly as soon as I loaded it and cleared the history :clap::clap::clap:
I really appreciate your help with this and all the work from this team year after year to help us!

Yeah ZENCART TEAM!

6 Nov 2019, 9:27 PM
#433
trinity14 avatar

trinity14

Zen Follower

Join Date:
Jan 2014
Location:
Ontario, Canada
Posts:
252
Plugin Contributions:
3

Re: Canada Post module

Hi Folks,

I have used this module in the past with success. I tried to create a new Sell Online profile for a client and got this response from Sell Online:

Thank you for your interest in the Canada Post web services.

The Sell Online program will be decommissioned in the near future, and as such we are no longer creating new accounts.

The Web Developer program has been developed to replace and enhance the offerings of Sell Online.

Not only will your customers be able to choose the speed and cost of delivery, but our APIs will simplify the entire purchase process for both you and your online shoppers. With web services, you can:

  • Automate the printing of shipping labels
  • Let customers track purchases directly from your website
  • Allow shoppers to print return labels from your site
  • Give shoppers the option to have purchases delivered to the Post Office of their choice- near home, the office or the cottage

To get started with web services immediately visit:

Join the Canada Post Developer Program now

If you have questions about how our web services can help you sell more online, call us at 1-866-511-0546 or email us at sellonline AT canadapost DOT ca.

2 Dec 2019, 6:40 PM
#434
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Canada Post module

Bug found and fixed...

includes/modules/shipping/canadapost.php

replace line 165
if ($this->lettermail_available && ($shipping_weight <= $this->lettermail_max_weight))

with this:
// Twitch bugfix - add lettermail switch control
// orginal code if ($this->lettermail_available && ($shipping_weight <= $this->lettermail_max_weight))
if (MODULE_SHIPPING_CANADAPOST_LETTERMAIL_STATUS == 'True' && ($shipping_weight <= $this->lettermail_max_weight))

Enable Lettermail Rates switch will now function properly.

Remember this uses the Max weight for Lettermail and the table rate settings correctly and needs 0's as placeholders or you will get non-numeric errors in your log folder.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

9 Dec 2019, 11:59 PM
#435
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Canada Post module

Product Name Error

'AA internal problem occurred. Please contact the Sell Online Customer service Desk at mailto:/[email protected]'

Product names can not be passed to Canada Post with markup ' or , special characters.

Quick fix - Method to drop apostrophe's.

replace line 162
$this->_addItem($products_array[$i]['quantity'], $products_array[$i]['final_price'], $products_array[$i]['weight'], $products_array[$i]['length'], $products_array[$i]['width'], $products_array[$i]['height'], $this->_xmlentities($products_array[$i]['model'] . "/" . $products_array[$i]['name']), $products_array[$i]['ready_to_ship'], $products_array[$i]['dim_type'], $products_array[$i]['weight_type']);

with this:
$twi_cleanPname = $products_array[$i]['name']; // Twitch fix Canada Post error 'AA internal problem occurred...'
$twi_cleanPname = preg_replace('/&#039;|'/', '', $twi_cleanPname); // clean out apostrophe's
$this->_addItem($products_array[$i]['quantity'], $products_array[$i]['final_price'], $products_array[$i]['weight'], $products_array[$i]['length'], $products_array[$i]['width'], $products_array[$i]['height'], $this->_xmlentities($products_array[$i]['model'] . "/" . $twi_cleanPname /
$products_array[$i]['name'] */), $products_array[$i]['ready_to_ship'], $products_array[$i]['dim_type'], $products_array[$i]['weight_type']);

The Canada Post server will now interpret the data correctly and pass the rate quotes properly again :)

Redoc Note:
One could amend the _xmlentities or create a new function to clean other characters out in future versions.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

31 Dec 2019, 10:27 PM
#436
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: Canada Post module

LOL I just came here to report the same bug @Twitch reported above. In my case, the name had the symbol for inches (") in it, and that broke Canada Post. Same temporary work around - just remove.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Feb 2020, 8:04 PM
#437
jugglez avatar

jugglez

New Zenner

Join Date:
Jul 2013
Location:
Toronto
Posts:
7
Plugin Contributions:
0

Re: Canada Post module

I have a number of products with & and % in them, is there a workaround for those?
Tried playing with the code fix provided by Twitch but didn't work.
Any help is appeciated.

4 Feb 2020, 8:06 PM
#438
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Canada Post module

Jugglez:

I have a number of products with & and % in them, is there a workaround for those?
Tried playing with the code fix provided by Twitch but didn't work.
Any help is appeciated.

Please post Zen, PHP and SQL versions from your Admin > Tools > Server Version Info.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

4 Feb 2020, 8:10 PM
#439
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: Canada Post module

His change didn't include %. You could just add that if you wish.

$twi_cleanPname = preg_replace('/%&#0*39;|'/', '', $twi_cleanPname);

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Feb 2020, 9:07 PM
#440
jugglez avatar

jugglez

New Zenner

Join Date:
Jul 2013
Location:
Toronto
Posts:
7
Plugin Contributions:
0

Re: Canada Post module

twitchtoo:

Please post Zen, PHP and SQL versions from your Admin > Tools > Server Version Info.

MySQL 5.7.29
PHP Version: 5.6.40
Zencart 1.5.3 (patched a couple years ago)