From b047bde390cf9217f8b058b8dad165f1a7137fdc Mon Sep 17 00:00:00 2001
From: Nathan Chapman
Date: Sat, 19 Nov 2022 09:56:21 -0700
Subject: [PATCH] Suspend free shipping for now
---
src/storefront/cart.py | 12 ++++++------
src/storefront/templates/storefront/cart_detail.html | 4 ----
src/storefront/templates/storefront/order_form.html | 4 ----
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/src/storefront/cart.py b/src/storefront/cart.py
index af3d7fb..9e9bdf9 100644
--- a/src/storefront/cart.py
+++ b/src/storefront/cart.py
@@ -64,7 +64,7 @@ class Cart:
def __init__(self, request):
self.request = request
self.session = request.session
- self.site_settings = SiteSettings.load()
+ # self.site_settings = SiteSettings.load()
self.coupon_code = self.session.get('coupon_code')
cart = self.session.get(settings.CART_SESSION_ID)
if not cart:
@@ -178,11 +178,11 @@ class Cart:
return containers
def get_shipping_cost(self, container=None):
- free_shipping_min = self.site_settings.free_shipping_min
- if free_shipping_min is not None:
- category = ProductCategory.objects.get(name='Coffee')
- if self.get_total_price_for_category(category) >= free_shipping_min:
- return Decimal('0.00')
+ # free_shipping_min = self.site_settings.free_shipping_min
+ # if free_shipping_min is not None:
+ # category = ProductCategory.objects.get(name='Coffee')
+ # if self.get_total_price_for_category(category) >= free_shipping_min:
+ # return Decimal('0.00')
if container is None:
container = self.session.get('shipping_container').container
diff --git a/src/storefront/templates/storefront/cart_detail.html b/src/storefront/templates/storefront/cart_detail.html
index 1a72f87..e2be281 100644
--- a/src/storefront/templates/storefront/cart_detail.html
+++ b/src/storefront/templates/storefront/cart_detail.html
@@ -58,10 +58,6 @@
-
- Free shipping on coffee orders over ${{ site_settings.free_shipping_min|floatformat:"2" }}
- Merch does not count toward total
-
diff --git a/src/storefront/templates/storefront/order_form.html b/src/storefront/templates/storefront/order_form.html
index 9447aa8..03d8c0e 100644
--- a/src/storefront/templates/storefront/order_form.html
+++ b/src/storefront/templates/storefront/order_form.html
@@ -65,10 +65,6 @@
{% csrf_token %}
{{form.as_p}}
-
- Free shipping on coffee orders over ${{ site_settings.free_shipping_min|floatformat:"2" }}
- Merchandise does not count toward total
-