Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +4 -3
templates/cart.html
CHANGED
@@ -138,7 +138,7 @@
|
|
138 |
</div>
|
139 |
</div>
|
140 |
<div class="cart-item-actions">
|
141 |
-
<div class="text-primary">${{ item.Price__c }}</div>
|
142 |
<button class="btn btn-danger btn-sm" onclick="removeItemFromCart('{{ item.Name }}')">Remove</button>
|
143 |
</div>
|
144 |
</div>
|
@@ -221,8 +221,9 @@
|
|
221 |
let subtotal = 0;
|
222 |
document.querySelectorAll('.cart-item').forEach(item => {
|
223 |
const quantity = parseInt(item.querySelector('input').value);
|
224 |
-
const
|
225 |
-
|
|
|
226 |
});
|
227 |
return subtotal;
|
228 |
}
|
|
|
138 |
</div>
|
139 |
</div>
|
140 |
<div class="cart-item-actions">
|
141 |
+
<div class="text-primary">${{ item.Price__c + item.Add_Ons_Price__c }}</div>
|
142 |
<button class="btn btn-danger btn-sm" onclick="removeItemFromCart('{{ item.Name }}')">Remove</button>
|
143 |
</div>
|
144 |
</div>
|
|
|
221 |
let subtotal = 0;
|
222 |
document.querySelectorAll('.cart-item').forEach(item => {
|
223 |
const quantity = parseInt(item.querySelector('input').value);
|
224 |
+
const basePrice = parseFloat(item.querySelector('.base-price').innerText.replace('$', '')); // Base Price (Price__c)
|
225 |
+
const addonsPrice = parseFloat(item.querySelector('.addons-price').innerText.replace('$', '')) || 0; // Add-ons Price (Add_Ons_Price__c)
|
226 |
+
subtotal += (basePrice * quantity) + addonsPrice;
|
227 |
});
|
228 |
return subtotal;
|
229 |
}
|