Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/.idea/.idea.NopCommerce/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/.idea/.idea.NopCommerce/.idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/.idea/.idea.NopCommerce/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2507,7 +2507,7 @@
</LocaleResource>
<LocaleResource Name="Admin.Catalog.FilterLevelValues.Updated">
<Value>The filter level value has been updated successfully.</Value>
</LocaleResource>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Manufacturers">
<Value>Manufacturers</Value>
</LocaleResource>
Expand Down Expand Up @@ -8559,7 +8559,7 @@
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Order.AllowCustomersCancelOrders.Hint">
<Value>Check to allow customers to cancel orders</Value>
</LocaleResource>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Order.AnonymousCheckoutAllowed">
<Value>Anonymous checkout allowed</Value>
</LocaleResource>
Expand Down Expand Up @@ -21416,6 +21416,9 @@
<LocaleResource Name="Wishlist.SelectWishlist">
<Value>Specify your wishlist</Value>
</LocaleResource>
<LocaleResource Name="Wishlist.DuplicateNameNotAllowed">
<Value>A wishlist with this name already exists.</Value>
</LocaleResource>
<LocaleResource Name="Wishlist.TaxShipping.ExclTax">
<Value><![CDATA[All prices are entered excluding tax. Excluding <a href="{0}">shipping</a>]]></Value>
</LocaleResource>
Expand All @@ -21431,4 +21434,4 @@
<LocaleResource Name="Wishlist.YourWishlistURL">
<Value>Your wishlist URL for sharing</Value>
</LocaleResource>
</Language>
</Language>
15 changes: 14 additions & 1 deletion src/Presentation/Nop.Web/Controllers/ShoppingCartController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,8 +1774,21 @@ public virtual async Task<IActionResult> AddWishlist(string name, int productId)
});
}

// Check if customer has reached the maximum number of custom wishlists allowed
var currentWishlists = await _customWishlistService.GetAllCustomWishlistsAsync(customer.Id);
// Check if customer has already have wishlist of same name
var existingWishlist = currentWishlists
.FirstOrDefault(x => x.Name.Equals(name.Trim(), StringComparison.OrdinalIgnoreCase));

if (existingWishlist != null)
{
return Json(new
{
success = false,
message = await _localizationService.GetResourceAsync("Wishlist.DuplicateNameNotAllowed")
});
}

// Check if customer has reached the maximum number of custom wishlists allowed
var maximumNumberOfCustomWishlist = _shoppingCartSettings.MaximumNumberOfCustomWishlist;
if (currentWishlists.Count >= maximumNumberOfCustomWishlist)
{
Expand Down