Skip to content

Commit

Permalink
Merge pull request #2 from Lescano713/newBranch
Browse files Browse the repository at this point in the history
New branch
  • Loading branch information
Lescano713 authored Aug 18, 2024
2 parents 177cef0 + c5ee7de commit cb40cdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>Order Confirmed</h1>
</header>
<footer id="products-confirmed">
</footer>
<button type="button">Start New Order</button>
<button type="button" id="new-order">Start New Order</button>
</main>
</section>
</main>
Expand Down
19 changes: 14 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function orderTotal(totalAmount){
const h4 = document.createElement('h4');
h4.textContent = `$${totalAmount}`
const button = document.createElement('button');
button.addEventListener('click', e => showMessage())
button.textContent = "Confirm Order";

divDelivery.append(imgDelivery,pDelivery);
Expand All @@ -147,19 +148,19 @@ function findId(id){
function buttonAddRemove(button,name,cost,id){
// orderTotal(2)
button.innerHTML = "";
// let amount = 0;
let amount = 0;

// if(findId(id)){
// amount = findId(id).pQuantity;
// }
if(findId(id)){
amount = findId(id).pQuantity;
}
button.classList.add('buttonAdd');
const iconPlus = document.createElement('img');
iconPlus.src = icons.incrementQuantity;
const iconMinus = document.createElement('img');
iconMinus.src = icons.decrementQuantity;

const p = document.createElement('p');
p.textContent = 0;
p.textContent = amount;

iconPlus.addEventListener('click', () =>{
getObjects(name,cost,id);
Expand All @@ -183,10 +184,18 @@ function removeProduct(id){
if (findId(id) && !productsInCart.length < 1) {
productsInCart.splice(findId(id), 1);
uploadingCart(productsInCart);
// takeOffProducts(id)
orderTotal(2)
} else {
console.log("no")
document.querySelector('section.order-section').style.background = "flex";

}
}

function showMessage(){
const sectionMessage = document.querySelector('.order-confirmed-section');

sectionMessage.style.display = "block"
console.log("non")
}

0 comments on commit cb40cdf

Please sign in to comment.