[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] discount tag
>
> Is there any way to use a variable with the [discount] tag?
>
> For instance, I would like to discount an entire order by a dollar amount
> that is held by a scratch variable. I have been trying something like:
>
> [discount ENTIRE_ORDER] $s - [scratch VARNAME] [/discount]
>
> I have looked at the docs and the only examples that I have seen use an
> integer instead of a variable.
>
You have two choices:
1) Evaluate the "varname" scratch when the discount is defined:
[discount code="ENTIRE_ORDER" interpolate=1]$s - [scratch varname][/discount]
2) Evaluate the "varname" scratch when the discount value is calculated:
[discount ENTIRE_ORDER]$s - $Scratch->{varname}[/discount]
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/