mandatory select delivery

This commit is contained in:
Martin Quarda 2024-10-14 15:27:30 +02:00
parent 3481fed915
commit cf5462b901

View File

@ -402,6 +402,9 @@ def cart_buy(request):
if cp.quantity > cp.product.quantity:
return HttpResponse('{"status": "failed", "reason": "Nemáme dostatek ' + cp.product.name + ' na skladě!"}', status=400, content_type='application/json')
if not cart.address:
return HttpResponse('{"status": "failed", "reason": "Je potřeba vybrat výběrní místo!"}', status=400, content_type='application/json')
invoice = Invoice(
user=user,
address=cart.address,
@ -423,7 +426,7 @@ def cart_buy(request):
total_price += cp.quantity * cp.product.price
ip.save()
if total_price <= 0:
if total_price <= 79:
return HttpResponse('{"status": "failed", "reason": "Prosím přidejte svoje položky do košíku!"}', status=400, content_type='application/json')
payment_data = {