Akopia Akopia Services

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

Re: [mv] Discounted fields in minivend database



******    message to minivend-users from Brent Worley <brent@12ave.com>     ******

After much time and headache, I have yet to have the [discount] tag be
selective about what it discounts.  I have tried minivends if/else tags
and I have tried embeded perl code.  I'm going to present both and see if
anyone has any suggestions or reasons why this code doesn't work.

[if [item-field Category] =~ Shirts,Suits,Blazers,Dress]
[then]
  [discount [item-code]]
    $s = $original;
    $discounted = $s * .75;
    $difference = $s - $discounted;
    return $discounted;
  [/discount]
[/then]
[/if]

This one produced a lot of uncertain results.  I don't think it ever
actually entered the if tag.  Here is what I had for perl code.

[perl interpolate=1]
  if(('[item-field Category]' =~ /^Suits/i) || ('[item-field Category]' =~
/^Dress/i) || ('[item-field Category]' =~ /^Shirts/i) || ('[item-field
Category]' =~ /^Blazers/i)
  {
    return [item-subtotal] * .75;
  }
  {
    return [item-subtoal];
  }
[/perl]

We have been trying to get either one of these tags to work but with no
luck.  If anyone sees any logic flaw or incompatibilities, please let me
know. Thanks.

Brent Worley
brent@12ave.com

-
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


Search for: Match: Format: Sort by: