modularizated scripts

This commit is contained in:
2021-11-18 14:40:40 -03:00
parent ea76370282
commit b7e95b8d96
9 changed files with 377 additions and 335 deletions

18
scripts/totalLogica.js Normal file
View File

@@ -0,0 +1,18 @@
const registrarCambiosEnElTotal = (checkout) => {
const total = document.getElementById('precio')
let totalSumado = 0
console.log(checkout)
for (const i in checkout) {
const product = checkout[i];
totalSumado = totalSumado + product.precioAcumulado
}
total.innerText = totalSumado
}
export default registrarCambiosEnElTotal