Y
Y
Yura Khlyan2015-10-30 13:17:26
Django
Yura Khlyan, 2015-10-30 13:17:26

Display price for multiple items (Django/Django-Oscar). How to implement?

Good day.
I came across the following problem. I need to show on the product page not only the price of a unit of goods, but also the price for 5 and 10 products (let's say). Someone can help?
This is how I display the unit price:

{% purchase_info_for_product request product as session %}


{% if session.price.exists %}
    {% if session.price.excl_tax == 0 %}
        <p class="price_color">{% trans "Free" %}</p>
    {% elif session.price.is_tax_known %}
        <p class="price_color">{{ session.price.incl_tax|currency:session.price.currency }}</p>
       ....

The last line just shows the currency + price.
I'm using Django 1.8 and Django-Oscar 1.2. I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2015-10-30
@MAGistr_MTM

Write your own template filter for multiplication or use the ready one ( https://github.com/dbrgn/django-mathfilters).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question