[ic] Item Discount Persists when clearing ALL_ITEMS

Peter peter at pajamian.dhs.org
Wed Feb 2 05:37:21 UTC 2011

On 02/02/11 13:48, Mike Heins wrote:
> You can do
> 	%{$Session->{discount}} = ();

Newer versions of Interchange use the $Discounts hashref instead, so the
above code becomes:
%$Discounts = ();

> if you don't want to preserve the special ENTIRE_ORDER
> and ALL_ITEMS discounts. If you do, then you could run:

delete @{$Discounts}{grep { !/^(ALL_ITEMS|ENTIRE_ORDER)$/ } keys
%$Discounts}; # Untested, but should work.


More information about the interchange-users mailing list