Commit 4d4a8e16 authored by arung-agamani's avatar arung-agamani
Browse files

Added buy limiting

parent e8a75c30
......@@ -43,6 +43,11 @@ function getParam(param) {
function confirmOrder() {
var formData = new FormData()
var amount = parseInt(document.getElementById('order-amount').innerText);
var remain = parseInt(document.getElementById('item-remaining').innerText);
if (amount > remain) {
alert('Jumlah yang anda beli melebihi stok!')
return;
}
var address = document.getElementById('order-address').value;
var coklatId = getParam('id');
console.log(coklatId);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment