Skip to content

Commit

Permalink
Further changes - deleted item in flyout cart
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Oct 8, 2018
1 parent 8ddd1de commit 148520b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Grand.Web/Controllers/ShoppingCartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ public virtual IActionResult DeleteCartItem(string id)

var model = _shoppingCartViewModelService.PrepareMiniShoppingCart();

return PartialView("Components/FlyoutShoppingCart/Default", model);
return Json(new
{
totalproducts = string.Format(_localizationService.GetResource("ShoppingCart.HeaderQuantity"), model.TotalProducts),
html = this.RenderPartialViewToString("Components/FlyoutShoppingCart/Default", model)
});

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
type: "POST",
url: href,
success: function (data) {
$('.fly-cart-container').html(data);
$(AjaxCart.flyoutcartselector).replaceWith(data.html);
$(AjaxCart.topcartselector).html(data.totalproducts);
},
error: function (xhr, ajaxOptions, thrownError) {
alert('Failed to retrieve Flyout Shopping Cart.');
Expand Down

0 comments on commit 148520b

Please sign in to comment.