Setting up Canada Post real-time shipping calculator=
To set up shipping cost calculation through Canada Post real-time shipping calculator:
1. If you haven't yet done so, provide your own company address in the 'General settings->Company options' section. Make sure you provide this address correctly - it will be submitted to the real-time shipping calculator as the origin address for all shipments from your store and thus will affect the shipping rates.
2. Obtain an account with Canada Post (Sign up at http://www.canadapost.ca/).
3. Enable your store to use the real-time shipping calculator provided by Canada Post:
- a. In your store's Admin area, go to the 'General settings->Shipping options' section.
- b. On the 'General settings->Shipping options' page, select the check box 'Enable real-time shipping calculation'. Unselect the check box 'Use Intershipper calculation service'.
- c. Use the 'Canada Post account details' subsection of 'General settings->Shipping options' page to provide the required information.
4. Adjust Canada Post options:
- a. Go to the 'Shipping methods' section of your store's Admin area (Settings menu->Shipping methods).
- b. Find Canada Post in the list of real-time shipping methods and click the Options >> link opposite it. A dialog box with Canada Post options opens.
- c. Adjust the options according to your preferences.
- d. Click the Apply button.
That is all. Now you can test whether your store can receive real-time shipping rates correctly. For details, see X-Cart:Testing Your Store's Ability to Receive Real-time Shipping Rates page.
When testing real-time shipping rates calculation, I am getting the following error from Canada Post:
X-Cart HTTPS: libcurl error(7): couldn't connect to host
To get the Canada Post rates, X-Cart sends requests from your server to sellonline.canadapost.ca (Canada Post's server) via port 30000. If outgoing connections via port 30000 are not allowed on your server, it will cause the error in question.
To fix this issue contact your hosting support or the server admins, and ask them to allow outgoing connections via port 30000.
Script to test connection to Canada Post's server via port 30000
- Download the File:Test connection to canadapost.php.txt, save the downloaded file as 'test_connection_to_canadapost.php'.
- Upload test_connection_to_canadapost.php to your web server's document root.
- Use the following URL to test: