I am trying to get this mod to work both in canada and the us at the same time.
This is the line that regulates it:
$request = join('&', array('service=1',
If services=1 (CAN) If services=2 (USA)
This mod can work for either but not both as of now.
You have to manually change the file to use one or the other.
I was thinking that if the file could be rewrote to check the first character of the zip/postal code, then it could be set for 1 or 2 for the services.
Canada postal code k8a 1e3 - first character is a letter
USA zip code 59595 - first character is a number
I was thinking something like:
If zip character equal or greater than 0,
Then
//Connect to CanPar here to get quote, and parse XML.
$request = join('&', array('service=2',
'quantity=' . $shipping_num_boxes,
'unit=K',
'origin=' . $srcFSA,
'dest=' . $desFSA,
'weight=' . intval($shipping_weight),
'cod=0',
'put=0',
'xc=0',
'dec=0'));
ELSE
//Connect to CanPar here to get quote, and parse XML.
$request = join('&', array('service=1',
'quantity=' . $shipping_num_boxes,
'unit=K',
'origin=' . $srcFSA,
'dest=' . $desFSA,
'weight=' . intval($shipping_weight),
'cod=0',
'put=0',
'xc=0',
'dec=0'));
I don't know coding at all, so this is where I am stuck and need someone with coding experience to help me with this.
I know the file already grabs the first 3 characters for retrieving quotes.