summaryrefslogtreecommitdiff
path: root/saleor/product/templatetags/discount.py
blob: 33359da5915a3fe96f70e490ef33974869aef2d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django import template

register = template.Library()


@register.filter
def discounted_price(item, discounts):
    return item.get_price(discounts=discounts)


@register.filter
def discounted_price_range(item, discounts):
    return item.get_price_range(discounts=discounts)


@register.filter
def price_difference(price1, price2):
    return price1 - price2