MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

RE: i need help with a pricing scheme



This works like a charm :) thanks... except i use it inside an [on-change]
and the [else] that is associated with it conflicts with the else in my [if
scratch result].

it looks something like this:
[search-list]
[on-change cat]
 [condition][item-field category][/condition]
   [perl arg=scratch]
 	my $test1 = q{[loop-field foo]} eq 'this';
 	my $test2 = q{[loop-field bar]} eq 'that';
 	$Safe{scratch}{result} = $test2 || $test1;
 	return '';
   [/perl]

   [if scratch result]
 	consequence...
   [else]
   stuff
   [/else]
   [/if]
 [else]
   [perl arg=scratch]
 	my $test1 = q{[loop-field foo]} eq 'this';
 	my $test2 = q{[loop-field bar]} eq 'that';
 	$Safe{scratch}{result} = $test2 || $test1;
 	return '';
   [/perl]

   [if scratch result]
 	consequence...
   [else]
   stuff
   [/else]
   [/if]
 [/else]
[/on-change cat]
[/search-list]

Is there a way of doing nestled if/else's so all the else's don't confuse
each other?

thanks,
mike k.


>
> The best way to do things like this is:
>
> [perl arg=scratch]
> 	my $test1 = q{[loop-field foo]} eq 'this';
> 	my $test2 = q{[loop-field bar]} eq 'that';
> 	$Safe{scratch}{result} = $test2 || $test1;
> 	return '';
> [/perl]
>
> [if scratch result]
> 	consequence...
> [/if]
>
> This will be a lot less labored in MV4, believe me. More soon..



Search for: Match: Format: Sort by: