diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1e7e528b7..bfb6469e1 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -11,16 +11,16 @@
-
-
-
+
+
+
-
-
+
+
-
-
+
+
@@ -33,7 +33,7 @@
-
+
@@ -55,15 +55,15 @@
-
+
-
-
-
-
-
+
+
+
+
+
@@ -75,7 +75,7 @@
-
-
+
+
\ No newline at end of file
diff --git a/src/Plugins/DiscountRules.Standard/Controllers/BaseDiscountRulePluginController.cs b/src/Plugins/DiscountRules.Standard/Controllers/BaseDiscountRulePluginController.cs
new file mode 100644
index 000000000..806f0fc74
--- /dev/null
+++ b/src/Plugins/DiscountRules.Standard/Controllers/BaseDiscountRulePluginController.cs
@@ -0,0 +1,9 @@
+using Grand.Web.Common.Controllers;
+using Grand.Web.Common.Filters;
+using Microsoft.AspNetCore.Mvc;
+
+namespace DiscountRules.Standard.Controllers;
+
+[AuthorizeAdminOrStore]
+[AutoValidateAntiforgeryToken]
+public abstract class BaseDiscountRulePluginController : BaseController;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesCustomerGroupsController.cs
similarity index 94%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
rename to src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesCustomerGroupsController.cs
index 375e4362a..f4c836c94 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesCustomerGroupsController.cs
@@ -1,22 +1,21 @@
-using DiscountRules.Standard.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
-using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.Standard.Areas.Admin.Controllers;
+namespace DiscountRules.Standard.Controllers;
-public class CustomerGroupsController : BaseAdminPluginController
+public class DiscountRulesCustomerGroupsController : BaseDiscountRulePluginController
{
private readonly IDiscountService _discountService;
private readonly IGroupService _groupService;
private readonly IPermissionService _permissionService;
- public CustomerGroupsController(
+ public DiscountRulesCustomerGroupsController(
IDiscountService discountService,
IGroupService groupService,
IPermissionService permissionService)
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHadSpentAmountController.cs
similarity index 93%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
rename to src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHadSpentAmountController.cs
index 2a0372642..818f39afc 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHadSpentAmountController.cs
@@ -1,20 +1,19 @@
-using DiscountRules.Standard.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
-using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
using System.Globalization;
-namespace DiscountRules.Standard.Areas.Admin.Controllers;
+namespace DiscountRules.Standard.Controllers;
-public class HadSpentAmountController : BaseAdminPluginController
+public class DiscountRulesHadSpentAmountController : BaseDiscountRulePluginController
{
private readonly IDiscountService _discountService;
private readonly IPermissionService _permissionService;
- public HadSpentAmountController(
+ public DiscountRulesHadSpentAmountController(
IDiscountService discountService,
IPermissionService permissionService)
{
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasAllProductsController.cs
similarity index 86%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
rename to src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasAllProductsController.cs
index 0d7f5fc4f..16c754fec 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasAllProductsController.cs
@@ -1,4 +1,4 @@
-using DiscountRules.Standard.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
@@ -9,15 +9,14 @@
using Grand.Domain.Discounts;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.Standard.Areas.Admin.Controllers;
+namespace DiscountRules.Standard.Controllers;
-public class HasAllProductsController : BaseAdminPluginController
+public class DiscountRulesHasAllProductsController : BaseDiscountRulePluginController
{
private readonly IDiscountService _discountService;
private readonly IPermissionService _permissionService;
@@ -28,8 +27,8 @@ public class HasAllProductsController : BaseAdminPluginController
private readonly IContextAccessor _contextAccessor;
private readonly IEnumTranslationService _enumTranslationService;
-
- public HasAllProductsController(IDiscountService discountService,
+ private string CurrentStoreId => _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ public DiscountRulesHasAllProductsController(IDiscountService discountService,
IPermissionService permissionService,
IContextAccessor contextAccessor,
ITranslationService translationService,
@@ -127,22 +126,30 @@ public async Task ProductAddPopup(string btnId, string productIds
IsLoggedInAsVendor = _contextAccessor.WorkContext.CurrentVendor != null
};
- //stores
- model.AvailableStores.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var s in await _storeService.GetAllStores())
- model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
-
- //vendors
- model.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var v in await _vendorService.GetAllVendors(showHidden: true))
- model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });
+ //stores - when acting as a store manager, scope to their store
+ if (!string.IsNullOrEmpty(CurrentStoreId))
+ {
+ var store = await _storeService.GetStoreById(CurrentStoreId);
+ if (store != null)
+ model.AvailableStores.Add(new SelectListItem { Text = store.Shortcut, Value = store.Id });
+ }
+ else
+ {
+ model.AvailableStores.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+ foreach (var s in await _storeService.GetAllStores())
+ model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
+
+ //vendors (only shown to admins)
+ model.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+ foreach (var v in await _vendorService.GetAllVendors(showHidden: true))
+ model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });
+ }
//product types
model.AvailableProductTypes = _enumTranslationService.ToSelectList(ProductType.SimpleProduct, false).ToList();
model.AvailableProductTypes.Insert(0,
new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
-
ViewBag.productIdsInput = productIdsInput;
ViewBag.btnId = btnId;
@@ -159,6 +166,9 @@ public async Task ProductAddPopupList(DataSourceRequest command,
//a vendor should have access only to his products
if (_contextAccessor.WorkContext.CurrentVendor != null) model.SearchVendorId = _contextAccessor.WorkContext.CurrentVendor.Id;
+ //a store manager should only search within their store
+ if (!string.IsNullOrEmpty(CurrentStoreId)) model.SearchStoreId = CurrentStoreId;
+
var searchCategoryIds = new List();
if (!string.IsNullOrEmpty(model.SearchCategoryId))
searchCategoryIds.Add(model.SearchCategoryId);
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasOneProductController.cs
similarity index 85%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
rename to src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasOneProductController.cs
index 2c4d74dd7..b214e08ad 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
+++ b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesHasOneProductController.cs
@@ -1,4 +1,4 @@
-using DiscountRules.Standard.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
@@ -10,15 +10,14 @@
using Grand.Domain.Permissions;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
-using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace DiscountRules.Standard.Areas.Admin.Controllers;
+namespace DiscountRules.Standard.Controllers;
-public class HasOneProductController : BaseAdminPluginController
+public class DiscountRulesHasOneProductController : BaseDiscountRulePluginController
{
private readonly IDiscountService _discountService;
private readonly IPermissionService _permissionService;
@@ -30,8 +29,9 @@ public class HasOneProductController : BaseAdminPluginController
private readonly IEnumTranslationService _enumTranslationService;
private Vendor CurrentVendor => _contextAccessor.WorkContext.CurrentVendor;
+ private string CurrentStoreId => _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
- public HasOneProductController(IDiscountService discountService,
+ public DiscountRulesHasOneProductController(IDiscountService discountService,
IPermissionService permissionService,
IContextAccessor contextAccessor,
ITranslationService translationService,
@@ -138,15 +138,24 @@ public async Task ProductAddPopup(string btnId, string productIds
IsLoggedInAsVendor = CurrentVendor != null
};
- //stores
- model.AvailableStores.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var s in await _storeService.GetAllStores())
- model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
-
- //vendors
- model.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var v in await _vendorService.GetAllVendors(showHidden: true))
- model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });
+ //stores - when acting as a store manager, scope to their store
+ if (!string.IsNullOrEmpty(CurrentStoreId))
+ {
+ var store = await _storeService.GetStoreById(CurrentStoreId);
+ if (store != null)
+ model.AvailableStores.Add(new SelectListItem { Text = store.Shortcut, Value = store.Id });
+ }
+ else
+ {
+ model.AvailableStores.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+ foreach (var s in await _storeService.GetAllStores())
+ model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
+
+ //vendors (only shown to admins)
+ model.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+ foreach (var v in await _vendorService.GetAllVendors(showHidden: true))
+ model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });
+ }
//product types
model.AvailableProductTypes = _enumTranslationService.ToSelectList(ProductType.SimpleProduct, false).ToList();
@@ -169,6 +178,8 @@ public async Task ProductAddPopupList(DataSourceRequest command,
//a vendor should have access only to his products
if (CurrentVendor != null) model.SearchVendorId = CurrentVendor.Id;
+ //a store manager should only search within their store
+ if (!string.IsNullOrEmpty(CurrentStoreId)) model.SearchStoreId = CurrentStoreId;
var searchCategoryIds = new List();
if (!string.IsNullOrEmpty(model.SearchCategoryId))
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesShoppingCartAmountController.cs
similarity index 92%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
rename to src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesShoppingCartAmountController.cs
index 99d1b911f..c047ba4ef 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Controllers/DiscountRulesShoppingCartAmountController.cs
@@ -1,20 +1,19 @@
-using DiscountRules.Standard.Models;
+using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
-using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
using System.Globalization;
-namespace DiscountRules.Standard.Areas.Admin.Controllers;
+namespace DiscountRules.Standard.Controllers;
-public class ShoppingCartAmountController : BaseAdminPluginController
+public class DiscountRulesShoppingCartAmountController : BaseDiscountRulePluginController
{
private readonly IDiscountService _discountService;
private readonly IPermissionService _permissionService;
- public ShoppingCartAmountController(IDiscountService discountService,
+ public DiscountRulesShoppingCartAmountController(IDiscountService discountService,
IPermissionService permissionService)
{
_discountService = discountService;
diff --git a/src/Plugins/DiscountRules.Standard/DiscountRules.Standard.csproj b/src/Plugins/DiscountRules.Standard/DiscountRules.Standard.csproj
index c130e63e8..d99106c54 100644
--- a/src/Plugins/DiscountRules.Standard/DiscountRules.Standard.csproj
+++ b/src/Plugins/DiscountRules.Standard/DiscountRules.Standard.csproj
@@ -44,5 +44,5 @@
Always
-
+
\ No newline at end of file
diff --git a/src/Plugins/DiscountRules.Standard/EndpointProvider.cs b/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
index 47cbed67c..c218ded62 100644
--- a/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
+++ b/src/Plugins/DiscountRules.Standard/EndpointProvider.cs
@@ -10,50 +10,56 @@ public void RegisterEndpoint(IEndpointRouteBuilder endpointRouteBuilder)
{
//CustomerGroups
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.CustomerGroups.Configure",
- "Admin/CustomerGroups/Configure",
- new { controller = "CustomerGroups", action = "Configure" }
+ "DiscountRulesCustomerGroups/Configure",
+ new { controller = "DiscountRulesCustomerGroups", action = "Configure" }
);
//HadSpentAmount
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HadSpentAmount.Configure",
- "Admin/HadSpentAmount/Configure",
- new { controller = "HadSpentAmount", action = "Configure" }
+ "DiscountRulesHadSpentAmount/Configure",
+ new { controller = "DiscountRulesHadSpentAmount", action = "Configure" }
+ );
+
+ //ShoppingCartAmount
+ endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.ShoppingCartAmount.Configure",
+ "DiscountRulesShoppingCartAmount/Configure",
+ new { controller = "DiscountRulesShoppingCartAmount", action = "Configure" }
);
//HasAllProducts
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasAllProducts.Configure",
- "Admin/HasAllProducts/Configure",
- new { controller = "HasAllProducts", action = "Configure" }
+ "DiscountRulesHasAllProducts/Configure",
+ new { controller = "DiscountRulesHasAllProducts", action = "Configure" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasAllProducts.ProductAddPopup",
- "Admin/HasAllProducts/ProductAddPopup",
- new { controller = "HasAllProducts", action = "ProductAddPopup" }
+ "DiscountRulesHasAllProducts/ProductAddPopup",
+ new { controller = "DiscountRulesHasAllProducts", action = "ProductAddPopup" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasAllProducts.ProductAddPopupList",
- "Admin/HasAllProducts/ProductAddPopupList",
- new { controller = "HasAllProducts", action = "ProductAddPopupList" }
+ "DiscountRulesHasAllProducts/ProductAddPopupList",
+ new { controller = "DiscountRulesHasAllProducts", action = "ProductAddPopupList" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasAllProducts.LoadProductFriendlyNames",
- "Admin/HasAllProducts/LoadProductFriendlyNames",
- new { controller = "HasAllProducts", action = "LoadProductFriendlyNames" }
+ "DiscountRulesHasAllProducts/LoadProductFriendlyNames",
+ new { controller = "DiscountRulesHasAllProducts", action = "LoadProductFriendlyNames" }
);
//HasOneProduct
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasOneProduct.Configure",
- "Admin/HasOneProduct/Configure",
- new { controller = "HasOneProduct", action = "Configure" }
+ "DiscountRulesHasOneProduct/Configure",
+ new { controller = "DiscountRulesHasOneProduct", action = "Configure" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasOneProduct.ProductAddPopup",
- "Admin/HasOneProduct/ProductAddPopup",
- new { controller = "HasOneProduct", action = "ProductAddPopup" }
+ "DiscountRulesHasOneProduct/ProductAddPopup",
+ new { controller = "DiscountRulesHasOneProduct", action = "ProductAddPopup" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasOneProduct.ProductAddPopupList",
- "Admin/HasOneProduct/ProductAddPopupList",
- new { controller = "HasOneProduct", action = "ProductAddPopupList" }
+ "DiscountRulesHasOneProduct/ProductAddPopupList",
+ new { controller = "DiscountRulesHasOneProduct", action = "ProductAddPopupList" }
);
endpointRouteBuilder.MapControllerRoute("Plugin.DiscountRules.HasOneProduct.LoadProductFriendlyNames",
- "Admin/HasOneProduct/LoadProductFriendlyNames",
- new { controller = "HasOneProduct", action = "LoadProductFriendlyNames" }
+ "DiscountRulesHasOneProduct/LoadProductFriendlyNames",
+ new { controller = "DiscountRulesHasOneProduct", action = "LoadProductFriendlyNames" }
);
}
diff --git a/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
index ed6a6293c..d0a62c90c 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/CustomerGroupDiscountRule.cs
@@ -41,7 +41,7 @@ public async Task CheckRequirement(DiscountRuleVal
public string GetConfigurationUrl(string discountId, string discountRequirementId)
{
//configured
- var result = "Admin/CustomerGroups/Configure/?discountId=" + discountId;
+ var result = $"/DiscountRulesCustomerGroups/Configure/?discountId=" + discountId;
if (!string.IsNullOrEmpty(discountRequirementId))
result += $"&discountRequirementId={discountRequirementId}";
return result;
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
index 0e70c5ba8..398948168 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HadSpentAmountDiscountRule.cs
@@ -65,7 +65,7 @@ public async Task CheckRequirement(DiscountRuleVal
public string GetConfigurationUrl(string discountId, string discountRequirementId)
{
//configured
- var result = "Admin/HadSpentAmount/Configure/?discountId=" + discountId;
+ var result = $"/DiscountRulesHadSpentAmount/Configure/?discountId=" + discountId;
if (!string.IsNullOrEmpty(discountRequirementId))
result += $"&discountRequirementId={discountRequirementId}";
return result;
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
index d8942dadb..89edd276b 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HasAllProductsDiscountRule.cs
@@ -124,7 +124,7 @@ into g
public string GetConfigurationUrl(string discountId, string discountRequirementId)
{
//configured
- var result = "Admin/HasAllProducts/Configure/?discountId=" + discountId;
+ var result = $"/DiscountRulesHasAllProducts/Configure/?discountId=" + discountId;
if (!string.IsNullOrEmpty(discountRequirementId))
result += $"&discountRequirementId={discountRequirementId}";
return result;
diff --git a/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
index 0ed59bd6f..5ad908b29 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/HasOneProductDiscountRule.cs
@@ -123,7 +123,7 @@ into g
public string GetConfigurationUrl(string discountId, string discountRequirementId)
{
//configured
- var result = "Admin/HasOneProduct/Configure/?discountId=" + discountId;
+ var result = $"/DiscountRulesHasOneProduct/Configure/?discountId=" + discountId;
if (!string.IsNullOrEmpty(discountRequirementId))
result += $"&discountRequirementId={discountRequirementId}";
return result;
diff --git a/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs b/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
index b5c6c166b..9b584ee8a 100644
--- a/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
+++ b/src/Plugins/DiscountRules.Standard/Providers/ShoppingCartDiscountRule.cs
@@ -86,7 +86,7 @@ public async Task CheckRequirement(DiscountRuleVal
public string GetConfigurationUrl(string discountId, string discountRequirementId)
{
//configured
- var result = "Admin/ShoppingCartAmount/Configure/?discountId=" + discountId;
+ var result = $"/DiscountRulesShoppingCartAmount/Configure/?discountId=" + discountId;
if (!string.IsNullOrEmpty(discountRequirementId))
result += $"&discountRequirementId={discountRequirementId}";
return result;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesCustomerGroups/Configure.cshtml
similarity index 96%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesCustomerGroups/Configure.cshtml
index 6625a1b6f..af9bc57e5 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/CustomerGroups/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesCustomerGroups/Configure.cshtml
@@ -23,7 +23,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@Url.Action("Configure", "CustomerGroups")",
+ url: "@Url.Action("Configure", "DiscountRulesCustomerGroups")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHadSpentAmount/Configure.cshtml
similarity index 96%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesHadSpentAmount/Configure.cshtml
index 1ac04e3dc..4000e88a4 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HadSpentAmount/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHadSpentAmount/Configure.cshtml
@@ -21,7 +21,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@Url.Action("Configure", "HadSpentAmount")",
+ url: "@Url.Action("Configure", "DiscountRulesHadSpentAmount")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasAllProducts/Configure.cshtml
similarity index 98%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasAllProducts/Configure.cshtml
index 4dc95039a..905d21e80 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasAllProducts/Configure.cshtml
@@ -21,7 +21,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@Url.Action("Configure", "HasAllProducts")",
+ url: "@Url.Action("Configure", "DiscountRulesHasAllProducts")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasAllProducts/ProductAddPopup.cshtml
similarity index 100%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasAllProducts/ProductAddPopup.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasAllProducts/ProductAddPopup.cshtml
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/Configure.cshtml
similarity index 98%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/Configure.cshtml
index 55b30a880..659ea5b18 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/Configure.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/Configure.cshtml
@@ -21,7 +21,7 @@
$.ajax({
cache:false,
type: "POST",
- url: "@Url.Action("Configure", "HasOneProduct")",
+ url: "@Url.Action("Configure", "DiscountRulesHasOneProduct")",
data: postData,
success: function (data) {
$('#pnl-save-requirement-result@(Model.RequirementId)').fadeIn("slow").delay(1000).fadeOut("slow");
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/ProductAddPopup.cshtml
similarity index 98%
rename from src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml
rename to src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/ProductAddPopup.cshtml
index fc917a7ee..9c4fcbb07 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Views/HasOneProduct/ProductAddPopup.cshtml
+++ b/src/Plugins/DiscountRules.Standard/Views/DiscountRulesHasOneProduct/ProductAddPopup.cshtml
@@ -8,7 +8,7 @@
//page title
ViewBag.Title = Loc["Plugins.DiscountRules.HasOneProduct.Fields.Products.Choose"];
}
-