Fix order limit on cart add
This commit is contained in:
parent
8281b774c1
commit
7a676de22d
@ -166,6 +166,9 @@ class Cart:
|
||||
elif item.quantity > item.variant.product.checkout_limit:
|
||||
messages.warning(self.request, 'Quantity exceeds checkout limit.')
|
||||
item.quantity = item.variant.product.checkout_limit
|
||||
elif item.quantity > item.variant.order_limit:
|
||||
messages.warning(self.request, 'Quantity exceeds order limit.')
|
||||
item.quantity = item.variant.order_limit
|
||||
|
||||
def check_max_cart_quantity(self):
|
||||
if len(self) > self.site_settings.max_cart_quantity:
|
||||
|
||||
@ -355,7 +355,6 @@ class OrderCreateView(CreateView):
|
||||
|
||||
cart = Cart(request)
|
||||
|
||||
|
||||
try:
|
||||
user = User.objects.get(
|
||||
email=request.session.get('shipping_address').get('email')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user