OpenCart
CanadaPost Module 1.7 for OpenCart 1.4.8b
Click on the image to download current version
Description
This shipping module plugs into the Canada Post Sell Online server to provide real-time shipping estimates.
Changes
1.7
- Added the Admin token system to make it compatible with OpenCart 1.4.8 and 1.4.8b
1.6
- Adapting system to news templates of OpenCart 1.4.7
- French names submission bug fixes
- Minor bug fixes
1.5
- Multilingual
- French added
- Bug Fix : Accent in user name and address no longuer cause connetion breach
- templates adapted to OpenCart 1.4.0
- coding adapted to OpenCart 1.4.0
1.0
- can connect to canada post and deliver theirs prices as shipping choices
Original author : http://attemptone.com/opencart/
Installation
- Unzip file
- Upload files to corresponding folders on your site. (This is an independent module and no core files will be overwritten)
- Login to the admin area on your site.
- Go to Extensions >> Shipping
- Find Canada Post module and install it.
- Edit module with your information
Please Note
This module will only work being shipped from canada. The destination address requires a postal code/zip code and has only been tested with Canadian and American addresses.
This module assumes Canadian pricing as the Canada Post Server returns pricing information in Canadian dollars.
This module is in no way affiliated with Canada Post. Canada Post does not provide support for this module nor do the endorse it.
You Will Need A Canada Post Merchant Id
First you must have a Customer/Venture One Number. If you don`t have Customer/Venture One Number, call 1 800 260 7678 or visit their website.
If you do have a Customer/Venture One Number, you must request a Merchant Id from sellonline.
They can be contacted by:
Email: sellonline@canadapost.ca
Phone: 1-866-511-0546
- It will require the follogin information:
- CUSTOMER / VENTURE ONE NUMBER:
- COMPANY NAME:
- ADDRESS:
- CITY:
- PROVINCE:
- POSTAL CODE:
- MAIN CONTACT:
- TELEPHONE NUMBER:
Download Canada Post Shipping Module
40 commentaires
Laisser un commentaire
Vous devez être connecté pour rédiger un commentaire.




Handling wasn’t being added on to the shipping price. I had to add some code into /catalog/model/shipping/canadapost.php
This is the code I added right above the construction of $aryProducts.
$cp_handling = $this->config->get(‘canadapost_handling’);
$rate = $rate +$cp_handling;
If there is another method that should make this work without this let me know.
I just installed this, and when I clicked the Edit link in Shipping Extensions, I see the error:
Fatal error: Call to a member function https() on a non-object in /home/rkberry/public_html/ocart/admin/controller/shipping/canadapost.php on line 74
Any ideas?
I keep getting an error that says « Error connecting to Canada Post ». Ideas?
there is somes posibilities of getting the « Error connecting to Canada Post » error, the first one is that your webhost refuse outgoing fopen connections, thee second is some specials chars in the names of products / city / clients, and 3rd is an error in your CPC code.
Hi Olivier,
I just downloaded OpenCart and your Canada Post module. The version of OpenCart is now 1.4.6, so I’m not getting the Canada Post module to work yet – can you advise if it will be possible with this new version of OpenCart?
Many Thanks!
I’ll work this week on a working version with the new 1.4.7
Hi
Will you be updating this to work with version 1.4.9.1 ?
.
Hi, any updates on this? I’m trying to find a link to download the module, but the link above is no longer working.
Now updated to work with OpenCart 1.4.7
Hi, will you be updating this to work with version 1.4.8?
It’s now been updated to 1.7 for OpenCart 1.4.8 and 1.4.8b http://www.opencart.com/index.php?route=extension/extension/info&extension_id=78
I have been trying to get this to work… in the admin area I get the following…
Tax Class: None Taxable Goods
Geo Zone: All Zones Ontario
Sort Order:
‘.$entry_sellonline. »; ?>
It is the ‘.$entry_sellonline. »; ?> that seems to be incorrect.
also when I go to check out. I get the following under shipping method…
Please select the preferred shipping methods to use on this order.
Canada Post
Warning: Invalid argument supplied for foreach() in C:\websites\projector-lamps-canada\htdocs\catalog\view\theme\default\template\checkout\shipping.tpl on line 37
Any assistance you can give me on this would be greatly appreciated.
Sincerely,
Chris Whiting
Hello,
I also have the following error:
Warning: Invalid argument supplied for foreach() in
when asked to select the preferred shipping method…
Regards,
Marc-Antoine
Hi I am also having problems on my test site with Error connecting to Canada Post. I saw your earlier post about the three conditions that can cause this. I allow outfoing fopen connections, I haven no special characters from what I can tell and I am using the demo CPC_DEMO_XML merchant ID.
It was working when I first installed it and now for some reason it will no longer work. Error log has the following entires.
2010-08-16 19:34:08 – PHP Notice: Undefined variable: entry_standard in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl
on line 28
2010-08-16 19:34:08 – PHP Notice: Undefined variable: canadapost_standard in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 30
2010-08-16 19:34:08 – PHP Notice: Undefined variable: entry_express in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 40
2010-08-16 19:34:08 – PHP Notice: Undefined variable: canadapost_express in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 42
2010-08-16 19:34:08 – PHP Notice: Undefined variable: entry_postcode in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 52
2010-08-16 19:34:08 – PHP Notice: Undefined variable: canadapost_postcode in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 53
2010-08-16 19:34:08 – PHP Notice: Undefined variable: entry_estimate in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 63
2010-08-16 19:34:08 – PHP Notice: Undefined variable: canadapost_estimate in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 65
2010-08-16 19:34:41 – PHP Notice: Undefined variable: entry_standard in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 28
2010-08-16 19:34:41 – PHP Notice: Undefined variable: canadapost_standard in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 30
2010-08-16 19:34:41 – PHP Notice: Undefined variable: entry_express in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 40
2010-08-16 19:34:41 – PHP Notice: Undefined variable: canadapost_express in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 42
2010-08-16 19:34:41 – PHP Notice: Undefined variable: entry_postcode in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 52
2010-08-16 19:34:41 – PHP Notice: Undefined variable: canadapost_postcode in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 53
2010-08-16 19:34:41 – PHP Notice: Undefined variable: entry_estimate in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 63
2010-08-16 19:34:41 – PHP Notice: Undefined variable: canadapost_estimate in /var/www/dev/store/admin/view/template/shipping/canadapost.tpl on line 65
Any ideas on what the problem may be.
Nevermind, it appears that it was related to measurements and weight of items. when the values are really high I am getting the error. As it is a test site my values were just filled with anything. Might be a bug but I will know when I populate with actual dimensions and weight.
What I’m having trouble with is when a customer is at the second step of checking out an error message is being displayed as follows at the top of the page.
Warning: fsockopen() [function.fsockopen]: unable to connect to sellonline.canadapost.ca:30000 (Connection timed out) in /home/*****/public_html/store/catalog/model/shipping/canadapost.php on line 185
Further down on the page under Shipping Method, it says as follows.
« Error connecting to Canada Post »
I posted my issue on the forums of OpenCart, and they said as follows.
« A lot of hosts are disabling fsock for some reason in favor of curl. Curl is great but there is no good reason to disable fsock. Ask your host to allow fsock or the module will need to be changed to use curl to work for your servers »
It turns out that they were exactly right. I contacted my current webhost and they confirmed that fsock is disabled…
Here is a link to the OpenCart forum if you want to read my full post. My user name is the same as it is here (which is adamata).
http://forum.opencart.com/viewtopic.php?p=81062#p81062 They suggested changing the extension to use Curl….
Now with another host (a free one) I tried setting this up with, they said the problem is that it’s trying to connect on a non-standard port « 30000″. Believe it or not, this free host added the following firewall rule and it worked.
« tcp:out:d=30000:d=66.110.6.131″
So, this is all great, but I don’t want my site hosted with this free host. I have an actual paid account with Bluehost where I want my store to be. I don’t like the idea of having to login to my control panel within a certain timeframe just so my account isn’t deleted…and without even an email warning…
Anyway, long story short. We need a curl version, or a way to make this work on a standard port (not 30000).
Thanks.
HI,
Will you be updating this to work with version 1.4.9.1 ?
Thanks
I’ve used the ver 1.7 with opencart 1.4.9 and it seems to be working perfectly. Very helpful, thanks Olivier Labbé.
Hi, Thanks for offering this module for free! I have installed it & it seems to be working fine, but I noticed when I compare the price of shipping (with the exact same detailed entered) on the canada post site the estimates are more expensive with your module.
http://www.canadapost.ca/cpotools/apps/far/personal/findARate?execution=e6s1
Hi Seamus
If you use the CPC demo code they ad some handling fees since its a demo account.
Or if you added handling fees in the admin it could be an indication, or if you have an account and you did not ad handling fees, maybe your packagings on canadapost ain’t proprerly configured.
Either way, my plugin does not compute the result, it ask a private account of canada post what would be it’s price.
Thanks for the response Olivier, I was using the demo mode, hence the problem with estimates. I have since updated the module to use my private account & am geting accurate quotes.
One problem that I am now encountering is when I test with an international address (UK or Australia) it errors & says I need a valid postal code. I know that on the Canada Post site when you select international it doesn’t require a postal code. Any suggestions?
If you are getting « Error connecting to Canada Post, » make sure you do not have any weights for the products, only the measurements. For some reason having a weight causes this error.
I’ve just installed this module on my new install of 1.4.9.3 and I’m very impressed! I too am getting errors if my products have weights in them. I don’t understand how it’s returning a valid shipping rate if weight is not passed to Canada Post?? Anyway, will a fix be coming for this sometime soon so it works properly? Thank you for your efforts…I will become a happy donator soon!
If you change the weight to kg instead of lb then it would work
Canada post calculates shipping cost based on two factors: weight and volumetric « weight », whichever is higher is what is used as the « weight » of the parcel
hi,
its working fine for Canada, USA, but when i tried to have UK address, its giving me this error « A Valid Ship To Postal Code is Required » any solution to solve this problem…
thanks
Jeet
hi, someone can help with this UK issues ??
thanks
Jeet
Bonjour Olivier,
Je trouve le module super intéressant, ça aurait pu être payant aussi.
Si tu le rendais payant 15-25$ ça pourrait t’encourager à updater pour être compatible avec les nouvelles versions de OpenCart.
Je serai prêt à payer 15-35$ … Prestashop charge prêt de 75-150$ pour leur module de Poste Canada qui est fonctionnel et moins de bug.
En ce moment, j’hésite un peu. J’ai un template qui fonctionne seulement sur la version OpenCart 1.4.9.3./1.4.9.4/1.4.9.5 et ton module fonctionne sur 1.4.8 je sais pas si je vais avoir des Bugs lors de l’installation. J’ai le choix entre OpenCart et Prestashop pour le module Poste Canada.
J’ai comme un dilemme entre 2 ecommerces.
@Souligna Il n’y a pas eu d’update parce qu’il n’y a pas eu de bugs ajouter par les updates de OpenCart, J’ai des boutiques sur 1.4.9.5 avec ce plugin sans problèmes.
Je le test sur 1.5.0.5 cette semaine.
Wow merci pour la réponse super rapide!
Ok dans ce cas, je vais installer le module sur OpenCart 1.4.9.5
ça serait bien si tu fais la mise a jour des versions compatible sur le site web, si tu dis qu’il n’y a pas de bug. On hésiterai moins…
Sur le site web de OpenCart c toujours mentionner 1.4.8b
http://www.opencart.com/index.php?route=extension/extension/info&extension_id=78&filter_search=canada&sort=e.date_modified&order=DESC
Merci encore, j’ai hâte d’avoir des news pour le 1.5.0.5
Souligna
Le module a l’air de bien fonctionné pour avoir le prix mais les valeurs des radio button on des erreur
Notice: Undefined index: code in /opt/lampp/htdocs/myk/catalog/view/theme/myk/template/checkout/shipping.tpl on line 14 Notice: Undefined index: code in /opt/lampp/htdocs/myk/catalog/view/theme/myk/template/checkout/shipping.tpl on line 15
J’ai modifier les variable $quote['code'] pour des $quote['id'] et ca fonctionne a moitié, Le priority bug encore mais le expedited et regular fonctionne.
Si ca peut te mettre sur une piste :D
Hi,
I have setup the canadapost module for OPENCART in one of my clients and it works with Canadian shipping address very well but if you enter a US address it will give you this error:
« A Valid Ship To Postal Code is Required »
on the top of the page I have this error too:
« Notice: Undefined variable: quote_data in D:\Inetpub\vhosts\myurbantoes.com\httpdocs\store_online\catalog\model\shipping\canadapost.php on line 165″
I really appreciate if you could help me to solve this problem.
Thank you
Bruce.J
J’ai payé pour le module de Qphoria puisque j’utilise maintenant 1.5.1 mais c’est vraiment une merde, incapable de quoter sur les colis de 500g ou moins, juste 2 service qui s’affiche xpresspost et priorité sur tout les adresse usa et internationale, si tu update ton module qui a super bien fonctionné pendant un ans chez nous je suis prêt à payer pour.
Yahoo! First I’d like to start off by saying thank you for this module … it’s fantastic and the price is good too. I noticed that there were posts in the earlier version of this extension regarding the error message « error connecting to Canada Post ». I tried some of the fixes mentioned there and they didn’t work for me and not putting in the weight wasn’t an option either since it does affect the price of the item that you’re shipping. Well, I did some testing and found out that if you keep the weight of the item below the « Weight Limit of Box (kg) » in your settings on the Canada Post website, then you will not get that error. So, I had put 6kg and if I have an item that weights 6kg then I’ll get the error, however if the weight is below 6 then it works. I would suggest that you put your weight limit of box on the Canada Post website to a slightly higher number than what you’ll need and it will all work!
It is a shame that this module has been abandoned. It was the only real option. Like Alex I also paid for Qphoria’s mod. A good developer who has done great work on OC, but that CP mod is a steaming pile. He basically told me that there is no way to price stuff less then 500g which is wrong, but no reasoning.
Hi, I’d like to thank everybody that loved this module.
This module HAVE NOT BEEN ABANDONED, it’s just postpone since we at YourNetSpace just merged with Xagone and in all the sinergy, OpenSources projets and module have suffured. We will work on this next week, stay tuned!
That is great, sorry for assuming it was abandoned. As of now I am no longer using the module (not because or any problem with it directly) but because I seem to be having some issues with the canadapost account giving weird results. I look forward to trying this module when it is ready for 1.5. If I can get it going smoothly I will more then happily make a donation for your work. Regards
http://gimbolens
Merci de nous garder au courant. J’attends le module avec impatience! ;-)
Hi there,
I am trying to install the Canada Post Module but when I hit edit in the shipping page I get a white screen. This is the url at the top of the white screen:
http://newromanticmusic.com/store/admin/index.php?route=shipping/canadapost&token=4282922291d6ca0d7a086c0e1d0a3136
Any help would greatly be appreciated. Thanks!