[ic] Shipping Quote - SOLVED
Steve
icdev at mrlock.com
Fri Jul 2 10:24:56 EDT 2004
Here is a brute force method to access the shipping quotes within
Interchange. It adds an item to a new cart that weighs 1 pound, then
calculates the weight for x number of items.
I'm not sure the request form action headers are quite correct for each of
these page requests - so please correct me if necessary.
=============
sh.html <- get the zip code and weight/number of items from the user.
=============
<FORM ACTION="[process secure=0]" METHOD="POST" name=checkout>
<INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">
<INPUT TYPE=hidden NAME=mv_doit VALUE=refresh>
<INPUT TYPE=hidden NAME=mv_nextpage VALUE="sh2">
<table width="95%">
<tr><td align="center">
<br>
Enter your zip code and click Calculate
<br><br>
</td></tr>
<tr>
<td align="left" class="contentbar1">
[error name=zip std_label="Enter ship to Zip/Postal Code" required=1]
<INPUT TYPE=text NAME=zip VALUE="[value name=zip filter=word]"
size="10" maxlength="10">
[error name=zip2 std_label="Weight" required=1]
<INPUT TYPE=text NAME=t_qty_items VALUE="1" size="3" maxlength="3">
<input type="submit" value="Calculate">
</td>
</tr>
</table>
=============
sh2.html <- calculate & display all valid shipping options.
=============
[comment] Clear cart [/comment]
[calc]
@{$Carts->{$CGI->{mv_cartname} || 'main'}} = ();
[/calc]
[comment] add item that weighs 1 lb, however many times needed
(t_qty_items).
The following routine also uses the add_item tag that was supplied in the
archives - it is not
a default tag in IC 4.8.x
[/comment]
[add_item code="12129" qty="[calc][cgi t_qty_items][/calc]"]
<br><br>
[item-list]
[seti weight][summary amount=`[item-quantity] * [item-field weight]`][/seti]
[/item-list]
For ([scratch weight]) lbs - we offer these standard options:<br>
<SELECT NAME=mv_shipmode MULTIPLE SIZE=5>
[loop option=mv_shipmode
list=|[data table=country key='[default country US]'
l=shipmodes]| ]
<OPTION VALUE="[loop-code]"> [shipping-desc [loop-code]]: [shipping
[loop-code]]
[/loop]
</SELECT>
[comment] Clear cart again [/comment]
[calc]
@{$Carts->{$CGI->{mv_cartname} || 'main'}} = ();
[/calc]
==================
Hope this is useful
-Steve
More information about the interchange-users
mailing list