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
18 lines
389 B
JavaScript
18 lines
389 B
JavaScript
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 |