{% extends 'base.html' %} {% block content %}

My Purchase History

Track and manage your online orders

{% if orders %}
{% for order in orders %}
ORDER ID {{ order.id }}
DATE PLACED {{ order.date.strftime('%d %b, %Y') if order.date else 'N/A' }}
TOTAL AMOUNT {{ currency }} {{ "{:,.0f}".format(order.final_total) }} {% if order.discount and order.discount > 0 %}
Discount: -{{ currency }} {{ "{:,.0f}".format(order.discount) }} {% endif %}
{% if order.status == 'Online_Pending' %} Pending {% elif order.status == 'Dispatched' %} On the Way {% elif order.status == 'Completed' %} Delivered {% else %} {{ order.status }} {% endif %}
{% if order.sms_status %}
SMS: {% if order.sms_status == 'Placed_Sent' %} Placed ✅ {% elif order.sms_status == 'Approved_Sent' %} Approved ✅ {% elif 'Error' in order.sms_status %} Error ❌ {% else %} None {% endif %}
{% endif %}
Order Items:
{% for item in order.items %}
{{ item.product_name }} × {{ item.quantity }}
{{ currency }} {{ "{:,.0f}".format(item.price * item.quantity) }} {% if order.status == 'Completed' and prod_map and item.product_name in prod_map %} {% endif %}
{% endfor %}
{% endfor %}
{% else %}
No Orders

No orders found!

Looks like you haven't ordered anything yet.

Start Shopping
{% endif %}
{% endblock %}