|
|
@@ -344,7 +344,7 @@ class Merchant{
|
|
|
getIngredient(id){
|
|
|
for(let i = 0; i < this._ingredients.length; i++){
|
|
|
if(this._ingredients[i].ingredient.id === id){
|
|
|
- return this._ingredients[i].ingredient;
|
|
|
+ return this._ingredients[i];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -3158,8 +3158,12 @@ let orderDetails = {
|
|
|
|
|
|
ingredientDiv.children[0].innerText = order.ingredients[i].ingredient.name;
|
|
|
ingredientDiv.children[2].innerText = `$${order.ingredients[i].cost().toFixed(2)}`;
|
|
|
+ ingredientDiv.onclick = ()=>{
|
|
|
+ controller.openStrand("ingredients");
|
|
|
+ controller.openSidebar("ingredientDetails", merchant.getIngredient(order.ingredients[i].ingredient.id));
|
|
|
+ }
|
|
|
|
|
|
- const ingredientDisplay = ingredientDiv.children[1];
|
|
|
+ let ingredientDisplay = ingredientDiv.children[1];
|
|
|
if(ingredient.specialUnit === "bottle"){
|
|
|
ingredientDisplay.innerText = `${order.ingredients[i].quantity.toFixed(2)} bottles x $${order.ingredients.pricePerUnit.toFixed(2)}`;
|
|
|
}else{
|