From 27d9e73166e7a71b3fd24723f00328ea747c7632 Mon Sep 17 00:00:00 2001 From: Nathan Chapman Date: Mon, 20 Mar 2023 15:26:06 -0600 Subject: [PATCH] Capture correct subtotal amount when creating order --- dashboard/templates/dashboard/order/detail.html | 2 +- storefront/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/templates/dashboard/order/detail.html b/dashboard/templates/dashboard/order/detail.html index ff9cecd..4ae6747 100644 --- a/dashboard/templates/dashboard/order/detail.html +++ b/dashboard/templates/dashboard/order/detail.html @@ -110,7 +110,7 @@ {% if order.coupon_amount > 0 %} Discount {% if order.coupon %}{{ order.coupon }} ↗{% endif %}: - ${{ order.coupon_amount }} + -${{ order.coupon_amount }} {% endif %} diff --git a/storefront/views.py b/storefront/views.py index 78f2797..f8567b9 100644 --- a/storefront/views.py +++ b/storefront/views.py @@ -375,7 +375,7 @@ class OrderCreateView(CreateView): def form_valid(self, form): cart = Cart(self.request) - form.instance.subtotal_amount = cart.subtotal_price_after_discount + form.instance.subtotal_amount = cart.subtotal_price form.instance.coupon = cart.coupon form.instance.coupon_amount = cart.discount_amount form.instance.total_amount = cart.total_price