[ic] Size based shipping (almost got it)

Rick Eicher II interchange-users@interchange.redhat.com
Wed Dec 5 10:36:01 2001


Ok I almost have this working. Every thing works but the if statement.

Here is my user tag now:

#Shipping user tag


UserTag ship Routine <<EOF
sub{
package Vend::Interpolate;
my $total =0;

for(@$Items) {
#if {$Tag->accessories('size') =~ /^s/i} {$total += $_->{quantity} * 8.95;}
if {$Tag->accessories{'Size'} =~ /^m/i} {$total += $_->{quantity} * 9.95;}
#if {$Tag->accessories('size') =~ /^l/i} {$total += $_->{quantity} * 10.95;}
#if {$Tag->accessories('size') =~ /^xl/i} {$total += $_->{quantity} *
11.95;}
}
return $total;}
EOF


I just can not figure out how to do the "$Tag->accessories{Size}" part. I
need it to find the option "size" I have set up for the item. Once i get
this I am done. How should this be done?

My option.txt is:

AP212 1 AP212   Size  1  Size    m=Medium*,^Ml=Large    select
m==32.95,l==49.95


Thank you all for the help,
Rick