Akopia Akopia Services

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

[mv] scratch variables in discount tags



******    message to minivend-users from "Russ Mann" <russrmann@hotmail.com>     ******

Hello List,

Well, i have my funky pricing routine almost working.  by using [perl
arg=scratch interpolate=1] i was finally able to get my scratch variables in
perl tags.

now, i have one more scratch variable to use, and i need to use it in the
"discount" tag.

The following URLs are of posts asking the same question, not getting any
answers.

http://www.minivend.com/minivend/minivend-list/1999/msg07974.html
http://www.minivend.com/minivend/minivend-list/1999/msg04468.html


Here's the code i have so far:


<!--
[item-list]
[calc]if ('[item-field covertype]' eq 'Audio Tapes') { $totalbps +=
[item-quantity]; } [/calc]
[/item-list]
[set name=totalbps interpolate=1][calc]$totalbps[/calc][/set]
-->
[perl arg=scratch interpolate=1]
my $numoff;
my $totalbps = $Safe{'scratch'}->{'totalbps'};
if ($totalbps <= 2) { $numoff = 0; }
elsif (($totalbps >= 3) && ($totalbps <=9)) { $numoff = 1.96; }
elsif ($totalbps >= 10) { $numoff = 2.46; }
$discount_amount = $totalbps * $numoff;
$Safe{'scratch'}->{'discount_amount'} = $discount_amount;
return '';
[/perl]

This all evaluates fine when i display with this:

Quantity of Briefing Packages: [scratch totalbps]<br>
Briefing Package Quantity Discount: [scratch discount_amount]<br>

The problem come when i try to apply the discount

[discount ENTIRE_ORDER]
return($s - [scratch happytalk]);
[/discount]

I've tried many ways to get the scratch variable to work in the discount tag
to no avail.  Any ideas would be appreciated.


Thanks,

Rm
-
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: