Prevent negative prices for products

This commit is contained in:
Juerd Waalboer 2013-02-26 23:06:55 +01:00
parent 240ae5f205
commit ac1c7235f7

View file

@ -21,8 +21,9 @@ sub command :Tab(edit) {
for my $fields (@products) {
next if $command ne $fields->[0];
next if $fields->[1] < 0;
$cart->add(undef, - $fields->[1], $fields->[2]);
$cart->add(undef, 0 - $fields->[1], $fields->[2]);
return ACCEPT;
}