[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Length of Text field added to price
Hello,
I have an option that is a Text Entry field called inscription. I
need to add the following to the item's price: length of inscription
* $1.50
I currently used the following code to display the additional price:
Before the cart item-list:
[item-list]
[if-item-modifier inscription]
[item-calc]
my $line = [item-increment];
my $cart = $Carts->{main};
$line--;
$cart->[$line]{insc_length} = length("[item-modifier inscription]");
$cart->[$line]{insc_price} = 1.50*length("[item-modifier
inscription]");
return;
[/item-calc]
[/if-item-modifier]
[/item-list]
Then, in the cart's item-list, I have the following:
[if-item-modifier inscription]
Number of characters: [item-modifier insc_length]<BR>
Price of inscription: [currency][item-modifier insc_price][/currency]<BR>
[/if-item-modifier]
So, how can I modify CommonAdjust to include the insc_price, added to
the regular item-price?
Some of these items may have no inscription at all, so it should
fallback to the regular price.
Thanks in advance for any advice
--
----
Daniel A. Shockley, Database Programmer
MacEasy Computing
DanielAShockley@yahoo.com
dan@maceasycomputing.com
http://www.maceasycomputing.com