From 44d0cb9b694c44017d0753bb49c4dcafa60bf64a Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Wed, 25 Jan 2023 04:37:17 +0100 Subject: [PATCH] Don't repeat same description for statiegeld-only products --- plugins/statiegeld | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/statiegeld b/plugins/statiegeld index 729fcb8..b589154 100644 --- a/plugins/statiegeld +++ b/plugins/statiegeld @@ -62,7 +62,9 @@ sub command ($invocant, $cart, $command, @) { my $addons = $sg->{statiegeld_addons}; for my $addon (@$addons) { - my $d = "$addon->{description} ($product->{description})"; + my $d = $addon->{id} eq $product->{id} + ? "$addon->{description}" + : "$addon->{description} ($product->{description})"; $cart ->add(+$addon->{price}, $d, { plugin => $invocant->id, addon_id => $addon->{id} })