Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hagerElroby committed Jan 14, 2024
2 parents 87e39bf + c4b2554 commit f72a158
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ drawProductsUi(JSON.parse(localStorage.getItem("products")) || products);

function addedToCart(id){
if(localStorage.getItem("username")){
<<<<<<< HEAD
=======
// let products = JSON.parse(localStorage.getItem("products")) || products ;
>>>>>>> c4b25544a0c0c9b51531c2dd686569e59834576c
let products = JSON.parse(localStorage.getItem("products")) || productsDB ;
let product = products.find( (item) => item.id === id);
let isProductInCart = addedItem.some((i) => i.id === product.id);
Expand Down Expand Up @@ -201,4 +205,4 @@ function getProductsFilteredBySize(e){
function editProduct(id){
localStorage.setItem("editProduct" , id);
window.location = "editProduct.html"
}
}

0 comments on commit f72a158

Please sign in to comment.