diff --git a/src/.idea/.idea.NopCommerce/.idea/indexLayout.xml b/src/.idea/.idea.NopCommerce/.idea/indexLayout.xml
new file mode 100644
index 00000000000..7b08163cebc
--- /dev/null
+++ b/src/.idea/.idea.NopCommerce/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/.idea.NopCommerce/.idea/material_theme_project_new.xml b/src/.idea/.idea.NopCommerce/.idea/material_theme_project_new.xml
new file mode 100644
index 00000000000..09b9ee06266
--- /dev/null
+++ b/src/.idea/.idea.NopCommerce/.idea/material_theme_project_new.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/.idea.NopCommerce/.idea/workspace.xml b/src/.idea/.idea.NopCommerce/.idea/workspace.xml
new file mode 100644
index 00000000000..80d92975bfa
--- /dev/null
+++ b/src/.idea/.idea.NopCommerce/.idea/workspace.xml
@@ -0,0 +1,25 @@
+
+
+
+ Presentation/Nop.Web/Nop.Web.csproj
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml b/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml
index cbdfae49cfa..c247fa4b238 100644
--- a/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml
+++ b/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml
@@ -2507,7 +2507,7 @@
The filter level value has been updated successfully.
-
+
Manufacturers
@@ -8559,7 +8559,7 @@
Check to allow customers to cancel orders
-
+
Anonymous checkout allowed
@@ -21416,6 +21416,9 @@
Specify your wishlist
+
+ A wishlist with this name already exists.
+ shipping]]>
@@ -21431,4 +21434,4 @@
Your wishlist URL for sharing
-
+
\ No newline at end of file
diff --git a/src/Presentation/Nop.Web/Controllers/ShoppingCartController.cs b/src/Presentation/Nop.Web/Controllers/ShoppingCartController.cs
index bdd1bab2ba4..173cc3142ad 100644
--- a/src/Presentation/Nop.Web/Controllers/ShoppingCartController.cs
+++ b/src/Presentation/Nop.Web/Controllers/ShoppingCartController.cs
@@ -1774,8 +1774,21 @@ public virtual async Task 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)
{