Skip to content

Commit

Permalink
default order Section
Browse files Browse the repository at this point in the history
  • Loading branch information
Lescano713 committed Sep 2, 2024
1 parent 9d6d185 commit a687242
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,14 @@ function addToArray(product){
if (!findId(product.id)) {
productsInCart.push(product);
product.quantity = 1;
}else if(product.quantity === 0){
}else if(product.quantity < 1){
removeProduct(product.id)
}

uploadingCart(productsInCart)
if (productsInCart.length < 1) {
restore()
}else{
uploadingCart(productsInCart)
}
// console.log(productsInCart)
}

Expand Down Expand Up @@ -279,6 +282,13 @@ function targetProduct(id,img){
}
}

function restore(){
const orderSection = document.querySelector('.order-section');
orderSection.style.background = "url('./assets/images/illustration-empty-cart.svg') no-repeat center";
ordersContainer.innerHTML = `
<p class="default-text" >Your added items will apper here</p>`
}

// function dependingButton(product){
// if(!findId(product.id))
// }

0 comments on commit a687242

Please sign in to comment.