mirror of
https://github.com/FranP-code/API-and-CRUD-for-Ecommerce-with-Node.js-FRONTEND.git
synced 2025-10-12 23:52:33 +00:00
Añadidos mas productos y arreglados bugs menores
This commit is contained in:
BIN
img/Asado.jpg
Normal file
BIN
img/Asado.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 343 KiB |
BIN
img/Medialunas dulces.jpg
Normal file
BIN
img/Medialunas dulces.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 237 KiB |
BIN
img/Papas fritas congeladas.jpg
Normal file
BIN
img/Papas fritas congeladas.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
@@ -103,6 +103,8 @@ childrenNavbar.forEach(children => {
|
|||||||
|
|
||||||
children.addEventListener('click', () => {
|
children.addEventListener('click', () => {
|
||||||
|
|
||||||
|
globalProductos = []
|
||||||
|
|
||||||
activeCategory = children.innerText
|
activeCategory = children.innerText
|
||||||
makeThisCategoryActive()
|
makeThisCategoryActive()
|
||||||
definirProductos()
|
definirProductos()
|
||||||
@@ -214,7 +216,6 @@ const enviarProductoAlCheckout = (nombreProducto) => {
|
|||||||
const plusButton = buttons.children[1]
|
const plusButton = buttons.children[1]
|
||||||
|
|
||||||
plusButton.addEventListener('click', () => {
|
plusButton.addEventListener('click', () => {
|
||||||
|
|
||||||
|
|
||||||
checkout[`${nombreProducto}`].quantity++
|
checkout[`${nombreProducto}`].quantity++
|
||||||
|
|
||||||
@@ -265,6 +266,9 @@ const enviarProductoAlCheckout = (nombreProducto) => {
|
|||||||
|
|
||||||
delete checkout[`${nombreProducto}`]
|
delete checkout[`${nombreProducto}`]
|
||||||
console.log(checkout)
|
console.log(checkout)
|
||||||
|
|
||||||
|
registrarCambiosEnElTotal()
|
||||||
|
checkearCantidadDeElementos()
|
||||||
})
|
})
|
||||||
console.log(recentlyDocumentAdded)
|
console.log(recentlyDocumentAdded)
|
||||||
}
|
}
|
||||||
@@ -298,17 +302,25 @@ const registrarCambiosEnElTotal = () => {
|
|||||||
|
|
||||||
const checkearCantidadDeElementos = () => {
|
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) {
|
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'
|
checkout.style.height = 'auto'
|
||||||
table.style.height = 'auto'
|
table.style.height = 'auto'
|
||||||
tableContainer.style.height = 'auto'
|
tableContainer.style.height = 'auto'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
|
checkout.style.height = '62vh'
|
||||||
|
table.style.height = 'auto'
|
||||||
|
tableContainer.style.height = '50vh'
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Pagar Logica
|
//! Pagar Logica
|
||||||
|
|||||||
@@ -49,6 +49,29 @@ const traerProductosDeAPI = async () => {
|
|||||||
price: 3.5,
|
price: 3.5,
|
||||||
img: './img/postobon-pina.jpg',
|
img: './img/postobon-pina.jpg',
|
||||||
category: 'bebidas'
|
category: 'bebidas'
|
||||||
|
},
|
||||||
|
|
||||||
|
product8: {
|
||||||
|
name: 'Asado',
|
||||||
|
price: 15,
|
||||||
|
img: './img/Asado.jpg',
|
||||||
|
category: 'comidas'
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
product9: {
|
||||||
|
name: "Medialunas Dulces",
|
||||||
|
price: 2,
|
||||||
|
img: './img/Medialunas dulces.jpg',
|
||||||
|
category: 'REPOSTERÍA Y PANADERÍA'
|
||||||
|
},
|
||||||
|
|
||||||
|
product10: {
|
||||||
|
|
||||||
|
name: 'Papas fritas congeladas',
|
||||||
|
price: 5,
|
||||||
|
img: './img/Papas fritas congeladas.jpg',
|
||||||
|
category: 'refrigerados'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user