[ic] Size based shipping

Tony Scott interchange-users@interchange.redhat.com
Mon Dec 3 12:48:18 2001


Howdy.

One problem that I see right off is :
if ([item-modifier size] =~ /^xl/i) {$total += ([item-quantity] * 11.95);}

Try changing "[item-quantity]" to "[nitems]".  I had this problem with my
system.  I kept getting a shipping price of over 30 million dollars
(hand-delivered by Tibeten monks?).

Here is where I found my answer:
http://interchange.redhat.com/cgi-bin/ic/dev/ictags_51.html  (thanks to
Chris Knight)

Not sure about the size modifier, but hope this helps point you in the right
direction.

Now, if only someone could tell me how to change the default sort-order in
the 'merchandising editor', I would be a happy camper.

-Tony Scott

<original message follows>
-------------------------
Rick Eicher II interchange-users@interchange.redhat.com
Mon Dec 3 11:44:00 2001

----------------------------------------------------------------------------
----

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.

Thank you for your time,
Rick Eicher II
www.pbol.net