Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix displaying price range in product details page

Anna Siwik8f019ca50355
diff --git a/saleor/core/templatetags/taxed_prices.py b/saleor/core/templatetags/taxed_prices.py
index daf4cf06d4..384efdb399 100644
--- a/saleor/core/templatetags/taxed_prices.py
+++ b/saleor/core/templatetags/taxed_prices.py
@@ -8,10 +8,8 @@ register = template.Library()
@register.inclusion_tag('product/_price_range.html', takes_context=True)
def price_range(context, price_range):
- display_gross_prices = context['site'].settings.display_gross_prices
- return {
- 'price_range': price_range,
- 'display_gross_prices': display_gross_prices}
+ display_gross = context['site'].settings.display_gross_prices
+ return {'display_gross': display_gross, 'price_range': price_range}
@register.simple_tag
diff --git a/templates/product/_price_range.html b/templates/product/_price_range.html
index 2baeae1dd9..e21d98e208 100644
--- a/templates/product/_price_range.html
+++ b/templates/product/_price_range.html
@@ -4,7 +4,7 @@
<span>
<span>
{% if price_range.start != price_range.stop %}{% trans "from" context "product price range" %} {% endif %}
- {% if site.settings.display_gross_prices %}
+ {% if display_gross %}
{{ price_range.start.gross|amount:'html' }}
{% else %}
{{ price_range.start.net|amount:'html' }}