Skip to content

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

Optimized templatetags usage

Artur Smętb42499164fd4
diff --git a/saleor/product/templates/category/index.html b/saleor/product/templates/category/index.html
index 658c4c3970..dbf8bac30d 100644
--- a/saleor/product/templates/category/index.html
+++ b/saleor/product/templates/category/index.html
@@ -3,7 +3,7 @@
{% load at_size from images %}
{% load slice from shop %}
{% load price_range from price_ranges %}
-{% load undiscounted_price undiscounted_price_range price_difference from discount %}
+{% load undiscounted_price_range price_difference from discount %}
@@ -21,14 +21,14 @@
{% for product in row %}
<div class="col-sm-6">
{% with price=product.get_price_range.min_price undiscounted=product|undiscounted_price_range %}
- {% with discount=undiscounted.min_price|price_difference:price %}
- <h3><a href="{{ product.get_absolute_url }}">{{ product }}</a>
- {% if undiscounted.min_price != price %}
- <span class="label label-success">{% trans "Discount!" %}</span>
- </h3>
- {% endif %}
- <h4>{% price_range product %}</h4>
- {% endwith %}
+ {% with discount=undiscounted.min_price|price_difference:price %}
+ <h3><a href="{{ product.get_absolute_url }}">{{ product }}</a>
+ {% if undiscounted.min_price != price %}
+ <span class="label label-success">{% trans "Discount!" %}</span>
+ </h3>
+ {% endif %}
+ <h4>{% price_range product %}</h4>
+ {% endwith %}
{% endwith %}
diff --git a/saleor/product/templates/product/_price_range.html b/saleor/product/templates/product/_price_range.html
index 4027177988..a11a8ca92b 100644
--- a/saleor/product/templates/product/_price_range.html
+++ b/saleor/product/templates/product/_price_range.html
@@ -4,6 +4,5 @@
{% else %}
{% trans "Starting from" %}
{{ price_range.min_price.gross|floatformat:2 }}
- {% trans "to" %} {{ price_range.max_price.gross|floatformat:2 }}
{{ price_range.min_price.currency }}
{% endif %}
\ No newline at end of file