Skip to content

Commit aaa15c5

Browse files
committed
New shopping cart setting ShowItemsFromWishlistToCartButton
1 parent 9141322 commit aaa15c5

5 files changed

Lines changed: 23 additions & 13 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* #625 Bundles can be ordered if an attribute combination of a bundle item is not available
2929
* Minor UI tweaks in checkout process
3030
* #666 Export addresses in customer export
31+
* New shopping cart setting ShowItemsFromWishlistToCartButton
3132

3233
### Bugfixes
3334
* Instant search box did not display all results when SQL Fulltext Search was enabled

src/Libraries/SmartStore.Core/Domain/Orders/ShoppingCartSettings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public ShoppingCartSettings()
99
MaximumShoppingCartItems = 1000;
1010
MaximumWishlistItems = 1000;
1111
MoveItemsFromWishlistToCart = true;
12+
ShowItemsFromWishlistToCartButton = true;
1213
ShowProductImagesOnShoppingCart = true;
1314
ShowProductBundleImagesOnShoppingCart = true;
1415
ShowProductImagesOnWishList = true;
@@ -25,7 +26,6 @@ public ShoppingCartSettings()
2526
ShowBasePrice = true;
2627
ShowDeliveryTimes = true;
2728
ShowShortDesc = true;
28-
2929
}
3030

3131
/// <summary>
@@ -58,6 +58,11 @@ public ShoppingCartSettings()
5858
/// </summary>
5959
public bool MoveItemsFromWishlistToCart { get; set; }
6060

61+
/// <summary>
62+
/// Gets or sets a value indicating whether to show the items from wishlist to ahopping cart button.
63+
/// </summary>
64+
public bool ShowItemsFromWishlistToCartButton { get; set; }
65+
6166
/// <summary>
6267
/// Gets or sets a value indicating whether to show product image on shopping cart page
6368
/// </summary>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ protected void PrepareWishlistModel(WishlistModel model, IList<OrganizedShopping
865865
model.CustomerFullname = customer.GetFullName();
866866
model.ShowProductImages = _shoppingCartSettings.ShowProductImagesOnShoppingCart;
867867
model.ShowProductBundleImages = _shoppingCartSettings.ShowProductBundleImagesOnShoppingCart;
868+
model.ShowItemsFromWishlistToCartButton = _shoppingCartSettings.ShowItemsFromWishlistToCartButton;
868869
model.ShowSku = _catalogSettings.ShowProductSku;
869870
model.DisplayShortDesc = _shoppingCartSettings.ShowShortDesc;
870871
model.BundleThumbSize = _mediaSettings.CartThumbBundleItemPictureSize;

src/Presentation/SmartStore.Web/Models/ShoppingCart/WishlistModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public WishlistModel()
3232

3333
public IList<string> Warnings { get; set; }
3434

35-
// codehint: sm-add
3635
public int ThumbSize { get; set; }
3736
public int BundleThumbSize { get; set; }
3837
public int IgnoredProductsCount { get; set; }
3938
public bool DisplayShortDesc { get; set; }
4039
public bool ShowProductBundleImages { get; set; }
40+
public bool ShowItemsFromWishlistToCartButton { get; set; }
4141

4242
#region Nested Classes
4343

src/Presentation/SmartStore.Web/Views/ShoppingCart/FlyoutWishlist.cshtml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,20 @@
4646
</span>
4747
}
4848
</div>
49-
<div class="action pull-left">
50-
<a class="btn btn-mini ajax-cart-link" title='@T("ShoppingCart.AddToCart")'
51-
href="#"
52-
rel="nofollow"
53-
data-href="@Url.Action("AddOneItemtoCartFromWishlist", "ShoppingCart", new { cartItemId = item.Id })"
54-
data-name="@item.ProductName"
55-
data-type="cart"
56-
data-action="addfromwishlist">
57-
<i class="fa fa-shopping-cart"></i>
58-
</a>
59-
</div>
49+
@if (Model.ShowItemsFromWishlistToCartButton)
50+
{
51+
<div class="action pull-left">
52+
<a class="btn btn-mini ajax-cart-link" title='@T("ShoppingCart.AddToCart")'
53+
href="#"
54+
rel="nofollow"
55+
data-href="@Url.Action("AddOneItemtoCartFromWishlist", "ShoppingCart", new { cartItemId = item.Id })"
56+
data-name="@item.ProductName"
57+
data-type="cart"
58+
data-action="addfromwishlist">
59+
<i class="fa fa-shopping-cart"></i>
60+
</a>
61+
</div>
62+
}
6063
<div class="price pull-right">
6164
@item.UnitPrice
6265
</div>

0 commit comments

Comments
 (0)