Apache-iNcom

 view release on metacpan or  search on metacpan

lib/Apache/iNcom/CartManager.pm  view on Meta::CPAN

	my $item = shift;
	my $data = $DB->template_get( "product", $item->{code} );
	return $data->{price};
    }

=item item_discount

The function should return the discounts that apply for that
particular item. It can return zero or more discounts. It returning
more that one discount return a an array reference. Discount are
substracted from the item price so don't return a percentage.

    Ex:	item_discount => sub {
	my $item = shift;

	# Discount are relative to item and quantity
	my $data = $DB->template_get( "discount", $item->{code},
				      $item->{quantity} );
	return unless $data; # No discount

	# Discount is proportional to the price



( run in 0.273 second using v1.01-cache-2.11-cpan-10c994e2082 )