MiniVend Akopia Services

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

Re: [mv] Modifying a UserTag for CommonAdjust



On Sun, Dec 12, 1999 at 08:00:01PM -0500, Rob Zimmerman wrote:
> ******    message to minivend-users from "Rob Zimmerman" <rob@readysite.net>     ******


I'm not at all sure about the environment a UserTag gets, but 
I'm **thinking** the product code is available as $item and that
if you return undef CommonAdjust will fall through to products:price.

  return unless ( $item =~ /pz$/ );  # return unless code ends in pz
  foreach $level ( @breaks ) {
   last if $nitems < $level;
   $ca_string = "pricing:q$level";
  }



> 
> 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
> ------
> -
> To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Database publishing, e-commerce, office/internet integration, Debian linux.


Search for: Match: Format: Sort by: