[ic] Canadian shipping woes.

Honest to Goodness interchange-users@interchange.redhat.com
Fri May 3 10:40:01 2002


On Fri, 2002-05-03 at 09:51, Bruno Cantieni wrote:
> Has anyone got shipping from Canada working with anything other than straight flat rate or formula
> based methods?
> (IC 4.8.3, out "of the box" or 4.6.5 for that matter)
> 
> I am no shipping guru, but I have put together shipping for several of my US base clients including
> setting up new methods using web lookups (UPS), zone chart & rate tables (USPS specific no less) as
> well as custom weight/price based methods.
> 

I set up [ic] to fetch the shipping rates directly from the Canada Post
eparcel server when the checkout page is loaded. Inside a perl block a
loop goes through all the ordered products and builds up a big piece of
xml. This is sent to a global usertag which opens the socket to CanPost,
sends the xml and receives the reply.

The various prices for different shipping services are parsed out and a
sneaky bit of code simply puts them into some variables. The formula for
the shipping routes has only to fetch the values of those variables.
That way [ic] can take care of formatting the radio buttons presented to
the customer, it works like a charm! The transmission does not occur if
there is no change in the contents of the cart or the user is not logged
in and there is no destination postal code.

Thanks to this list I was able to get over all the obstacles.