From 0b16fd7697c4f55e3d4438a482c8b631c425c1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Wed, 8 Apr 2020 16:10:35 +0200 Subject: [PATCH] Hide average price row, if we dont have info about it. --- templates/Parts/info/_main_infos.html.twig | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/templates/Parts/info/_main_infos.html.twig b/templates/Parts/info/_main_infos.html.twig index a3f2266a..a8abe1d3 100644 --- a/templates/Parts/info/_main_infos.html.twig +++ b/templates/Parts/info/_main_infos.html.twig @@ -45,24 +45,22 @@ {{ helper.structural_entity_link(part.footprint) }} -
- - - {% 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) %} - - {% if max_order_price is not null %} + {% 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) %} + {% if max_order_price is not null %} +
+ + {{ max_order_price | moneyFormat(app.user.currency ?? null) }} {% if min_order_amount < max_order_amount %} - - - {{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | moneyFormat(app.user.currency ?? null) }} - {% endif %} - {% endif %} - + - + {{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | moneyFormat(app.user.currency ?? null) }} + {% endif %} -
+
+ {% endif %} {# {% if part.comment != "" %}