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
Remove unused UrlReferrer property from Order
support0052b47db4bb
diff --git a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.csindex 35cc681a1..7164dabe8 100644--- a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs+++ b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs@@ -957,7 +957,6 @@ public class PlaceOrderCommandHandler : IRequestHandler<PlaceOrderCommand, PlaceFirstName = details.Customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName),LastName = details.Customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastName),CustomerEmail = details.Customer.Email,- UrlReferrer = details.Customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastUrlReferrer),ShippingOptionAttributeDescription =details.Customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.ShippingOptionAttributeDescription, paymentTransaction.StoreId),diff --git a/src/Business/Grand.Business.Checkout/Services/Orders/ShoppingCartService.cs b/src/Business/Grand.Business.Checkout/Services/Orders/ShoppingCartService.csindex 59e3106c7..c4169ffbb 100644--- a/src/Business/Grand.Business.Checkout/Services/Orders/ShoppingCartService.cs+++ b/src/Business/Grand.Business.Checkout/Services/Orders/ShoppingCartService.cs@@ -435,11 +435,6 @@ public class ShoppingCartService : IShoppingCartServiceawait _userFieldService.SaveField(toCustomer, SystemCustomerFieldNames.GiftVoucherCoupons, resultGift);}- //copy url referer- var lastUrlReferrer =- await fromCustomer.GetUserField<string>(_userFieldService, SystemCustomerFieldNames.LastUrlReferrer);- await _userFieldService.SaveField(toCustomer, SystemCustomerFieldNames.LastUrlReferrer, lastUrlReferrer);-//move selected checkout attributesvar checkoutAttributes = await fromCustomer.GetUserField<List<CustomAttribute>>(_userFieldService,SystemCustomerFieldNames.CheckoutAttributes, _workContext.CurrentStore.Id);diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.csindex e6576b35e..7cc94734c 100644--- a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs+++ b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs@@ -23,12 +23,10 @@ public static class SystemCustomerFieldNames//Other attributespublic static string DiscountCoupons => "DiscountCoupons";public static string GiftVoucherCoupons => "GiftVoucherCoupons";- public static string UrlReferrer => "UrlReferrer";public static string PasswordRecoveryToken => "PasswordRecoveryToken";public static string PasswordRecoveryTokenDateGenerated => "PasswordRecoveryTokenDateGenerated";public static string AccountActivationToken => "AccountActivationToken";public static string LastVisitedPage => "LastVisitedPage";- public static string LastUrlReferrer => "LastUrlReferrer";public static string ImpersonatedCustomerId => "ImpersonatedCustomerId";public static string AdminAreaStoreScopeConfiguration => "AdminAreaStoreScopeConfiguration";public static string TwoFactorEnabled => "TwoFactorEnabled";diff --git a/src/Core/Grand.Domain/Orders/Order.cs b/src/Core/Grand.Domain/Orders/Order.csindex c4d611d9b..d5a1c57d8 100644--- a/src/Core/Grand.Domain/Orders/Order.cs+++ b/src/Core/Grand.Domain/Orders/Order.cs@@ -283,11 +283,6 @@ public class Order : BaseEntity/// </summary>public int RecurringUseCycles { get; set; }- /// <summary>- /// Gets or sets a value indicating whether the url referrer exists- /// </summary>- public string UrlReferrer { get; set; }-/// <summary>/// Gets or sets the Shipping Option description (customer friendly string)/// </summary>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabInfo.cshtmlindex f0d10f9e7..46e40da93 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabInfo.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabInfo.cshtml@@ -440,15 +440,6 @@ else</div></div>}-@if (!string.IsNullOrEmpty(Model.Id) && !string.IsNullOrEmpty(Model.UrlReferrer))-{- <div class="form-group">- <admin-label asp-for="UrlReferrer"/>- <div class="col-md-9 col-sm-9">- <label class="control-label">@Model.UrlReferrer</label>- </div>- </div>-}@if (!string.IsNullOrEmpty(Model.Id)){<div class="form-group">@@ -476,15 +467,6 @@ else</div></div>}-@if (!string.IsNullOrEmpty(Model.Id) && !string.IsNullOrEmpty(Model.LastUrlReferrer))-{- <div class="form-group">- <admin-label asp-for="LastUrlReferrer"/>- <div class="col-md-9 col-sm-9">- <label class="control-label">@Model.LastUrlReferrer</label>- </div>- </div>-}@if (!string.IsNullOrEmpty(Model.Id) && Model.LastPurchaseDate.HasValue){<div class="form-group">diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Info.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Info.cshtmlindex 81a5aa300..29d05e7dd 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Info.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Info.cshtml@@ -217,15 +217,6 @@<label class="control-label">@Model.CustomerIp</label></div></div>-@if (!string.IsNullOrEmpty(Model.UrlReferrer))-{- <div class="form-group">- <admin-label asp-for="UrlReferrer" asp-display-hint="false" class="control-label col-3 col-md-3 col-sm-3"></admin-label>- <div class="col-9 col-md-9 col-sm-9">- <label class="control-label">@Model.UrlReferrer</label>- </div>- </div>-}@if (!string.IsNullOrEmpty(Model.VatNumber)){<div class="form-group">diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs b/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.csindex d9569155e..173d63c73 100644--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs@@ -173,16 +173,9 @@ public class CustomerModel : BaseEntityModel[GrandResourceDisplayName("Admin.Customers.Customers.Fields.IPAddress")]public string LastIpAddress { get; set; }- //Url referrer- [GrandResourceDisplayName("Admin.Customers.Customers.Fields.URLReferrer")]- public string UrlReferrer { get; set; }-[GrandResourceDisplayName("Admin.Customers.Customers.Fields.LastVisitedPage")]public string LastVisitedPage { get; set; }- [GrandResourceDisplayName("Admin.Customers.Customers.Fields.LastUrlReferrer")]- public string LastUrlReferrer { get; set; }-//newsletter subscriptions (per store)[GrandResourceDisplayName("Admin.Customers.Customers.Fields.Newsletter")]public List<StoreModel> AvailableNewsletterSubscriptionStores { get; set; } = new();diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs b/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.csindex f8aeed3b2..e59fd0edf 100644--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs@@ -43,9 +43,6 @@ public class OrderModel : BaseEntityModel[GrandResourceDisplayName("Admin.Orders.Fields.CustomerIP")]public string CustomerIp { get; set; }- [GrandResourceDisplayName("Admin.Orders.Fields.UrlReferrer")]- public string UrlReferrer { get; set; }-[GrandResourceDisplayName("Admin.Orders.Fields.CustomValues")]public Dictionary<string, object> CustomValues { get; set; } = new();diff --git a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.csindex 959385fc3..327054583 100644--- a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs@@ -225,11 +225,7 @@ public class CustomerViewModelService : ICustomerViewModelServicemodel.LastPurchaseDate =_dateTimeService.ConvertToUserTime(customer.LastPurchaseDateUtc.Value, DateTimeKind.Utc);model.LastIpAddress = customer.LastIpAddress;- model.UrlReferrer = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.UrlReferrer);- model.LastVisitedPage =- customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastVisitedPage);- model.LastUrlReferrer =- customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastUrlReferrer);+ model.LastVisitedPage = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastVisitedPage);model.CustomerGroups = customer.Groups.ToArray();//newsletter subscriptionsdiff --git a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs b/src/Web/Grand.Web.Admin/Services/OrderViewModelService.csindex 86402788e..38d4fe68e 100644--- a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs@@ -325,7 +325,6 @@ public class OrderViewModelService : IOrderViewModelService: _translationService.GetResource("Admin.Customers.Guest");model.CustomerIp = order.CustomerIp;- model.UrlReferrer = order.UrlReferrer;model.VatNumber = order.VatNumber;model.CreatedOn = _dateTimeService.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc);model.TaxDisplayType = _taxSettings.TaxDisplayType;diff --git a/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs b/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.csindex 55f9f1cec..95e26e9b4 100644--- a/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs+++ b/src/Web/Grand.Web.Common/Filters/CustomerActivityAttribute.cs@@ -100,17 +100,6 @@ public class CustomerActivityAttribute : TypeFilterAttributeif (!pageUrl.Equals(previousPageUrl, StringComparison.OrdinalIgnoreCase))await _userFieldService.SaveField(_workContext.CurrentCustomer,SystemCustomerFieldNames.LastVisitedPage, pageUrl);-- if (context.HttpContext.Request?.GetTypedHeaders().Referer?.ToString() is { } referer &&- !referer.Contains(context.HttpContext.Request.Host.ToString()))- {- var previousUrlReferrer =- await _workContext.CurrentCustomer.GetUserField<string>(_userFieldService,- SystemCustomerFieldNames.LastUrlReferrer);- if (previousUrlReferrer != referer)- await _userFieldService.SaveField(_workContext.CurrentCustomer,- SystemCustomerFieldNames.LastUrlReferrer, referer);- }}#endregiondiff --git a/src/Web/Grand.Web.Common/WorkContext.cs b/src/Web/Grand.Web.Common/WorkContext.csindex 688f08d63..f1ba9582a 100644--- a/src/Web/Grand.Web.Common/WorkContext.cs+++ b/src/Web/Grand.Web.Common/WorkContext.cs@@ -251,9 +251,6 @@ public class WorkContext : IWorkContext, IWorkContextSetter{var userFields = new List<UserField>();- if (_httpContextAccessor?.HttpContext?.Request.GetTypedHeaders().Referer?.ToString() is { } referer)- userFields.Add(new UserField { Key = SystemCustomerFieldNames.UrlReferrer, Value = referer, StoreId = "" });-if (!string.IsNullOrEmpty(CurrentStore.DefaultCurrencyId))userFields.Add(new UserField {Key = SystemCustomerFieldNames.CurrencyId, Value = CurrentStore.DefaultCurrencyId,diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xmlindex 1dabebf1a..d1d6480f7 100644--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml@@ -6324,9 +6324,6 @@<Resource Name="Admin.Customers.Customers.Fields.LastPurchaseDate" Area="Admin"><Value>Last purchase date</Value></Resource>- <Resource Name="Admin.Customers.Customers.Fields.LastUrlReferrer" Area="Admin">- <Value>Last url referrer</Value>- </Resource><Resource Name="Admin.Customers.Customers.Fields.LastVisitedPage" Area="Admin"><Value>Last visited page</Value></Resource>@@ -6387,9 +6384,6 @@<Resource Name="Admin.Customers.Customers.Fields.TwoFactorEnabled" Area="Admin"><Value>Two-factor authentication is enabled</Value></Resource>- <Resource Name="Admin.Customers.Customers.Fields.URLReferrer" Area="Admin">- <Value>Created from Url</Value>- </Resource><Resource Name="Admin.Customers.Customers.Fields.Username" Area="Admin"><Value>Username</Value></Resource>@@ -8118,9 +8112,6 @@<Resource Name="Admin.Orders.Fields.Tax" Area="Admin"><Value>Order tax</Value></Resource>- <Resource Name="Admin.Orders.Fields.UrlReferrer" Area="Admin">- <Value>Url referrer</Value>- </Resource><Resource Name="Admin.Orders.Fields.UsedDiscounts" Area="Admin"><Value>Used discounts</Value></Resource>