Skip to content

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.

Changes for saving visited page in customer

support45cfd6a81976
diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
index cd8decfc6..7633e3155 100644
--- a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
+++ b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
@@ -47,7 +47,6 @@ public static class SystemCustomerFieldNames
public static string OfferedShippingOptions => "OfferedShippingOptions";
public static string ShippingOptionAttributeDescription => "ShippingOptionAttributeDescription";
public static string ShippingOptionAttribute => "ShippingOptionAttribute";
- public static string LastContinueShoppingPage => "LastContinueShoppingPage";
public static string TaxDisplayTypeId => "TaxDisplayTypeId";
public static string UseLoyaltyPointsDuringCheckout => "UseLoyaltyPointsDuringCheckout";
public static string CookieAccepted => "Cookie.Accepted";
diff --git a/src/Web/Grand.Web/Controllers/CatalogController.cs b/src/Web/Grand.Web/Controllers/CatalogController.cs
index a4862231e..7da800004 100644
--- a/src/Web/Grand.Web/Controllers/CatalogController.cs
+++ b/src/Web/Grand.Web/Controllers/CatalogController.cs
@@ -77,15 +77,6 @@ public class CatalogController : BasePublicController
#endregion
#region Utilities
-
- protected async Task SaveLastContinueShoppingPage(Customer customer)
- {
- await _userFieldService.SaveField(customer,
- SystemCustomerFieldNames.LastContinueShoppingPage,
- HttpContext.Request.Path,
- _workContext.CurrentStore.Id);
- }
-
private VendorReviewOverviewModel PrepareVendorReviewOverviewModel(Domain.Vendors.Vendor vendor)
{
var model = new VendorReviewOverviewModel {
@@ -123,9 +114,6 @@ public class CatalogController : BasePublicController
if (!_aclService.Authorize(category, _workContext.CurrentStore.Id))
return InvokeHttp404();
- //'Continue shopping' URL
- await SaveLastContinueShoppingPage(customer);
-
//display "edit" (manage) link
if (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) &&
await _permissionService.Authorize(StandardPermission.ManageCategories, customer))
@@ -186,9 +174,6 @@ public class CatalogController : BasePublicController
if (!_aclService.Authorize(brand, _workContext.CurrentStore.Id))
return InvokeHttp404();
- //'Continue shopping' URL
- await SaveLastContinueShoppingPage(customer);
-
//display "edit" (manage) link
if (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) &&
await _permissionService.Authorize(StandardPermission.ManageBrands, customer))
@@ -249,9 +234,6 @@ public class CatalogController : BasePublicController
if (!_aclService.Authorize(collection, _workContext.CurrentStore.Id))
return InvokeHttp404();
- //'Continue shopping' URL
- await SaveLastContinueShoppingPage(customer);
-
//display "edit" (manage) link
if (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) &&
await _permissionService.Authorize(StandardPermission.ManageCollections, customer))
@@ -303,9 +285,6 @@ public class CatalogController : BasePublicController
var customer = _workContext.CurrentCustomer;
- //'Continue shopping' URL
- await SaveLastContinueShoppingPage(customer);
-
//display "edit" (manage) link
if (await _permissionService.Authorize(StandardPermission.ManageAccessAdminPanel, customer) &&
await _permissionService.Authorize(StandardPermission.ManageCollections, customer))
@@ -484,8 +463,6 @@ public class CatalogController : BasePublicController
[HttpGet]
public virtual async Task<IActionResult> Search(SearchModel model, CatalogPagingFilteringModel command)
{
- //'Continue shopping' URL
- await SaveLastContinueShoppingPage(_workContext.CurrentCustomer);
if (model != null && !string.IsNullOrEmpty(model.SearchCategoryId))
{
model.cid = model.SearchCategoryId;
diff --git a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
index 5c86e5e6d..64b4a57fe 100644
--- a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
+++ b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
@@ -476,12 +476,6 @@ public class ShoppingCartController : BasePublicController
[HttpGet]
public virtual IActionResult ContinueShopping()
{
- var returnUrl =
- _workContext.CurrentCustomer.GetUserFieldFromEntity<string>(
- SystemCustomerFieldNames.LastContinueShoppingPage, _workContext.CurrentStore.Id);
- if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl))
- return Redirect(returnUrl);
-
return RedirectToRoute("HomePage");
}