Skip to content

Commit 4c6bd12

Browse files
Closes #470 The off-canvas cart does not show the tier price (instead of the unit price) when the quantity changes
1 parent 25524d7 commit 4c6bd12

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Presentation/SmartStore.Web/Controllers/ShoppingCartController.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,6 +2289,7 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa
22892289

22902290
var cartHtml = string.Empty;
22912291
var totalsHtml = string.Empty;
2292+
var newItemPrice = string.Empty;
22922293

22932294
if (isCartPage)
22942295
{
@@ -2306,6 +2307,9 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa
23062307
PrepareShoppingCartModel(model, cart);
23072308
cartHtml = this.RenderPartialViewToString("CartItems", model);
23082309
totalsHtml = this.InvokeAction("OrderTotals", routeValues: new RouteValueDictionary(new { isEditable = true })).ToString();
2310+
2311+
var sci = model.Items.Where(x => x.Id == sciItemId).FirstOrDefault();
2312+
newItemPrice = sci.UnitPrice;
23092313
}
23102314
}
23112315

@@ -2316,7 +2320,8 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa
23162320
message = warnings,
23172321
cartHtml,
23182322
totalsHtml,
2319-
displayCheckoutButtons = true
2323+
displayCheckoutButtons = true,
2324+
newItemPrice
23202325
});
23212326
}
23222327

src/Presentation/SmartStore.Web/Scripts/public.offcanvas-cart.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ $(function () {
203203
var type = el.data("type");
204204
ShopBar.loadSummary(type, true);
205205
el.closest('.tab-pane').find('.sub-total').html(data.SubTotal);
206+
if (data.newItemPrice != "") {
207+
el.closest(".offcanvas-cart-item").find(".unit-price").html(data.newItemPrice);
208+
}
206209
}
207210
else {
208211
$(data.message).each(function (index, value) {

0 commit comments

Comments
 (0)