Just so you can see what I'm doing, the guts of the shipping module are thus:
PHP Code:
//Connect to CanPar here to get quote, and parse XML.
$request = join('&', array('service=1',
'quantity=' . $shipping_num_boxes,
'unit=K', //Weight is in Kilos
'origin=' . $srcFSA, //postal code of the store
'dest=' . $desFSA, //postal code of the buyer
'cod=0', //no COD charges
'weight=' . intval($shipping_weight), //Interger weight
'put=0',
'xc=0',
'dec=0'));
$body = file_get_contents('http://www.canpar.com/CanparRateXML/BaseRateXML.jsp?' . $request);
$body_array = explode("<BaseRate>", $body);
$ShippingCost = $body_array[1];
$ShippingCost = ereg_replace('</BaseRate></CanparCharges></CanparRate>', '', $ShippingCost);
This writes a URL something like:
HTML Code:
http://www.canpar.com/XML/BaseRateXML.jsp?service=1&quantity=1&unit=L&weight=10&origin=M4X1W7&dest=L4Y2N9&cod=100&dec=200&put=0&xc=1
if I write my own url, I will get back XML data like this:
Code:
<?xml version="1.0" encoding="windows-1252"?>
<CanparRate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.canpar.com/XML/base_rate.xsd">
<CanparShipment>
<COD>0.00</COD>
<Declared>0.00</Declared>
<Origin>M4X1W7</Origin>
<Destination>L4Y2N9</Destination>
<ExtraCare>0.00</ExtraCare>
<PUT>No</PUT>
<Quantity>1</Quantity>
<ServiceType>1</ServiceType>
<Weight>10</Weight>
<Unit>K</Unit>
</CanparShipment>
<CanparCharges>
<BaseRate>8.65</BaseRate>
</CanparCharges>
</CanparRate>
and yet, Zencart will NEVER give me a value of 8.65 for shipping.