From 731b47c0ec3b75d78015a8e844e2b8ead9d8097c Mon Sep 17 00:00:00 2001 From: "oliver.burkhalter" Date: Sat, 14 Oct 2023 15:02:05 +0200 Subject: [PATCH] Fix the variant price json output for the data-bb-pricing html data attribute (#225) --- .../views/WishlistDetails/_variantPrice.html.twig | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Resources/views/WishlistDetails/_variantPrice.html.twig b/src/Resources/views/WishlistDetails/_variantPrice.html.twig index 32111660..ba07ed07 100644 --- a/src/Resources/views/WishlistDetails/_variantPrice.html.twig +++ b/src/Resources/views/WishlistDetails/_variantPrice.html.twig @@ -5,20 +5,17 @@ {% set prices %} [ {%- for price in pricing -%} - { + {{- '{' -}} {%- for option, value in price -%} "{{- option -}}": {%- if option == 'value' or option == 'original-price' -%} "{{ money.convertAndFormat(value) -}}" - {%- elseif not value is iterable -%} - "{{ value|replace({'\"': '\''}) -}}" {%- else -%} - "" + "{{ value }}" {%- endif -%} - {{- not loop.last ? ', '-}} + {{- not loop.last ? ', ' -}} {%- endfor -%} - } - {{- not loop.last ? ', '-}} + {{- not loop.last ? '}, ' : '}' -}} {%- endfor -%} ] {% endset %}