[ic] late added shipping method not working

Paul Jordan paul at gishnetwork.com
Wed Jan 19 15:39:20 UTC 2011



> On 19/01/11 13:02, Paul Jordan wrote:
> > I am a little unclear if something like this example is supposed to work:
> >
> > [set us_promo_max]19[/set]
> >
> > [if !scratch ship_added]
> > [seti ship_promo]
> > foo_promo: U.S. Postal Service First Class Air
> > crit [subtotal noformat=1]
> > min 0
> > max 0
> > cost e No shipping needed!
> > p_time 5-10 business days*
> > adder -1
> >
> > min 1
> > max [scratch us_promo_max].99
> > cost >>actual_foo
> >
> > min [calc] $Scratch->{us_promo_max} + 1 [/calc]
> > max 999999
> > cost 1
> >
> > min 1000000
> > max 9999990
> > cost 1
> > [/seti]
> > [shipping add="[scratch ship_promo]" hide=1]
> > [set ship_added]1[/set]
> > [/if]
>
> The min and max have to be fixed, but you can evaluate the criterion, so
> you can do something like this:
>
> crit <> [calcn]
> my $subtotal = $Tag->subtotal({noformat => 1});
> if (!$subtotal) {
> return '0.00';
> }
> elsif (int $subtotal <= $Scratch->{us_promo_max}) {
> return 1;
> }
> else {
> return 2;
> }
> [/calcn]
> EOC
>
> min 0
> max 0
> cost e No shipping needed!
> p_time 5-10 business days*
> adder -1
>
> min 1
> max 1
> cost >>actual_foo
>
> min 2
> max 2
> cost 1

 
Thanks Peter, I didn't even think of doing it that way. I found Mike's post and had blinders on trying to get it to work. 
 
Paul
 
 
  		 	   		  


More information about the interchange-users mailing list