Django template: show price normally, or show discount price with original price struck through below
I’m building a product card in a Django template. I want this behavior:
If
discount_priceis0, show onlyprice.If
discount_priceis not0, showdiscount_priceon top and the originalpricebelow it with a strike-through.
Here is my current template
<div class="flex flex-col">
{% if products.discount_price == 00.00 %}
<span class="font-bold">GH₵{{products.price}}</span>
{% else %}
<span class="line-through">GH₵{{products.discount_price}}</span>
{% endif %}
</div>