Removed console.log debug statements
This commit is contained in:
parent
db06ec4504
commit
aeef56e663
1 changed files with 26 additions and 23 deletions
|
|
@ -28,31 +28,34 @@ async function loadProducts() {
|
||||||
barcodeForm.addEventListener("submit", (e) => {
|
barcodeForm.addEventListener("submit", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const barcode = document.getElementById('barcode_input').value
|
if (to_fill_product_index < 5) {
|
||||||
var chosen_product
|
|
||||||
for (index = 0; index < all_products.length; index++) {
|
const barcode = document.getElementById('barcode_input').value
|
||||||
if (all_products[index].barcode == barcode) {
|
var chosen_product
|
||||||
chosen_product = all_products[index]
|
for (index = 0; index < all_products.length; index++) {
|
||||||
|
if (all_products[index].barcode == barcode) {
|
||||||
|
chosen_product = all_products[index]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
barcode_input.value = ""
|
||||||
|
|
||||||
|
const product_placeholders = document.getElementsByClassName('product_col')
|
||||||
|
const chosen_product_placeholder = product_placeholders[to_fill_product_index]
|
||||||
|
const image_product = chosen_product_placeholder.getElementsByClassName('product_image')[0]
|
||||||
|
const price_product = chosen_product_placeholder.getElementsByClassName('product_price')[0]
|
||||||
|
const total_price_holder = document.getElementById("totalprice")
|
||||||
|
|
||||||
|
total_price += chosen_product.price
|
||||||
|
|
||||||
|
image_product.setAttribute('src', api_url + "/icons/" + chosen_product.image_filename);
|
||||||
|
price_product.textContent = "\u20AC " + chosen_product.price
|
||||||
|
total_price_holder.textContent = "\u20AC " + total_price
|
||||||
|
|
||||||
|
to_fill_product_index += 1
|
||||||
|
}else{
|
||||||
|
barcode_input.value = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
barcode_input.value = ""
|
|
||||||
|
|
||||||
const product_placeholders = document.getElementsByClassName('product_col')
|
|
||||||
const chosen_product_placeholder = product_placeholders[to_fill_product_index]
|
|
||||||
const image_product = chosen_product_placeholder.getElementsByClassName('product_image')[0]
|
|
||||||
const price_product = chosen_product_placeholder.getElementsByClassName('product_price')[0]
|
|
||||||
const total_price_holder = document.getElementById("totalprice")
|
|
||||||
|
|
||||||
total_price += chosen_product.price
|
|
||||||
|
|
||||||
console.log(image_product)
|
|
||||||
|
|
||||||
image_product.setAttribute('src', api_url + "/icons/" + chosen_product.image_filename);
|
|
||||||
price_product.textContent = "\u20AC " + chosen_product.price
|
|
||||||
total_price_holder.textContent = "\u20AC " + total_price
|
|
||||||
|
|
||||||
to_fill_product_index += 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue