[ic] Size based shipping

Ed LaFrance interchange-users@interchange.redhat.com
Mon Dec 3 13:27:01 2001


At 10:55 AM 12/03/2001 -0600, you wrote:
>I am trying to make shipping to be based on the size of the items.
>
>I have looked throught the archives and spent time in the IRC chat. I have
>tried many different ways to make this work. I am now trying to use a
>usertag to make this work.
>
>I have a shipping.asc file of:
>
>FLATD   Standard        price   0       0       e No thing to ship
>FLATD   Standard        price   0       9999999 f [ship]
>
>I have a usertag defined in the catlog.cfg:
>
>#==========================================================================#
>
>#Shipping user tag
>
>UserTag ship Routine <<EOF
>sub{
>package Vend::Interpolate;
>my $total =0;
>[item-list]
>if ([item-modifier size] =~ /^s/i) {$total += ([item-quantity] * 8.95);}
>if ([item-modifier size] =~ /^m/i) {$total += ([item-quantity] * 9.95);}
>if ([item-modifier size] =~ /^l/i) {$total += ([item-quantity] * 10.95);}
>if ([item-modifier size] =~ /^xl/i) {$total += ([item-quantity] * 11.95);}
>[/item-list]
>return $total;
>}
>EOF
>
>#==========================================================================#
>
>
>When i load an item into the cart it gives me a shipping cost of
>$154,792,564.00 for a medium
>and $154,792,620.00 for a large. Now while i plan to retire someday I do not
>think I will get many sales on this site.:)
>
>So what have I done wrong? lol To me the code looks write but I know that
>one can not proof read there own essay.
>
>I am useing redhat 7.1 and interchange 4.8.3(rpm). Not that that will matter
>much.
>

This looks suspiciously like some code I posted a week or so ago - though 
it was never intended to be used this way.  A little knowledge is indeed 
dangerous ;-).

Try it this way and see if the shipping rate is a bit more reasonable:

FLATD   Standard        [ship]   0       0       e No thing to ship
FLATD   Standard        [ship]   0       9999999 f @@TOTAL@@ * 1

- Ed L.



===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================