[ic] shipping idea

Rick Eicher II interchange-users@interchange.redhat.com
Thu Nov 29 18:00:01 2001


> At 10:16 AM 11/29/2001 -0600, you wrote:
> >I am trying to set the shipping cost based on the size of the items.
> >
> >I have read the following from the archieves for the shipping.asc:
> >
> >usps    Mail    [item-accessories size] 0       1       5
> >usps    Mail    [item-accessories size] 2       2       7
> >
> >
> >small = $5.00
> >medium = $7.00
> >I am wondering if there is a way to chain or loop this to go throught the
> >whole cart?
> >
> >So if the customer buys two small he gets charged $10.00 not $7.00.
> >
> >I have read a hundred different ways to do this. Would like to know the
> >correct way to get this output.
> >
> >Redhat 7.1 and interchange 4.8.3 (rpm)
> >
> >Thanks,
> >rick
>
> There are probably more than 100 :-)
>
> One way would be to use the free-form method for shipping.asc:
>
> usps: Mail
>          criteria <<EOC
> [calc]
>          my $total = 0;
>          [item-list]
>                  $total += ([item-quantity] * 5) if
> q{[item-modifier size]}
> =~ /^s/i;
>                  $total += ([item-quantity] * 7) if
> q{[item-modifier size]}
> =~ /^m/i;
>          [/item-list]
>          return $total;
> [/calc]
> EOC
>          min     0
>          max     999999
>          cost    f @@TOTAL@@
>
>
>
> - Ed L.
>
First let me say thanks I think this will work. I have added and modified my
shipping.asc file to the following:

FLATD   Standard
                 criteria <<EOC
                   [calc]
                     my $total = 0;
                     [item-list]
                       $total += ([item-quantity] * 8.95) if
q{[item-modifier size]} =~ /^S/i;
                       $total += ([item-quantity] * 9.95) if
q{[item-modifier size]} =~ /^M/i;
                       $total += ([item-quantity] * 10.95) if
q{[item-modifier size]} =~ /^L/i;
                       $total += ([item-quantity] * 11.95) if
q{[item-modifier size]} =~ /^XL/i;
                     [/item-list]
                     return $total;
                   [/calc]
EOC
         min     0
         max     999999
         cost    f @@TOTAL@@

My options.txt is as follows:

code  o_master sku   o_group o_enable o_label o_value             o_widget
price
AP212 1        AP212 Size    1        Size    m=Medium*,^Ml=Large select
m==32.95,l==49.95

I have remove all the collumns that are not used.

With the above two when i try to buy a "AP212" i get "Note: No match found
for mode 'FLATD', quantity '', returning 0." error message.

What can I do to trouble shoot? Or what have i done wrong?:)

Thanks again for all the help,
Rick Eicher II
www.pbol.net