Canada Post is a premium shipping method which let you get shipping rates from Canada Post’s API. It requires that your store uses Canadian Dollars for it’s currency and that your server has SimpleXML installed. The extension primarily works with cm and kg, but other units can be converted automatically.
Canada Post can calculate quotes worldwide as it handles both domestic and international parcels.
Installation ↑ Back to Top
- Upload the plugin folder to the ‘/wp-content/plugins/’ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Thats it – you can now configure the plugin.
Configuration ↑ Back to Top
- Once the plugin has been activated, go to WooCommerce > Settings > Shipping Methods.
- The method will be listed at the top of the screen, underneath the tabs. Click on ‘Canada Post’.
- You can now configure the method.
- Enable/Disable – Choose whether to enable the shipping method of not.
- Method Title - Name the shipping method. This will be visibile by customers.
- Origin Postcode – This should be set to the postcode from which you will ship. It is sent to the Canada Post API.
- Method Availability – This setting lets you narrow down the countries which can get quotes. Leave set to All Countries to have it available for all customers.
- API Settings - This section is where you input your API Details from Canada Post. Your API access details are obtained from the Canada Post website. After creating an account, look for the developer program (you may need to join it, or you can find it from the navigation under “Programs”). The developer page will list your API Keys for both production and development.
- Customer Number – Get this from Canada Post when you signup.
- Development Username/Password – Found on the developer page on the Canada Post website after signup.
- Production Username/Password - Found on the developer page on the Canada Post website after signup.
- Production Mode - Enable production mode when your store goes live and you have finished testing. This setting also disables the debugging information shown on your cart/checkout.
- Rates and Service Settings- These settings control the services and rates you offer customers.
- Quote Type - Commercial uses rates (with discounts) from your account. Select ‘counter’ to get rates you’d get over the counter in person.
- Lettermail – Choose to enable standard and registered lettermail rates. These rates don’t use the API (as Lettermail isn’t part of Canada Post API) and instead are calculated using box packing and hardcoded prices.
- Additional Options/Delivery options/Proof options - Choose additional options for your parcels, such as “Card for Delivery”
- Parcel Packing Method – See below.
- Offer Rates – Choose to return all rates (user will get the choice) or just return a single rate.
- Services – Here you can rename, and re-order, Canada Post shipping rates and add price adjustments as a percentage or by dollar amount. These adjustments can be either positive or negative, should you want to apply discounts to shipping.
Parcel Packing Methods ↑ Back to Top
There are 3 packing methods with Canada Post; each affects the parcels you send to the API.
Each item in your cart (non virtual) will be sent to the Canada Post API. Quotes for all items will be combined for the final cost.
The cart will be split into 30kg packages, and each package sent to the API. No dimensions will be sent, only the weight.
Pack into boxes
Items will be packed into pre-defined boxes and sent to the API. We recommend this option. See box-packing below for more information on this.
Box-Packing ↑ Back to Top
The box packer included with this shipping method lets you group items into packages of which you define the height, width, length, weight and max-weight. The packing is mainly volume based, but does also consider item sizes too.
Setting up box sizes
Within the settings, look for the boxes setting. Click ‘add box’ to set up the boxes dimensions:
Outer dimensions are used for parcel dimensions and are passed to the API.
Inner dimensions are used for packing, and items will be fit within these.
Box weight is the weight of the actual box, and will be added to the weight of the contents.
Max weight is the maximum weight your box can hold. This includes contents weight and box weight.
How the calculation works
The packer does the following:
- Finds boxes which fit the items being packed (uses H x W x D).
- Packs all fitting items into boxes (using volume).
- The largest box which fits 100% of items is used *or* use the highest % packed box, and then pass unpacked items back (and repeat the process)
- Unpackable items are packed alone, using the item dimensions.
- All packed boxes are returned.
Customer Usage ↑ Back to Top
Customers will get quotes (after inputting their address) from two places;
- The cart page – by using the shipping calculator
- The checkout page – by filling in the shipping and billing forms
Troubleshooting ↑ Back to Top
No rates returned/no rates available
- Ensure your API credentials are correct.
- Enable development mode, or turn on WP_DEBUG to see debugging information on the cart page. This will often reveal the problem.
- Check your products have sizes and weights set – without this the calculation cannot be performed.
- Check your store’s base country is Canada and that your using Canadian Dollars (from WooCommerce > Settings > General).
Incorrect rates returned
e.g. domestic rates for international addresses. This is a known issue with ‘development’ mode. Once switched to ‘production’ rates will be correct.
Leave at Door Option will not return rates for Canada to USA shipping
You can not have the ‘Leave at Door – do not card’ option set when shipping from Canada to the USA.