Añadidos mas productos y arreglados bugs menores

This commit is contained in:
2021-11-09 23:09:51 -03:00
parent 42d820a7a3
commit 8e59499f0c
5 changed files with 40 additions and 5 deletions

View File

@@ -103,6 +103,8 @@ childrenNavbar.forEach(children => {
children.addEventListener('click', () => {
globalProductos = []
activeCategory = children.innerText
makeThisCategoryActive()
definirProductos()
@@ -214,7 +216,6 @@ const enviarProductoAlCheckout = (nombreProducto) => {
const plusButton = buttons.children[1]
plusButton.addEventListener('click', () => {
checkout[`${nombreProducto}`].quantity++
@@ -265,6 +266,9 @@ const enviarProductoAlCheckout = (nombreProducto) => {
delete checkout[`${nombreProducto}`]
console.log(checkout)
registrarCambiosEnElTotal()
checkearCantidadDeElementos()
})
console.log(recentlyDocumentAdded)
}
@@ -298,17 +302,25 @@ const registrarCambiosEnElTotal = () => {
const checkearCantidadDeElementos = () => {
const checkout = document.getElementsByClassName('checkout')[0]
const table = document.getElementById('products-display-checkout')
const tableContainer = table.parentElement
if (document.querySelector('#products-display-checkout tbody').children.length > 5) {
const checkout = document.getElementsByClassName('checkout')[0]
const table = document.getElementById('products-display-checkout')
const tableContainer = table.parentElement
checkout.style.height = 'auto'
table.style.height = 'auto'
tableContainer.style.height = 'auto'
}
else {
checkout.style.height = '62vh'
table.style.height = 'auto'
tableContainer.style.height = '50vh'
}
}
//! Pagar Logica