Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Minor fix - Wishlist - EmailAFriend - return JSON model
KrzysztofPajak50962e6f332a
diff --git a/src/Web/Grand.Web/Controllers/WishlistController.cs b/src/Web/Grand.Web/Controllers/WishlistController.csindex b19a19b5c..093d0331f 100644--- a/src/Web/Grand.Web/Controllers/WishlistController.cs+++ b/src/Web/Grand.Web/Controllers/WishlistController.cs@@ -204,11 +204,11 @@ namespace Grand.Web.Controllers[FromServices] CaptchaSettings captchaSettings){if (!await _permissionService.Authorize(StandardPermission.EnableWishlist) || !_shoppingCartSettings.EmailWishlistEnabled)- return RedirectToRoute("HomePage");+ return Content("");var cart = _shoppingCartService.GetShoppingCart(_workContext.CurrentStore.Id, ShoppingCartType.Wishlist);if (!cart.Any())- return RedirectToRoute("HomePage");+ return Content("");//validate CAPTCHAif (captchaSettings.Enabled && captchaSettings.ShowOnEmailWishlistToFriendPage && !captchaValid)@@ -232,12 +232,14 @@ namespace Grand.Web.Controllersmodel.SuccessfullySent = true;model.Result = _translationService.GetResource("Wishlist.EmailAFriend.SuccessfullySent");- return View(model);+ return Json(model);}//If we got this far, something failed, redisplay formmodel.DisplayCaptcha = captchaSettings.Enabled && captchaSettings.ShowOnEmailWishlistToFriendPage;- return View(model);+ model.Result = string.Join(", ", ModelState.Values.SelectMany(v => v.Errors).Select(x => x.ErrorMessage));++ return Json(model);}#endregiondiff --git a/src/Web/Grand.Web/Models/ShoppingCart/WishlistEmailAFriendModel.cs b/src/Web/Grand.Web/Models/ShoppingCart/WishlistEmailAFriendModel.csindex cd5781c7f..a07f56f2b 100644--- a/src/Web/Grand.Web/Models/ShoppingCart/WishlistEmailAFriendModel.cs+++ b/src/Web/Grand.Web/Models/ShoppingCart/WishlistEmailAFriendModel.cs@@ -18,5 +18,6 @@ namespace Grand.Web.Models.ShoppingCartpublic string Result { get; set; }public bool DisplayCaptcha { get; set; }+}}\ No newline at end of file