Skip to content

Commit

Permalink
Further improvements for "Allow on hold cart"
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Mar 26, 2020
1 parent 747bb7f commit a432545
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Grand.Web/Views/Product/_AddToCart.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@model ProductDetailsModel.AddToCartModel
@{
var shoppingCartType = Model.UpdateShoppingCartItemType.HasValue ? Model.UpdateShoppingCartItemType.Value : ShoppingCartType.ShoppingCart;
}
@if (!String.IsNullOrEmpty(Model.UpdatedShoppingCartItemId))
{
<input asp-for="UpdatedShoppingCartItemId" type="hidden" />
Expand Down Expand Up @@ -52,7 +55,7 @@
}
{
var addToCartText = "";
if (!String.IsNullOrEmpty(Model.UpdatedShoppingCartItemId) && Model.UpdateShoppingCartItemType.HasValue && Model.UpdateShoppingCartItemType.Value == ShoppingCartType.ShoppingCart)
if (!String.IsNullOrEmpty(Model.UpdatedShoppingCartItemId) && Model.UpdateShoppingCartItemType.HasValue && (Model.UpdateShoppingCartItemType.Value == ShoppingCartType.ShoppingCart || Model.UpdateShoppingCartItemType.Value == ShoppingCartType.OnHoldCart))
{
addToCartText = T("ShoppingCart.AddToCart.Update").Text;
}
Expand Down Expand Up @@ -90,7 +93,7 @@
});
});
</script>
<button type="button" id="[email protected]" class="btn btn-info add-to-cart-button d-inline-flex" data-productid="@Model.ProductId" onclick="AjaxCart.addproducttocart_details('@Url.RouteUrl("AddProductToCart-Details", new { productId = Model.ProductId, shoppingCartTypeId = (int)ShoppingCartType.ShoppingCart })', '#product-details-form');return false;">
<button type="button" id="[email protected]" class="btn btn-info add-to-cart-button d-inline-flex" data-productid="@Model.ProductId" onclick="AjaxCart.addproducttocart_details('@Url.RouteUrl("AddProductToCart-Details", new { productId = Model.ProductId, shoppingCartTypeId = (int)shoppingCartType })', '#product-details-form');return false;">
<span>@addToCartText</span>
</button>
}
Expand Down
4 changes: 2 additions & 2 deletions Grand.Web/Views/Shared/_PopupAddToCart.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="modal-content rounded-0 p-2 p-xl-3">
<div class="modal-header bg-info rounded-0">
<h5 class="text-center text-white w-100 mb-0">
@if (Model.CartType == ShoppingCartType.ShoppingCart)
@if (Model.CartType == ShoppingCartType.ShoppingCart || Model.CartType == ShoppingCartType.OnHoldCart)
{
@T("AddToCart.ShoppingCart")
}
Expand Down Expand Up @@ -151,7 +151,7 @@
{
<button type="button" class="btn btn-outline-info w-100 text-uppercase mr-1 d-flex justify-content-center" data-dismiss="modal">@T("AddToCart.Continue")</button>
}
@if (Model.CartType == ShoppingCartType.ShoppingCart)
@if (Model.CartType == ShoppingCartType.ShoppingCart || Model.CartType == ShoppingCartType.OnHoldCart)
{
<button type="button" class="btn btn-info w-100 d-flex justify-content-center text-uppercase ml-0 border-left-0" onclick="setLocation('@(Url.RouteUrl("ShoppingCart"))')">@T("AddToCart.ViewCart")</button>
}
Expand Down

0 comments on commit a432545

Please sign in to comment.