[ic] I can't believe I got this far...

Honest to Goodness interchange-users@interchange.redhat.com
Tue Apr 9 19:29:01 2002


I now have a GlobalSub (which is considered unsafe, but would a usertag
still be able to Use::Socket?) that receives some XML composed on the
checkout page from the item data. It sends this to a Canada Post server
and receives a big pile of XML in return, the rates are parsed out and
placed into scratch variables. Some remarkably simple shipping methods
(but hard to figure out) return these values into radio buttons on the
checkout page along with some conventional table lookup methods and the
whole thing works just great. The customer can select from the most
current and accurate rates.

Thanks to Ron Phipps for his lovely radio button code that showed me how
to sneak my fetched rates into the system. I added some html formatting 
to improve the output and ended up with this:

<HR width="60%"><div align="left">
<table border="0" cellspacing="2" cellpadding="0" align="center">
<TR><td align=left>
[shipping label=1 format="<input type='radio' name='mv_shipmode'
onClick='this.form.submit()' value='%M'%C>
%D </TD><TD align=right> %F</TD></TR><TR><TD>"
mode=|[data table=country key='[default country CA]' col=shipmodes]|]
</TD></TR></table>
</div><HR width="75%">

This code goes on the checkout.html page in place of the shipping select
box. You can't use both radio buttons and the select box or they will
interfere with each other. Remove the onClick handler if you don't want
the form to update when the shipping is selected.

This list has helped me a lot so I continue the noble tradition of
giving back to it for the others who will follow. Interchange is an
arcane alchemy and really needs a plain language primer. But until we
get one we will rely on the kindness of strangers.