From 15e072a2ff0ed6ec14e8e99832e08f7afac7d3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 3 Jul 2023 23:41:39 +0200 Subject: [PATCH] Fixed exception when the calculated minimum_order_price is null This fixes issue #311 --- templates/parts/info/_main_infos.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/parts/info/_main_infos.html.twig b/templates/parts/info/_main_infos.html.twig index 99c20126..7bcdd355 100644 --- a/templates/parts/info/_main_infos.html.twig +++ b/templates/parts/info/_main_infos.html.twig @@ -70,14 +70,15 @@ {% set min_order_amount = pricedetail_helper.minOrderAmount(part) %} {% set max_order_amount = pricedetail_helper.maxDiscountAmount(part) %} {% set max_order_price = pricedetail_helper.calculateAvgPrice(part, max_order_amount, app.user.currency ?? null) %} + {% set min_order_price = pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) %} {% if max_order_price is not null %}
{{ max_order_price | format_money(app.user.currency ?? null) }} - {% if min_order_amount < max_order_amount %} + {% if min_order_price is not null and min_order_amount < max_order_amount %} - - {{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | format_money(app.user.currency ?? null) }} + {% if max_order_price is not null %}{{ min_order_price | format_money(app.user.currency ?? null) }}{% else %}???{% endif %} {% endif %}