Akopia Akopia Services

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

Re: [mv] Interchange-4.5.5 -- Tag->price problem



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting Ton Verhagen (ton@verhagen.net):
> ******    message to minivend-users from Ton Verhagen <ton@verhagen.net>     ******
> 
> Hello list,
> 
> I am experiencing some problems with the $Tag->price() tag.
> 
> When I put the following on a result/flypage:
> 
> [price code discount=1 noformat=1]
> This displays the proper price for code (discounted and raw figure) -->Okay
> 
> However when I use:
> $Tag->price( {code=>"mycode", discount=>1, noformat=>1} )
> --> displays the undiscounted price (raw figure) --> NOT Okay (no discount)
> 
> $Tag->price( {code=>"mycode", discount=>1, noformat=>0} )
> --> displays the undiscounted price (formatted) --> NOT Okay (no discount)
> 
> Conclusion: $Tag->price() won't do any discount! :(

Correct. Discount's do eval, which is a no-no in Safe.
You could SafeUntrap entereval and do your own if you
want.

	$s = $Tag->price( { noformat => 1} );
	if($Session->{discount}{$sku}) {
		# You should check $@
		$price = eval $Session->{discount}{$sku};
	}
	else {
		$price = $s;
	}

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>

Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
 -- Winston Churchill
-
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: