mandatory select delivery
This commit is contained in:
parent
3481fed915
commit
cf5462b901
@ -402,6 +402,9 @@ def cart_buy(request):
|
|||||||
if cp.quantity > cp.product.quantity:
|
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')
|
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(
|
invoice = Invoice(
|
||||||
user=user,
|
user=user,
|
||||||
address=cart.address,
|
address=cart.address,
|
||||||
@ -423,7 +426,7 @@ def cart_buy(request):
|
|||||||
total_price += cp.quantity * cp.product.price
|
total_price += cp.quantity * cp.product.price
|
||||||
ip.save()
|
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')
|
return HttpResponse('{"status": "failed", "reason": "Prosím přidejte svoje položky do košíku!"}', status=400, content_type='application/json')
|
||||||
|
|
||||||
payment_data = {
|
payment_data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user