Community Add-Ons
CanadaPost Shipping Module
for osCommerce Online Merchant v2.2
This is the CanadaPost Shipping Module created by Kelvin Zhang. His original post in develop forum has some problem with the attachment, so I upload the file here.
This update lets you use Canada Posts server side handling fee and free shipping options.
2009.04.12 v2.0
When bloggermouth made a change on May 5, 2006 he used an old version and not what was the latest one at the time.... The one by Kenneth Wang on June 1, 2003.
The change bloggermouth made had already been made along with several other changes. Those other changes were lost with bloggermouth's version and all later versions.
This version is strictly a copy of Kenneth Wang's version dated June 1, 2003 with the following changes:
- Added the fix supplied by Typhoon on Oct 22, 2004
- Added the "handling fee" function supplied by countrystyle on Feb 5, 2006
- Added the PHP5.0 fix supplied by DuFF1 in Dec 8, 2006
- Changes to the readme file by livingblueprint on May 9, 2007
This version does NOT address the port 30000 issue for those running on a server with that port blocked. If that port is blocked for you, ask your hosting provider to open the port; otherwise, try the suggested workaround shown at http://addons.oscommerce.com/info/391
Note: I have not used the versions with the port 30000 workaround; therefore, I can not state whether or not they contain all the features of this version.
I must have been smokin some good dope on that last upload. I couldn't even understand what I had uploaded. Anyways, here is an UPDATED version of the workaround with an UPDATED install.txt file to explain what to do. Sorry for the bad information in the last one. Good luck and I hope this can help someone especially those that use GoDaddy for hosting.
What I did was create a cURL script that sits on a friends web server and makes the call to the canadapost server from there and the cURL call from the canadapost.php file calls to it. I have enclosed BOTH files and an install.txt so that you can see how it is done.
I couldn't get this thing to work because I forgot to check and make sure that the proxy call in cURL was in the code. Added the needed lines and got it working.
Hello all, some of us where having trouble with adding the code to the modules/shipping/canadapost.php file. I am adding the full file in here with tested curl fix. This file is update of full package uploaded by "timidphper " on 8 Feb 2007 titled "Full file set and instructions".
NOTE: Please make sure that in admin section of modules->shippping->canadapost fields <br>"Enter CanadaPost Server IP" is set to "sellonline.canadapost.ca"
<br> AND
<br> "Enter CanadaPost Server Port" is set to 30000
Good luck
Hello all, i had lot of troubles with Port 30000. So i wrote this simple alternate code using curl to connect and receive data from Canada Post. This code does not require any special port to be opened.
You only have to copy and paste one function in canadapost.php file in shipping module. Hopefully, this will be of use to some one.
Updated the readme file to include instructions on getting a sellOnline account , started a small FAQ and included the instructions for adding the CPC profile link by DuFF1.
Quick fix...no file required.
Should you have a problem once CP module is set up, check to see that your HOST has opened PORT 30000
Good luck with this module!!
*** This add-on simply put a link in admin > modules > shipping > postcanada to edit your CPC profile.
In catalog/includes/modules/shipping/canadapost.php
Find (line 26):
---------------
$this->description = MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION;
Replace with:
-------------
$this->description = MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION . '<p><b>CPC Profile</b><br><a href=http://sellonline.canadapost.ca/servlet/LogonServlet?Language=0 target=_blank><u>> Modify my profile <</u></a>';
As an updated complete file set was not available and the forum on this contribution was really scarey, here is a complete file set and instructions on installation and implementation.
Unzip to temp folder and review readme file.
Good luck!
If you have this error message:
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /includes/modules/shipping/canadapost.php on line 166
or you can manually remove two (2) characters on this line: (remove "&")
$fp = @fsockopen($host, $port, &$errno, &$errstr, 2);
should be:
$fp = @fsockopen($host, $port, $errno, $errstr, 2);
Up until now you couldn't charge taxes for shipping. Now you can. Simply replace the canadapost.php file in the includes/modules/shipping/ folder
The bug fix mentioned below is included.
Each product in the database has a weight. The original module adds up the weight of all the products ordered and calculates shipping based on that weight. It doesn't take into account the weight of extra packaging etc. End result... it will cost you more to ship then the system calculates. Solution... this file will tell you how to increase the fee. You can increase the calculated amount by a fixed amount. The buyer won't see the extra fee... they'll just see one price for shipping. The extra fee in the admin section is called the "handling fee"
It seems that one variable name needs changing to get this to work properly. It took my quite some time to find it in the forum, so I thought I would post it here.
This is not my work, but I thought it would help everybody out.
The forum posting is here: http://forums.oscommerce.com/index.php?showtopic=90166
CanadaPost shipping module v0.3
*******************************************************************
** This module only works on osCommerce MS1 and MS2-cvs version **
*******************************************************************
2003.05.31 V0.3
- Make changes for osc MS1 version. Tested under MS1 and MS2-cvs 03.05.29.
Add sort order and shipping zone.
This module doesn't support dimensions.
See readme.txt for details and install instructions.
Bug fix version of 0.2.1
- Item weight should not be calculated against it's quantity. CanadaPost server
does this job. Fixed.
see: http://forums.oscommerce.com/viewtopic.php?t=42184
- When CanadaPost server is down, some error message showed up. Fixed.
Now if the server can't be connected in 2 seconds, the program will show a
"Can't reach CanadaPost server" message.
see: http://forums.oscommerce.com/viewtopic.php?t=41921
Thanks to John Forshaw for both bug reports.
See readme.txt for more details.
just a update for me code errors...both should work but this one is the best one to use.
update to allow OSC 2.2 MS1 options.
Canada Post Parcel Service
Enable CanadaPost Shipping True/False
Enter CanadaPost Server IP
Enter CanadaPost Server Port
Enter Selected Language-optional
Enter Your CanadaPost Customer ID
Enter Turn Around Time(optional)
Tax Class
Shipping Zone
Sort Order
This module only works for Post-Nov.1.2002 CVS version.
In previous version, the module always use the first available method, no matter which one the user has chose. This version fix this problem.
See Readme.txt for more details.
This is the CanadaPost shipping module for Post-Nov.1.2002 CVS Version (i.e. the new checkout procedure).
This module was originally created by Kelvin Zhang.
See readme.txt for more details.
This is the CanadaPost Shipping Module created by Kelvin Zhang. His original post in develop forum has some problem with the attachment, so I upload the file here.
