price check and display flex
This commit is contained in:
parent
1c4ab9527e
commit
88b3f25afe
@ -388,7 +388,7 @@ def cart_buy(request):
|
||||
|
||||
for cp in cart_products:
|
||||
if cp.quantity > cp.product.quantity:
|
||||
return HttpResponse('{"status": "failed", "reason": "Nemáme dostatek ' + cp.product.name + ' na skladě!"}', status=400)
|
||||
return HttpResponse('{"status": "failed", "reason": "Nemáme dostatek ' + cp.product.name + ' na skladě!"}', status=400, content_type='application/json')
|
||||
|
||||
invoice = Invoice(
|
||||
user=user,
|
||||
@ -411,6 +411,9 @@ def cart_buy(request):
|
||||
total_price += cp.quantity * cp.product.price
|
||||
ip.save()
|
||||
|
||||
if total_price <= 0:
|
||||
return HttpResponse('{"status": "failed", "reason": "Prosím přidejte svoje položky do košíku!"}', status=400, content_type='application/json')
|
||||
|
||||
payment_data = {
|
||||
'merchant': COMGATE_MERCHANT,
|
||||
'test': 'true' if COMGATE_TEST else 'false',
|
||||
|
@ -344,7 +344,7 @@ class Main extends Component {
|
||||
</table>
|
||||
</div>}
|
||||
{this.state.page == "#eshop" &&
|
||||
<div class="container">
|
||||
<div class="container" style={{display: "flex"}}>
|
||||
{this.state.products.map(product =>
|
||||
<div class="card" style={{width: "18rem"}}>
|
||||
<img src={product.img} class="card-img-top" alt="..." />
|
||||
|
Loading…
x
Reference in New Issue
Block a user