[ic] shipping.asc and formulas (adder or at_least field)

Randy Just randyjust at justcomp.com
Sat Oct 29 14:44:38 EDT 2005


Kevin, thanks for your assistance!!!

The code you provided below worked as advertised.  Yahoooo!  I am now 
able to change
my minimum shipping charge based on the value of the merchandise total.

I also dropped the "interpolate=1" from the string as you suggested 
and it is working still.


> >
> > at_least              [calc interpolate=1]$tmp1=([item-list][item_field
> > 
> price]*[item_quantity]+[/item-list]0);if($tmp1>8.99){$tmp2=5.49}else{$tmp2=4.99};return
> > $tmp2;[/calc]
> >
>
>I don't believe that the "min_cost" field interpolates ICML tags at
>all, at the moment.  There may be a good reason for this, or perhaps
>I'm just reading the code wrong.
>
>Assuming I'm correct, the following patch should add the capability.
>I say "should" because I haven't tested it at all. :-)
>
>----------------------------------------------------------------------
>--- Ship.pm     9 Jun 2005 18:43:58 -0000       2.13
>+++ Ship.pm     28 Oct 2005 19:18:03 -0000
>@@ -694,6 +694,10 @@
>
>                 $o = get_option_hash($row->[OPT], $o)
>                         if $row->[OPT];
>+
>+               $o->{at_least} = interpolate_html($o->{at_least})
>+                       if (defined($o->{at_least}) && 
>$o->{at_least} =~ /__\w+__|\[/);
>+
>                 # unless field begins with 'x' or 'f', straight 
> cost is returned
>                 # - otherwise the quantity is multiplied by the 
> cost or a formula
>                 # is applied

>    K e v i n   W a l s h




More information about the interchange-users mailing list