diff --git a/plugins/statiegeld b/plugins/statiegeld index 32d26d0..09dae8a 100644 --- a/plugins/statiegeld +++ b/plugins/statiegeld @@ -30,13 +30,15 @@ sub statiegeld_product($product) { $product = $products->{$product} or return; } + # Called 'addons' here but also includes the queried product itself, + # to support things that are 100% statiegeld (e.g. empty crate) my @relevant_addons = grep { my $addon = $_; !$addon->{percent} and (List::Util::any { $addon->{contra} eq $_ } @addon_accounts) and $addon->{price} > 0; - } @{ $product->{addons} // [] }; + } $product, @{ $product->{addons} // [] }; return 0 if not @relevant_addons; return { product => $product, statiegeld_addons => \@relevant_addons }; diff --git a/plugins/statiegeld_tokens b/plugins/statiegeld_tokens index 3fcf977..df0fe4a 100644 --- a/plugins/statiegeld_tokens +++ b/plugins/statiegeld_tokens @@ -4,7 +4,6 @@ # voiding of tokens # querying of tokens # expiry of tokens -# token for non-hidden addon (direct product use) use List::Util;