Bugfix: 'stock' counted 1 after using 'repeat'

The 'stock' plugin uses the 'product_id' field in the cart item, but
this was not copied by the 'repeat' plugin. The confusion is caused by a
mismatch between the API for RevBank::Cart->add and the internal
representation.
This commit is contained in:
Juerd Waalboer 2018-06-09 23:47:21 +02:00
parent 3ce1874d3a
commit b31b95ca37
2 changed files with 8 additions and 3 deletions

View file

@ -15,6 +15,10 @@ sub new {
sub add {
my ($self, $user, $amount, $description, $data) = @_;
# Note: 'repeat' plugin is currently dependent on this specific
# implementation!
$data ||= {};
my $item = {
%$data, # Internal stuff, not logged or printed.