Skip to content

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

Remove unused taxed_prices template tag (#19717)

Lukasz Ostrowskibd04b32aa2aa
diff --git a/saleor/core/templatetags/__init__.py b/saleor/core/templatetags/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/saleor/core/templatetags/taxed_prices.py b/saleor/core/templatetags/taxed_prices.py
deleted file mode 100644
index b5d0805b0f..0000000000
--- a/saleor/core/templatetags/taxed_prices.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from django import template
-from prices import Money, MoneyRange, TaxedMoney, TaxedMoneyRange
-
-register = template.Library()
-
-
-def _get_display_price(
- base: TaxedMoney | TaxedMoneyRange, display_gross: bool
-) -> Money:
- """Return the price amount that should be displayed based on settings."""
- if isinstance(base, TaxedMoneyRange):
- if display_gross:
- base = MoneyRange(start=base.start.gross, stop=base.stop.gross)
- else:
- base = MoneyRange(start=base.start.net, stop=base.stop.net)
-
- if isinstance(base, TaxedMoney):
- base = base.gross if display_gross else base.net
- return base
-
-
[email protected]_tag("price.html")
-def price(base, display_gross, html=True):
- if isinstance(base, TaxedMoney | TaxedMoneyRange):
- base = _get_display_price(base, display_gross)
-
- is_range = isinstance(base, MoneyRange)
- return {"price": base, "is_range": is_range, "html": html}
diff --git a/templates/price.html b/templates/price.html
deleted file mode 100644
index 72bd284a21..0000000000
--- a/templates/price.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{% load prices %}{% spaceless %}
- {% if is_range %}
- {% if price.start == price.stop %}
- {% if html %}
- {{ price.start|amount:'html' }}
- {% else %}
- {{ price.start|amount }}
- {% endif %}
- {% else %}
- {% if html %}
- {{ price.start|amount:'html' }} - {{ price.stop|amount:'html' }}
- {% else %}
- {{ price.start|amount }} - {{ price.stop|amount }}
- {% endif %}
- {% endif %}
- {% else %}
- {% if html %}
- {{ price|amount:'html' }}
- {% else %}
- {{ price|amount }}
- {% endif %}
- {% endif %}
-{% endspaceless %}