[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Modifying a UserTag for CommonAdjust
I am using the below user tag to do quanity price breaks. But now that the
product database has grown I need to modify this to do further filtering. I have
not yet mastered perl and would appreciate any help. Here is the additional
filter:
I need to only give quanity pricing to item numbers ending in pz. Like 105pz
and 32pz but not 32cp or 105p. Here is the User Tag:
###
CommonAdjust "[mix-match number='[nitems]']" ;products:price
#### UserTags #####
UserTag mix-match Order number
UserTag mix-match Routine <<EOR
sub {
my $nitems = shift;
my $ca_string = 'products:price';
my $level;
my @breaks = ( 1, 2 );
foreach $level ( @breaks ) {
last if $nitems < $level;
$ca_string = "pricing:q$level";
}
return $ca_string;
}
EOR
Many thanks all,
Rob
------