Rackit,
I think I may have tracked down why this is not working for Fedex or Canada Post.
Mod_UPS calls for
Code:
$dst_country_code=$userinfo["s_country"];
$dst_city=$userinfo["s_city"];
$dst_zipcode=$userinfo["s_zipcode"];
Mod_CPC (Canada Post Corporation) requires
Code:
$cp_dest_country = $userinfo["s_country"];
$cp_dest_city = $userinfo["s_city"];
$cp_dest_zip = $userinfo["s_zipcode"];
$cp_dest_state = $userinfo["s_state"];
I believe that the Canada Post server validates the Postal code with the province (state).
Mod_Fedex asks for a whole bunch of stuff which is probably beyond keeping this estimator simple.
Code:
# do all these queries only if FedEx is present.
if ($FEDEX_FOUND) {
$supportHome=array('US'=>1,'CA'=>1);
$supportGrnd=array('US'=>1,'CA'=>1,'PR'=>1);
$ozip = $config["Company"]["location_zipcode"];
$dzip = $userinfo["s_zipcode"];
$s2res = ($supportHome[$userinfo["s_country"]] ? $params["param02"] : "false");
$ctyp = ($supportGrnd[$userinfo["s_country"]] ? $params["param00"] : "Express");
$isex = ($ctyp == "Express" ? true : false);
$isgr = ((($ctyp == "Ground" || $ctyp == "Both") && $s2res != "true") ? true : false);
So because I am concerned with Mod_CPC (Canada Post) I need to add the province (state) data to the information sent by the shipping estimator.
I can either
1. Let the customer choose there province from a drop down (in addition to the postal code entry)
2. Have the postal code look-up in PHP for the correct province (state) info.
Canadian Postal Codes work like this
Letter-Number-Letter<space>Number-Letter-Number
ie.
R7N 2G6
A1N 9D9
N7X 4J0
The first character a letter dictates which province the postal code is for. List for lookup in PHP purposes.
Newfoundland/Labrador - "A"
Nova Scotia - "B"
Prince Edward Island - "C"
New Brunswick - "E"
Quebec - "G", "H", "J"
Ontario - "K", "L", "M", "N", "P"
Manitoba - "R"
Saskatchewan - "S"
Alberta - "T"
British Columbia - "V"
Northwest and Nunavut Territories - "X"
Yukon Territory - "Y"
I could use some help and would be happy to donate or something. I can guarantee that an ENTIRE nation of X-Cart users would be very excited and grateful to have this mod.
