Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions shop/templates/shop/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ <h2>Step 2 - Enter Address & Other Details:</h2>
document.getElementById('cart').innerHTML = sum;
document.getElementById('totalPrice').innerHTML = totalPrice;
$('#itemsJson').val(JSON.stringify(cart));
{% if thank %}
alert('Thanks for ordering with us. Your order is is {{id}}. Use it to track your order using our order tracker');
localStorage.clear();
document.location = "/shop";
{% endif %}
$('#amount').val($('#totalPrice').html())
</script>
{% endblock %}
{% endblock %}
7 changes: 3 additions & 4 deletions shop/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def checkout(request):
order.save()
update = OrderUpdate(order_id=order.order_id, update_desc="The order has been placed")
update.save()
thank = True
id = order.order_id
# return render(request, 'shop/checkout.html', {'thank':thank, 'id': id})
# Request paytm to transfer the amount to your account after payment by user
param_dict = {
Expand Down Expand Up @@ -142,7 +140,8 @@ def handlerequest(request):
verify = Checksum.verify_checksum(response_dict, MERCHANT_KEY, checksum)
if verify:
if response_dict['RESPCODE'] == '01':
print('order successful')
thank= True
return render(request, 'shop/paymentstatus.html', {'response': response_dict, 'thank':thank})
else:
print('order was not successful because' + response_dict['RESPMSG'])
return render(request, 'shop/paymentstatus.html', {'response': response_dict})
return render(request, 'shop/paymentstatus.html', {'response': response_dict})