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.

Grand.Web.Store – A Store Management Module #570

Krzysztof Pajakc2d7f7b6aa36
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index c3c62e8a3..9ba0d22e6 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -2,9 +2,9 @@ name: "CodeQL"
on:
push:
- branches: [ main ]
+ branches: [ develop ]
pull_request:
- branches: [ main ]
+ branches: [ develop ]
schedule:
- cron: '0 3 * * 1'
diff --git a/.github/workflows/docker-image-pr.yml b/.github/workflows/docker-image-pr.yml
index 6579cc340..73f0e0309 100644
--- a/.github/workflows/docker-image-pr.yml
+++ b/.github/workflows/docker-image-pr.yml
@@ -2,9 +2,9 @@ name: Docker Image CI
on:
push:
- branches: [ "main" ]
+ branches: [ "develop" ]
pull_request:
- branches: [ "main" ]
+ branches: [ "develop" ]
jobs:
build:
diff --git a/.github/workflows/grandnode.yml b/.github/workflows/grandnode.yml
index cf725c1f9..ad7c7c6a3 100644
--- a/.github/workflows/grandnode.yml
+++ b/.github/workflows/grandnode.yml
@@ -1,7 +1,7 @@
name: Build and deploy .NET Core app to Linux WebApp grandnode
on:
push:
- branches: [ "main" ]
+ branches: [ "develop" ]
env:
AZURE_WEBAPP_NAME: grandnode-dev
diff --git a/.gitignore b/.gitignore
index e317858a2..6822fbf4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -374,4 +374,10 @@ src/Web/Grand.Web.Vendor/App_Data/Settings.cfg
src/Web/Grand.Web.Vendor/Plugins/*
src/Web/Grand.Web.Vendor/Modules/*
src/Web/Grand.Web.Vendor/App_Data/DataProtectionKeys/*
-src/Web/Grand.Web.Vendor/wwwroot/assets/images/thumbs/*.**
\ No newline at end of file
+src/Web/Grand.Web.Vendor/wwwroot/assets/images/thumbs/*.**
+src/Web/Grand.Web.Store/App_Data/InstalledPlugins.cfg
+src/Web/Grand.Web.Store/App_Data/Settings.cfg
+src/Web/Grand.Web.Store/Plugins/*
+src/Web/Grand.Web.Store/Modules/*
+src/Web/Grand.Web.Store/App_Data/DataProtectionKeys/*
+src/Web/Grand.Web.Store/wwwroot/assets/images/thumbs/*.**
\ No newline at end of file
diff --git a/GrandNode.sln b/GrandNode.sln
index 964782589..c6bd60b9f 100644
--- a/GrandNode.sln
+++ b/GrandNode.sln
@@ -117,6 +117,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Web.Common.Tests", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Web.Vendor", "src\Web\Grand.Web.Vendor\Grand.Web.Vendor.csproj", "{061F07B8-067A-43E6-B0FF-250027EE705F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Web.Store", "src\Web\Grand.Web.Store\Grand.Web.Store.csproj", "{27F25854-84CE-4474-91C2-5BFCE4C021DC}"
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Data", "src\Core\Grand.Data\Grand.Data.csproj", "{1308D857-1D87-4973-A848-077F8BBD28DF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{BF4543A8-0731-4FDD-BB6B-0ADB9561F981}"
@@ -141,240 +143,726 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.AppHost", "src\Aspir
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.ServiceDefaults", "src\Aspire\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj", "{591950E4-6377-4ECA-A386-8BD3FFE302F1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Web.AdminShared", "src\Web\Grand.Web.AdminShared\Grand.Web.AdminShared.csproj", "{12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|x64.Build.0 = Debug|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Debug|x86.Build.0 = Debug|Any CPU
{EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|x64.ActiveCfg = Release|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|x64.Build.0 = Release|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|x86.ActiveCfg = Release|Any CPU
+ {EF93C76C-24D8-4BBE-BA2E-9A078D9B7499}.Release|x86.Build.0 = Release|Any CPU
{EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|x64.Build.0 = Debug|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Debug|x86.Build.0 = Debug|Any CPU
{EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|x64.ActiveCfg = Release|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|x64.Build.0 = Release|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA3E9159-AA18-47AB-A3FF-8631935AB250}.Release|x86.Build.0 = Release|Any CPU
{19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|x64.Build.0 = Debug|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Debug|x86.Build.0 = Debug|Any CPU
{19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|x64.ActiveCfg = Release|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|x64.Build.0 = Release|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|x86.ActiveCfg = Release|Any CPU
+ {19AED41D-C37E-4F25-9A86-4370BD8343C9}.Release|x86.Build.0 = Release|Any CPU
{7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|x64.Build.0 = Debug|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Debug|x86.Build.0 = Debug|Any CPU
{7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|x64.ActiveCfg = Release|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|x64.Build.0 = Release|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|x86.ActiveCfg = Release|Any CPU
+ {7A3C9529-7B06-4F7D-B2A0-2D2A09FE02B9}.Release|x86.Build.0 = Release|Any CPU
{426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|x64.Build.0 = Debug|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Debug|x86.Build.0 = Debug|Any CPU
{426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|Any CPU.ActiveCfg = Release|Any CPU
{426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|Any CPU.Build.0 = Release|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|x64.ActiveCfg = Release|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|x64.Build.0 = Release|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|x86.ActiveCfg = Release|Any CPU
+ {426A432B-EEFE-46A0-9DE2-4CD508A29160}.Release|x86.Build.0 = Release|Any CPU
{0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|x64.Build.0 = Debug|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Debug|x86.Build.0 = Debug|Any CPU
{0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|x64.ActiveCfg = Release|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|x64.Build.0 = Release|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|x86.ActiveCfg = Release|Any CPU
+ {0832FC0C-22FC-4660-9E8A-7E259CBC246D}.Release|x86.Build.0 = Release|Any CPU
{04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|x64.Build.0 = Debug|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Debug|x86.Build.0 = Debug|Any CPU
{04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|Any CPU.Build.0 = Release|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|x64.ActiveCfg = Release|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|x64.Build.0 = Release|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|x86.ActiveCfg = Release|Any CPU
+ {04C6B111-F45F-434D-8A7D-D6DD51029966}.Release|x86.Build.0 = Release|Any CPU
{35427306-7271-456A-A337-F7D7E79FB027}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35427306-7271-456A-A337-F7D7E79FB027}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Debug|x64.Build.0 = Debug|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Debug|x86.Build.0 = Debug|Any CPU
{35427306-7271-456A-A337-F7D7E79FB027}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35427306-7271-456A-A337-F7D7E79FB027}.Release|Any CPU.Build.0 = Release|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Release|x64.ActiveCfg = Release|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Release|x64.Build.0 = Release|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Release|x86.ActiveCfg = Release|Any CPU
+ {35427306-7271-456A-A337-F7D7E79FB027}.Release|x86.Build.0 = Release|Any CPU
{B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|x64.Build.0 = Debug|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Debug|x86.Build.0 = Debug|Any CPU
{B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|x64.ActiveCfg = Release|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|x64.Build.0 = Release|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|x86.ActiveCfg = Release|Any CPU
+ {B93A72CF-18A9-40E1-8902-63EEA6094905}.Release|x86.Build.0 = Release|Any CPU
{6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|x64.Build.0 = Debug|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Debug|x86.Build.0 = Debug|Any CPU
{6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|x64.ActiveCfg = Release|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|x64.Build.0 = Release|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|x86.ActiveCfg = Release|Any CPU
+ {6925EF20-C289-482E-855E-DAFCE62BE16A}.Release|x86.Build.0 = Release|Any CPU
{6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|x64.Build.0 = Debug|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Debug|x86.Build.0 = Debug|Any CPU
{6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|x64.ActiveCfg = Release|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|x64.Build.0 = Release|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|x86.ActiveCfg = Release|Any CPU
+ {6F9902AA-DBCE-4BB8-AEBE-47264A10D933}.Release|x86.Build.0 = Release|Any CPU
{D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|x64.Build.0 = Debug|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Debug|x86.Build.0 = Debug|Any CPU
{D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|x64.ActiveCfg = Release|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|x64.Build.0 = Release|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|x86.ActiveCfg = Release|Any CPU
+ {D2E8AC42-2751-4AF9-87E4-54A8B2034360}.Release|x86.Build.0 = Release|Any CPU
{1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|x64.Build.0 = Debug|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Debug|x86.Build.0 = Debug|Any CPU
{1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|x64.ActiveCfg = Release|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|x64.Build.0 = Release|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|x86.ActiveCfg = Release|Any CPU
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA}.Release|x86.Build.0 = Release|Any CPU
{34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|x64.Build.0 = Debug|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Debug|x86.Build.0 = Debug|Any CPU
{34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|Any CPU.Build.0 = Release|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|x64.ActiveCfg = Release|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|x64.Build.0 = Release|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|x86.ActiveCfg = Release|Any CPU
+ {34A46D97-5996-46B3-BDCA-631EDAA0E210}.Release|x86.Build.0 = Release|Any CPU
{BA4579AF-9C20-477A-891B-926968B11C68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA4579AF-9C20-477A-891B-926968B11C68}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Debug|x64.Build.0 = Debug|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Debug|x86.Build.0 = Debug|Any CPU
{BA4579AF-9C20-477A-891B-926968B11C68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA4579AF-9C20-477A-891B-926968B11C68}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Release|x64.ActiveCfg = Release|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Release|x64.Build.0 = Release|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Release|x86.ActiveCfg = Release|Any CPU
+ {BA4579AF-9C20-477A-891B-926968B11C68}.Release|x86.Build.0 = Release|Any CPU
{6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|x64.Build.0 = Debug|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Debug|x86.Build.0 = Debug|Any CPU
{6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|x64.ActiveCfg = Release|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|x64.Build.0 = Release|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|x86.ActiveCfg = Release|Any CPU
+ {6F24BF9C-EA4E-42AB-A9A8-435CE69362B8}.Release|x86.Build.0 = Release|Any CPU
{64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|x64.Build.0 = Debug|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Debug|x86.Build.0 = Debug|Any CPU
{64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|x64.ActiveCfg = Release|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|x64.Build.0 = Release|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|x86.ActiveCfg = Release|Any CPU
+ {64775F93-5A04-495F-97C6-BDB3835B18F6}.Release|x86.Build.0 = Release|Any CPU
{17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|x64.Build.0 = Debug|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Debug|x86.Build.0 = Debug|Any CPU
{17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|Any CPU.Build.0 = Release|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|x64.ActiveCfg = Release|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|x64.Build.0 = Release|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|x86.ActiveCfg = Release|Any CPU
+ {17CE6A72-A88D-4587-8FCD-3AB7E35F9524}.Release|x86.Build.0 = Release|Any CPU
{1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|x64.Build.0 = Debug|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Debug|x86.Build.0 = Debug|Any CPU
{1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|x64.ActiveCfg = Release|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|x64.Build.0 = Release|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|x86.ActiveCfg = Release|Any CPU
+ {1397574D-93C6-4A2A-94BA-F56367962CC2}.Release|x86.Build.0 = Release|Any CPU
{FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|x64.Build.0 = Debug|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Debug|x86.Build.0 = Debug|Any CPU
{FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|x64.ActiveCfg = Release|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|x64.Build.0 = Release|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|x86.ActiveCfg = Release|Any CPU
+ {FBB52C66-16F3-4909-A507-BA1FF8D96FAA}.Release|x86.Build.0 = Release|Any CPU
{7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|x64.Build.0 = Debug|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Debug|x86.Build.0 = Debug|Any CPU
{7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|x64.ActiveCfg = Release|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|x64.Build.0 = Release|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|x86.ActiveCfg = Release|Any CPU
+ {7FB9D801-F924-4AEE-94F6-B95997077FA3}.Release|x86.Build.0 = Release|Any CPU
{6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|x64.Build.0 = Debug|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Debug|x86.Build.0 = Debug|Any CPU
{6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|x64.ActiveCfg = Release|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|x64.Build.0 = Release|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|x86.ActiveCfg = Release|Any CPU
+ {6B0F6DFC-89FD-47AD-B793-C595ED134AD9}.Release|x86.Build.0 = Release|Any CPU
{67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|x64.Build.0 = Debug|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Debug|x86.Build.0 = Debug|Any CPU
{67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|x64.ActiveCfg = Release|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|x64.Build.0 = Release|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|x86.ActiveCfg = Release|Any CPU
+ {67844BF0-10DC-4C0A-B913-FCEF3F7FDC8C}.Release|x86.Build.0 = Release|Any CPU
{B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|x64.Build.0 = Debug|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Debug|x86.Build.0 = Debug|Any CPU
{B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|x64.ActiveCfg = Release|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|x64.Build.0 = Release|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|x86.ActiveCfg = Release|Any CPU
+ {B98D0EE8-F3E3-4B9F-AB50-BD33CA8EE5C5}.Release|x86.Build.0 = Release|Any CPU
{DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|x64.Build.0 = Debug|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Debug|x86.Build.0 = Debug|Any CPU
{DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|x64.ActiveCfg = Release|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|x64.Build.0 = Release|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|x86.ActiveCfg = Release|Any CPU
+ {DD3F159F-B858-49AD-8DEF-CB7A3FA47B94}.Release|x86.Build.0 = Release|Any CPU
{9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|x64.Build.0 = Debug|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Debug|x86.Build.0 = Debug|Any CPU
{9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|x64.ActiveCfg = Release|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|x64.Build.0 = Release|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|x86.ActiveCfg = Release|Any CPU
+ {9757F07A-8B94-4C0C-9BC3-16C34DB8E12A}.Release|x86.Build.0 = Release|Any CPU
{698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|x64.Build.0 = Debug|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Debug|x86.Build.0 = Debug|Any CPU
{698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|Any CPU.Build.0 = Release|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|x64.ActiveCfg = Release|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|x64.Build.0 = Release|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|x86.ActiveCfg = Release|Any CPU
+ {698F61F2-AA56-454A-89BE-E0FACDCA6F29}.Release|x86.Build.0 = Release|Any CPU
{735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|x64.Build.0 = Debug|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Debug|x86.Build.0 = Debug|Any CPU
{735E808D-4B7A-4D4C-946C-4980983F8069}.Release|Any CPU.ActiveCfg = Release|Any CPU
{735E808D-4B7A-4D4C-946C-4980983F8069}.Release|Any CPU.Build.0 = Release|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Release|x64.ActiveCfg = Release|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Release|x64.Build.0 = Release|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Release|x86.ActiveCfg = Release|Any CPU
+ {735E808D-4B7A-4D4C-946C-4980983F8069}.Release|x86.Build.0 = Release|Any CPU
{56643517-D513-4A7E-A245-018DC9E2B451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56643517-D513-4A7E-A245-018DC9E2B451}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Debug|x64.Build.0 = Debug|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Debug|x86.Build.0 = Debug|Any CPU
{56643517-D513-4A7E-A245-018DC9E2B451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56643517-D513-4A7E-A245-018DC9E2B451}.Release|Any CPU.Build.0 = Release|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Release|x64.ActiveCfg = Release|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Release|x64.Build.0 = Release|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Release|x86.ActiveCfg = Release|Any CPU
+ {56643517-D513-4A7E-A245-018DC9E2B451}.Release|x86.Build.0 = Release|Any CPU
{E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|x64.Build.0 = Debug|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Debug|x86.Build.0 = Debug|Any CPU
{E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|x64.ActiveCfg = Release|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|x64.Build.0 = Release|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|x86.ActiveCfg = Release|Any CPU
+ {E78BA3F9-119E-4F7E-893F-3972B22F5096}.Release|x86.Build.0 = Release|Any CPU
{CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|x64.Build.0 = Debug|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Debug|x86.Build.0 = Debug|Any CPU
{CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|x64.ActiveCfg = Release|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|x64.Build.0 = Release|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|x86.ActiveCfg = Release|Any CPU
+ {CC40A0A2-BD47-49B9-A1E1-6E1819117EB1}.Release|x86.Build.0 = Release|Any CPU
{B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|x64.Build.0 = Debug|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Debug|x86.Build.0 = Debug|Any CPU
{B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|x64.ActiveCfg = Release|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|x64.Build.0 = Release|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|x86.ActiveCfg = Release|Any CPU
+ {B023CB66-17B2-4B82-B9C1-09E6716131C4}.Release|x86.Build.0 = Release|Any CPU
{9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|x64.Build.0 = Debug|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Debug|x86.Build.0 = Debug|Any CPU
{9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|x64.ActiveCfg = Release|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|x64.Build.0 = Release|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|x86.ActiveCfg = Release|Any CPU
+ {9D142307-0C53-490B-AFAB-C634FDF57A64}.Release|x86.Build.0 = Release|Any CPU
{DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|x64.Build.0 = Debug|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Debug|x86.Build.0 = Debug|Any CPU
{DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|x64.ActiveCfg = Release|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|x64.Build.0 = Release|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|x86.ActiveCfg = Release|Any CPU
+ {DA207F2A-1F21-4B78-8441-236B1A9EA728}.Release|x86.Build.0 = Release|Any CPU
{95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|x64.Build.0 = Debug|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Debug|x86.Build.0 = Debug|Any CPU
{95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|x64.ActiveCfg = Release|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|x64.Build.0 = Release|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|x86.ActiveCfg = Release|Any CPU
+ {95B5BD92-639D-4B38-AA17-D4D1FADB20F8}.Release|x86.Build.0 = Release|Any CPU
{69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|x64.Build.0 = Debug|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Debug|x86.Build.0 = Debug|Any CPU
{69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|Any CPU.Build.0 = Release|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|x64.ActiveCfg = Release|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|x64.Build.0 = Release|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|x86.ActiveCfg = Release|Any CPU
+ {69FA02D5-8A8D-447D-9CE5-A63591093F01}.Release|x86.Build.0 = Release|Any CPU
{E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|x64.Build.0 = Debug|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Debug|x86.Build.0 = Debug|Any CPU
{E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|x64.ActiveCfg = Release|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|x64.Build.0 = Release|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|x86.ActiveCfg = Release|Any CPU
+ {E0CDC8F3-2F79-40ED-AD7C-EF3F7B056BEA}.Release|x86.Build.0 = Release|Any CPU
{3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|x64.Build.0 = Debug|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Debug|x86.Build.0 = Debug|Any CPU
{3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|x64.ActiveCfg = Release|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|x64.Build.0 = Release|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|x86.ActiveCfg = Release|Any CPU
+ {3CCCC424-B13F-479B-94A2-A0A6B05C0858}.Release|x86.Build.0 = Release|Any CPU
{B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|x64.Build.0 = Debug|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Debug|x86.Build.0 = Debug|Any CPU
{B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|x64.ActiveCfg = Release|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|x64.Build.0 = Release|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|x86.ActiveCfg = Release|Any CPU
+ {B34CA673-578B-46D8-BEC0-2C32BF6997F9}.Release|x86.Build.0 = Release|Any CPU
{ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|x64.Build.0 = Debug|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Debug|x86.Build.0 = Debug|Any CPU
{ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|x64.ActiveCfg = Release|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|x64.Build.0 = Release|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|x86.ActiveCfg = Release|Any CPU
+ {ACCAAA38-FBF0-4C18-9227-4A7A3897C5AC}.Release|x86.Build.0 = Release|Any CPU
{1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|x64.Build.0 = Debug|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Debug|x86.Build.0 = Debug|Any CPU
{1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|x64.ActiveCfg = Release|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|x64.Build.0 = Release|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|x86.ActiveCfg = Release|Any CPU
+ {1C0C8328-3B03-4D43-8309-7F0F52A0475F}.Release|x86.Build.0 = Release|Any CPU
{1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|x64.Build.0 = Debug|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Debug|x86.Build.0 = Debug|Any CPU
{1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|x64.ActiveCfg = Release|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|x64.Build.0 = Release|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|x86.ActiveCfg = Release|Any CPU
+ {1301BA1F-F852-4A2A-8A01-2BE2E3C992E2}.Release|x86.Build.0 = Release|Any CPU
{EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|x64.Build.0 = Debug|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Debug|x86.Build.0 = Debug|Any CPU
{EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|x64.ActiveCfg = Release|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|x64.Build.0 = Release|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|x86.ActiveCfg = Release|Any CPU
+ {EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}.Release|x86.Build.0 = Release|Any CPU
{50049A49-D27E-4200-9875-F6C486FD608D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50049A49-D27E-4200-9875-F6C486FD608D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Debug|x64.Build.0 = Debug|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Debug|x86.Build.0 = Debug|Any CPU
{50049A49-D27E-4200-9875-F6C486FD608D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50049A49-D27E-4200-9875-F6C486FD608D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Release|x64.ActiveCfg = Release|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Release|x64.Build.0 = Release|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Release|x86.ActiveCfg = Release|Any CPU
+ {50049A49-D27E-4200-9875-F6C486FD608D}.Release|x86.Build.0 = Release|Any CPU
{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|x64.Build.0 = Debug|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Debug|x86.Build.0 = Debug|Any CPU
{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|x64.ActiveCfg = Release|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|x64.Build.0 = Release|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|x86.ActiveCfg = Release|Any CPU
+ {0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}.Release|x86.Build.0 = Release|Any CPU
{6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|x64.Build.0 = Debug|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Debug|x86.Build.0 = Debug|Any CPU
{6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|x64.ActiveCfg = Release|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|x64.Build.0 = Release|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|x86.ActiveCfg = Release|Any CPU
+ {6969D83E-567C-47A7-8E7F-7FE40940704E}.Release|x86.Build.0 = Release|Any CPU
{061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|x64.Build.0 = Debug|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Debug|x86.Build.0 = Debug|Any CPU
{061F07B8-067A-43E6-B0FF-250027EE705F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{061F07B8-067A-43E6-B0FF-250027EE705F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Release|x64.ActiveCfg = Release|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Release|x64.Build.0 = Release|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Release|x86.ActiveCfg = Release|Any CPU
+ {061F07B8-067A-43E6-B0FF-250027EE705F}.Release|x86.Build.0 = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|x64.Build.0 = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Debug|x86.Build.0 = Debug|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|x64.ActiveCfg = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|x64.Build.0 = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|x86.ActiveCfg = Release|Any CPU
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC}.Release|x86.Build.0 = Release|Any CPU
{1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|x64.Build.0 = Debug|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Debug|x86.Build.0 = Debug|Any CPU
{1308D857-1D87-4973-A848-077F8BBD28DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1308D857-1D87-4973-A848-077F8BBD28DF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Release|x64.ActiveCfg = Release|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Release|x64.Build.0 = Release|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Release|x86.ActiveCfg = Release|Any CPU
+ {1308D857-1D87-4973-A848-077F8BBD28DF}.Release|x86.Build.0 = Release|Any CPU
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|x64.Build.0 = Debug|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Debug|x86.Build.0 = Debug|Any CPU
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|Any CPU.Build.0 = Release|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|x64.ActiveCfg = Release|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|x64.Build.0 = Release|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|x86.ActiveCfg = Release|Any CPU
+ {09958AAA-44BC-42DE-86D1-0E39EF3C0C68}.Release|x86.Build.0 = Release|Any CPU
{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|x64.Build.0 = Debug|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Debug|x86.Build.0 = Debug|Any CPU
{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|x64.ActiveCfg = Release|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|x64.Build.0 = Release|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|x86.ActiveCfg = Release|Any CPU
+ {9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}.Release|x86.Build.0 = Release|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|x64.Build.0 = Debug|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|x86.Build.0 = Debug|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|x64.ActiveCfg = Release|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|x64.Build.0 = Release|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|x86.ActiveCfg = Release|Any CPU
+ {8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|x86.Build.0 = Release|Any CPU
{62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|x64.Build.0 = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|x86.Build.0 = Debug|Any CPU
{62460E0C-D4D1-4606-9716-965267B77BA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62460E0C-D4D1-4606-9716-965267B77BA3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|x64.ActiveCfg = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|x64.Build.0 = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|x86.ActiveCfg = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|x86.Build.0 = Release|Any CPU
{75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|x64.Build.0 = Debug|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Debug|x86.Build.0 = Debug|Any CPU
{75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|x64.ActiveCfg = Release|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|x64.Build.0 = Release|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|x86.ActiveCfg = Release|Any CPU
+ {75F9D855-026B-4BCB-90CE-3800F02FA0A7}.Release|x86.Build.0 = Release|Any CPU
{E0B26803-010B-4198-8016-002242076B61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0B26803-010B-4198-8016-002242076B61}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Debug|x64.Build.0 = Debug|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Debug|x86.Build.0 = Debug|Any CPU
{E0B26803-010B-4198-8016-002242076B61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0B26803-010B-4198-8016-002242076B61}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Release|x64.ActiveCfg = Release|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Release|x64.Build.0 = Release|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Release|x86.ActiveCfg = Release|Any CPU
+ {E0B26803-010B-4198-8016-002242076B61}.Release|x86.Build.0 = Release|Any CPU
{136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|x64.Build.0 = Debug|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Debug|x86.Build.0 = Debug|Any CPU
{136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|x64.ActiveCfg = Release|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|x64.Build.0 = Release|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|x86.ActiveCfg = Release|Any CPU
+ {136F1E35-8B20-465C-8D42-30A5A0D0DA1F}.Release|x86.Build.0 = Release|Any CPU
{FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|x64.Build.0 = Debug|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Debug|x86.Build.0 = Debug|Any CPU
{FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|x64.ActiveCfg = Release|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|x64.Build.0 = Release|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|x86.ActiveCfg = Release|Any CPU
+ {FFA85947-690E-496B-B21E-DB1800F0DCA9}.Release|x86.Build.0 = Release|Any CPU
{591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|x64.Build.0 = Debug|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Debug|x86.Build.0 = Debug|Any CPU
{591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|x64.ActiveCfg = Release|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|x64.Build.0 = Release|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|x86.ActiveCfg = Release|Any CPU
+ {591950E4-6377-4ECA-A386-8BD3FFE302F1}.Release|x86.Build.0 = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|x64.Build.0 = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Debug|x86.Build.0 = Debug|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|Any CPU.Build.0 = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|x64.ActiveCfg = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|x64.Build.0 = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|x86.ActiveCfg = Release|Any CPU
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -427,6 +915,7 @@ Global
{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929} = {6360202A-F931-4BBD-ADBD-C9A628EE59F8}
{6969D83E-567C-47A7-8E7F-7FE40940704E} = {6360202A-F931-4BBD-ADBD-C9A628EE59F8}
{061F07B8-067A-43E6-B0FF-250027EE705F} = {38ECA068-176F-463C-A1D7-044341D4CACB}
+ {27F25854-84CE-4474-91C2-5BFCE4C021DC} = {38ECA068-176F-463C-A1D7-044341D4CACB}
{1308D857-1D87-4973-A848-077F8BBD28DF} = {FA350BD6-C29D-40D9-BA47-FE5FBDFC84A0}
{BF4543A8-0731-4FDD-BB6B-0ADB9561F981} = {38ECA068-176F-463C-A1D7-044341D4CACB}
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68} = {BF4543A8-0731-4FDD-BB6B-0ADB9561F981}
@@ -436,6 +925,7 @@ Global
{75F9D855-026B-4BCB-90CE-3800F02FA0A7} = {583FFBBD-421C-4FB7-BBDA-F9CAF35A354A}
{E0B26803-010B-4198-8016-002242076B61} = {583FFBBD-421C-4FB7-BBDA-F9CAF35A354A}
{136F1E35-8B20-465C-8D42-30A5A0D0DA1F} = {583FFBBD-421C-4FB7-BBDA-F9CAF35A354A}
+ {12C4A556-E62E-4EC0-BCD9-E9D4E1F3D430} = {BF4543A8-0731-4FDD-BB6B-0ADB9561F981}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {88B478F4-FD3B-4C24-9E84-4FAAF0254397}
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 3b38f1b02..01d349288 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -24,16 +24,12 @@ steps:
script: |
dotnet workload install aspire
-- task: NuGetToolInstaller@1
- displayName: 'Install NuGet >=6.3.0-0'
- inputs:
- versionSpec: '>=6.3.0-0'
- checkLatest: true
-
-- task: NuGetCommand@2
+# Replaced NuGet tasks with dotnet CLI commands to fix Ubuntu 24.04 compatibility
+- task: DotNetCoreCLI@2
+ displayName: 'dotnet restore'
inputs:
- command: 'restore'
- restoreSolution: '**/*.sln'
+ command: 'restore'
+ projects: '**/*.sln'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
diff --git a/src/Business/Grand.Business.Common/Services/Directory/GroupService.cs b/src/Business/Grand.Business.Common/Services/Directory/GroupService.cs
index b3a041e25..7d7e72b0b 100644
--- a/src/Business/Grand.Business.Common/Services/Directory/GroupService.cs
+++ b/src/Business/Grand.Business.Common/Services/Directory/GroupService.cs
@@ -145,7 +145,7 @@ public class GroupService : IGroupService
bool? isSystem = null)
{
ArgumentNullException.ThrowIfNull(customer);
- ArgumentNullException.ThrowIfNullOrEmpty(customerGroupSystemName);
+ ArgumentException.ThrowIfNullOrEmpty(customerGroupSystemName);
var customerGroup = await GetCustomerGroupBySystemName(customerGroupSystemName);
if (customerGroup == null)
@@ -160,9 +160,9 @@ public class GroupService : IGroupService
return result;
}
- public Task<bool> IsStaff(Customer customer)
+ public Task<bool> IsStoreManager(Customer customer)
{
- return IsInCustomerGroup(customer, SystemCustomerGroupNames.Staff, true, true);
+ return IsInCustomerGroup(customer, SystemCustomerGroupNames.StoreManager, true, true);
}
public Task<bool> IsAdmin(Customer customer)
diff --git a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
index 2195c7c1f..fcfef781b 100644
--- a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
+++ b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
@@ -11,6 +11,7 @@ public class PermissionProvider : IPermissionProvider
return [
StandardPermission.ManageAccessAdminPanel,
StandardPermission.ManageAccessVendorPanel,
+ StandardPermission.ManageAccessStoreManagerPanel,
StandardPermission.AllowCustomerImpersonation,
StandardPermission.ManageProducts,
StandardPermission.ManageCategories,
@@ -195,9 +196,9 @@ public class PermissionProvider : IPermissionProvider
]
},
new DefaultPermission {
- CustomerGroupSystemName = SystemCustomerGroupNames.Staff,
+ CustomerGroupSystemName = SystemCustomerGroupNames.StoreManager,
Permissions = [
- StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.ManageAccessStoreManagerPanel,
StandardPermission.ManageProducts,
StandardPermission.ManageFiles,
StandardPermission.ManagePictures,
diff --git a/src/Business/Grand.Business.Core/Interfaces/Common/Directory/IGroupService.cs b/src/Business/Grand.Business.Core/Interfaces/Common/Directory/IGroupService.cs
index 2dc2e3368..c527bc52f 100644
--- a/src/Business/Grand.Business.Core/Interfaces/Common/Directory/IGroupService.cs
+++ b/src/Business/Grand.Business.Core/Interfaces/Common/Directory/IGroupService.cs
@@ -23,7 +23,7 @@ public interface IGroupService
/// </summary>
/// <param name="customer">Customer</param>
/// <returns>Result</returns>
- Task<bool> IsStaff(Customer customer);
+ Task<bool> IsStoreManager(Customer customer);
/// <summary>
/// Gets a value indicating whether customer is administrator
diff --git a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
index f70f3847a..5d190b856 100644
--- a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
+++ b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
@@ -387,22 +387,12 @@ public class CatalogSettings : ISettings
/// <summary>
/// Gets or sets the default value to use for Category page size options (for new categories)
/// </summary>
- public string DefaultCategoryPageSizeOptions { get; set; }
+ public string DefaultPageSizeOptions { get; set; }
/// <summary>
/// Gets or sets the default value to use for Category page size (for new categories)
/// </summary>
- public int DefaultCategoryPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the default value to use for Collection page size options (for new collections)
- /// </summary>
- public string DefaultCollectionPageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets the default value to use for Collection page size (for new collections)
- /// </summary>
- public int DefaultCollectionPageSize { get; set; }
+ public int DefaultPageSize { get; set; }
/// <summary>
/// Gets or sets the default value to use show extra field quantity on catalog pages
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettings.cs b/src/Core/Grand.Domain/Common/CaptchaSettings.cs
similarity index 92%
rename from src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettings.cs
rename to src/Core/Grand.Domain/Common/CaptchaSettings.cs
index f83193114..d9a941634 100644
--- a/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettings.cs
+++ b/src/Core/Grand.Domain/Common/CaptchaSettings.cs
@@ -1,6 +1,6 @@
using Grand.Domain.Configuration;
-namespace Grand.Web.Common.Security.Captcha;
+namespace Grand.Domain.Common;
/// <summary>
/// CAPTCHA settings
@@ -106,4 +106,20 @@ public class CaptchaSettings : ISettings
/// reCAPTCHA language
/// </summary>
public string ReCaptchaLanguage { get; set; }
+}
+
+/// <summary>
+/// Represents a reCAPTCHA version
+/// </summary>
+public enum GoogleReCaptchaVersion
+{
+ /// <summary>
+ /// Version 2.0
+ /// </summary>
+ V2 = 2,
+
+ /// <summary>
+ /// Version 3.0
+ /// </summary>
+ V3 = 3
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
index c2dd3ca56..47b777a28 100644
--- a/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
+++ b/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
@@ -10,7 +10,7 @@ public static class SystemCustomerGroupNames
public const string Vendors = "Vendors";
- public const string Staff = "Staff";
+ public const string StoreManager = "StoreManager";
public const string SalesManager = "SalesManager";
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs b/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
index 9010b8594..705b70f72 100644
--- a/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
+++ b/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
@@ -4,6 +4,7 @@ public static class PermissionSystemName
{
public const string AccessAdminPanel = "AccessAdminPanel";
public const string AccessVendorPanel = "AccessVendorPanel";
+ public const string AccessStorePanel = "AccessStorePanel";
public const string AllowCustomerImpersonation = "AllowCustomerImpersonation";
public const string Products = "ManageProducts";
public const string Categories = "ManageCategories";
diff --git a/src/Core/Grand.Domain/Permissions/StandardPermissionStore.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionStore.cs
new file mode 100644
index 000000000..40ff3e8ba
--- /dev/null
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionStore.cs
@@ -0,0 +1,15 @@
+namespace Grand.Domain.Permissions;
+
+/// <summary>
+/// Standard permissions
+/// </summary>
+public static partial class StandardPermission
+{
+ //admin area permissions
+ public static readonly Permission ManageAccessStoreManagerPanel = new() {
+ Name = "Access store manager panel",
+ SystemName = PermissionSystemName.AccessStorePanel,
+ Area = "Store area",
+ Category = "Access Store"
+ };
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Infrastructure/IWorkContext.cs b/src/Core/Grand.Infrastructure/IWorkContext.cs
index c233e4381..37d8bf7f8 100644
--- a/src/Core/Grand.Infrastructure/IWorkContext.cs
+++ b/src/Core/Grand.Infrastructure/IWorkContext.cs
@@ -1,6 +1,7 @@
using Grand.Domain.Customers;
using Grand.Domain.Directory;
using Grand.Domain.Localization;
+using Grand.Domain.Stores;
using Grand.Domain.Tax;
using Grand.Domain.Vendors;
@@ -36,6 +37,11 @@ public interface IWorkContext
/// </summary>
Currency WorkingCurrency { get; }
+ /// <summary>
+ /// Get the store manager
+ /// </summary>
+ Store StoreManager { get; }
+
/// <summary>
/// Get current tax display type
/// </summary>
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaResponse.cs b/src/Core/Grand.SharedKernel/Captcha/GoogleReCaptchaResponse.cs
similarity index 84%
rename from src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaResponse.cs
rename to src/Core/Grand.SharedKernel/Captcha/GoogleReCaptchaResponse.cs
index 0a173a207..045d56be6 100644
--- a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaResponse.cs
+++ b/src/Core/Grand.SharedKernel/Captcha/GoogleReCaptchaResponse.cs
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
-namespace Grand.Web.Common.Security.Captcha;
+namespace Grand.SharedKernel.Captcha;
public class GoogleReCaptchaResponse
{
diff --git a/src/Core/Grand.SharedKernel/Captcha/IGoogleReCaptchaValidator.cs b/src/Core/Grand.SharedKernel/Captcha/IGoogleReCaptchaValidator.cs
new file mode 100644
index 000000000..920c41d47
--- /dev/null
+++ b/src/Core/Grand.SharedKernel/Captcha/IGoogleReCaptchaValidator.cs
@@ -0,0 +1,5 @@
+namespace Grand.SharedKernel.Captcha;
+public interface IGoogleReCaptchaValidator
+{
+ Task<GoogleReCaptchaResponse> Validate(string response);
+}
diff --git a/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs b/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs
index 2847ce2e1..9bf265a8a 100644
--- a/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs
+++ b/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs
@@ -10,6 +10,7 @@ public static class PermissionExtensions
return [
StandardPermission.ManageAccessAdminPanel,
StandardPermission.ManageAccessVendorPanel,
+ StandardPermission.ManageAccessStoreManagerPanel,
StandardPermission.AllowCustomerImpersonation,
StandardPermission.ManageProducts,
StandardPermission.ManageCategories,
@@ -194,9 +195,9 @@ public static class PermissionExtensions
]
},
new DefaultPermission {
- CustomerGroupSystemName = SystemCustomerGroupNames.Staff,
+ CustomerGroupSystemName = SystemCustomerGroupNames.StoreManager,
Permissions = [
- StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.ManageAccessStoreManagerPanel,
StandardPermission.ManageProducts,
StandardPermission.ManageFiles,
StandardPermission.ManagePictures,
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs
index d961e0ef5..e37ee28bd 100644
--- a/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs
@@ -40,10 +40,10 @@ public partial class InstallationService
await _customerGroupRepository.InsertAsync(crVendors);
var crStaff = new CustomerGroup {
- Name = "Staff",
+ Name = "Store manager",
Active = true,
IsSystem = true,
- SystemName = SystemCustomerGroupNames.Staff
+ SystemName = SystemCustomerGroupNames.StoreManager
};
await _customerGroupRepository.InsertAsync(crStaff);
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs
index 3d38c0a85..e8cd1697f 100644
--- a/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs
@@ -161,7 +161,19 @@ public partial class InstallationService
"<p>Manage your product catalog, oversee customer orders, and streamline your shipping processes. Your vendor dashboard is the command center for your success. Stay organized, serve your customers efficiently, and watch your business thrive.</p>",
PageLayoutId = defaultPageLayout.Id,
Published = true
+ },
+ new() {
+ SystemName = "StorePortalInfo",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "Welcome to our Store Management Hub!",
+ Body =
+ "<p>Manage your product catalog, oversee customer orders, and streamline your shipping processes. Your store dashboard is the command center for your success. Stay organized, serve your customers efficiently, and watch your business thrive.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
}
+
};
pages.ForEach(x => _pageRepository.Insert(x));
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs
index 72363b574..615e8da8e 100644
--- a/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs
@@ -233,8 +233,8 @@ public partial class InstallationService
ProductsByTagAllowCustomersToSelectPageSize = true,
ProductsByTagPageSizeOptions = "6, 3, 9, 18",
CollectionsBlockItemsToDisplay = 2,
- DefaultCategoryPageSizeOptions = "6, 3, 9",
- DefaultCollectionPageSize = 6,
+ DefaultPageSizeOptions = "6, 3, 9",
+ DefaultPageSize = 6,
LimitOfFeaturedProducts = 30,
SecondPictureOnCatalogPages = true
});
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/GroupServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/GroupServiceTests.cs
index eb69d74ca..a902531d1 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/GroupServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/GroupServiceTests.cs
@@ -111,12 +111,12 @@ public class GroupServiceTests
{
//Arrange
var customerGroup = new CustomerGroup
- { IsSystem = true, SystemName = SystemCustomerGroupNames.Staff, Active = true };
+ { IsSystem = true, SystemName = SystemCustomerGroupNames.StoreManager, Active = true };
await _groupService.InsertCustomerGroup(customerGroup);
var customer = new Customer();
customer.Groups.Add(customerGroup.Id);
//Act
- var result = await _groupService.IsStaff(customer);
+ var result = await _groupService.IsStoreManager(customer);
//Assert
Assert.IsTrue(result);
}
diff --git a/src/Tests/Grand.Web.Admin.Tests/Grand.Web.Admin.Tests.csproj b/src/Tests/Grand.Web.Admin.Tests/Grand.Web.Admin.Tests.csproj
index 75730d097..d6b8f64bb 100644
--- a/src/Tests/Grand.Web.Admin.Tests/Grand.Web.Admin.Tests.csproj
+++ b/src/Tests/Grand.Web.Admin.Tests/Grand.Web.Admin.Tests.csproj
@@ -19,6 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
+ <ProjectReference Include="..\..\Web\Grand.Web.AdminShared\Grand.Web.AdminShared.csproj" />
<ProjectReference Include="..\..\Web\Grand.Web.Admin\Grand.Web.Admin.csproj" />
</ItemGroup>
</Project>
diff --git a/src/Tests/Grand.Web.Admin.Tests/MenuViewModelServiceTests.cs b/src/Tests/Grand.Web.Admin.Tests/MenuViewModelServiceTests.cs
index c2aeeaa66..d29671bc3 100644
--- a/src/Tests/Grand.Web.Admin.Tests/MenuViewModelServiceTests.cs
+++ b/src/Tests/Grand.Web.Admin.Tests/MenuViewModelServiceTests.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.System.Admin;
using Grand.Domain.Admin;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Mapper;
-using Grand.Web.Admin.Models.Menu;
-using Grand.Web.Admin.Services;
+using Grand.Web.AdminShared.Mapper;
+using Grand.Web.AdminShared.Models.Menu;
+using Grand.Web.AdminShared.Services;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
diff --git a/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/MultiPicture.cshtml b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/MultiPicture.cshtml
index 4eb6ca580..259ee399a 100644
--- a/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/MultiPicture.cshtml
+++ b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/MultiPicture.cshtml
@@ -32,7 +32,10 @@
Reference: '@reference',
ObjectId: '@objectId'
},
- inputName: "files"
+ inputName: "files",
+ customHeaders: {
+ 'X-CSRF-TOKEN': $('input[name="__RequestVerificationToken"]').val()
+ }
},
template: "@(clientId)-qq-template",
multiple: true,
diff --git a/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/Picture.cshtml b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/Picture.cshtml
index 178cc460d..9daab1f75 100644
--- a/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/Picture.cshtml
+++ b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/Picture.cshtml
@@ -44,7 +44,10 @@ else
Reference: '@ViewData["Reference"]',
ObjectId: '@ViewData["ObjectId"]'
},
- inputName: "file"
+ inputName: "file",
+ customHeaders: {
+ 'X-CSRF-TOKEN': $('input[name="__RequestVerificationToken"]').val()
+ }
},
template: "@(clientId)-qq-template",
multiple: false,
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Login/Index.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Login/Index.cshtml
index 8e9692c50..0280ce38c 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Login/Index.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Login/Index.cshtml
@@ -1,4 +1,5 @@
-@model LoginModel
+@using Grand.Web.AdminShared.Models.Common
+@model LoginModel
@{
//page title
Layout = Constants.Layout_AdminLogin;
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Menu/Edit.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Menu/Edit.cshtml
index dcd2ec997..f2ec626e8 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Menu/Edit.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Menu/Edit.cshtml
@@ -1,5 +1,4 @@
@using Grand.Web.Admin.Components
-@using Grand.Web.Admin.Interfaces
@using Grand.Web.Common.TagHelpers.Admin
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model MenuModel
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Messages.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Messages.cshtml
index e6e6613c2..edfdf4950 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Messages.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Messages.cshtml
@@ -1,5 +1,5 @@
@using Constants = Grand.SharedUIResources.Constants
-@model Grand.Web.Admin.Models.PushNotifications.MessagesModel
+@model Grand.Web.AdminShared.Models.PushNotifications.MessagesModel
@inject AdminAreaSettings adminAreaSettings
@{
Layout = "_AdminLayout";
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Receivers.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Receivers.cshtml
index 0f418d92e..9532607e1 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Receivers.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Receivers.cshtml
@@ -1,4 +1,4 @@
-@model Grand.Web.Admin.Models.PushNotifications.ReceiversModel
+@model Grand.Web.AdminShared.Models.PushNotifications.ReceiversModel
@inject AdminAreaSettings adminAreaSettings
@{
Layout = "_AdminLayout";
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Send.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Send.cshtml
index 6ed580f1f..2a73e831b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Send.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/PushNotifications/Send.cshtml
@@ -1,4 +1,4 @@
-@model Grand.Web.Admin.Models.PushNotifications.PushModel
+@model Grand.Web.AdminShared.Models.PushNotifications.PushModel
@{
Layout = "_AdminLayout";
//page title
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
index c84af0ee4..2e04d9a56 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
@@ -640,11 +640,20 @@
</div>
<div class="form-group">
<div class="col-6 col-md-6 col-sm-6">
- <admin-label asp-for="DefaultCollectionPageSize" class="control-label"/>
+ <admin-label asp-for="DefaultPageSizeOptions" class="control-label"/>
</div>
<div class="col-6 col-md-6 col-sm-6">
- <admin-input asp-for="DefaultCollectionPageSize"/>
- <span asp-validation-for="DefaultCollectionPageSize"></span>
+ <admin-input asp-for="DefaultPageSizeOptions"/>
+ <span asp-validation-for="DefaultPageSizeOptions"></span>
+ </div>
+</div>
+<div class="form-group">
+ <div class="col-6 col-md-6 col-sm-6">
+ <admin-label asp-for="DefaultPageSize" class="control-label"/>
+ </div>
+ <div class="col-6 col-md-6 col-sm-6">
+ <admin-input asp-for="DefaultPageSize"/>
+ <span asp-validation-for="DefaultPageSize"></span>
</div>
</div>
<div class="form-group">
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLoginLayout.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLoginLayout.cshtml
index 305148c5b..d6b21c399 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLoginLayout.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLoginLayout.cshtml
@@ -1,4 +1,5 @@
@using Constants = Grand.SharedUIResources.Constants
+@using Grand.Web.AdminShared.Models.Common
@model LoginModel
@{
//page title
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml
index 0a6a036fd..9af56268e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/_ViewImports.cshtml
@@ -23,37 +23,40 @@
@using Grand.Web.Common.Page
@using Grand.Web.Common.Link;
@using Grand.Web.Admin.Extensions;
-@using Grand.Web.Admin.Models.Affiliates
-@using Grand.Web.Admin.Models.Blogs
-@using Grand.Web.Admin.Models.Catalog
-@using Grand.Web.Admin.Models.Cms
-@using Grand.Web.Admin.Models.Common
-@using Grand.Web.Admin.Models.Courses
-@using Grand.Web.Admin.Models.Country
-@using Grand.Web.Admin.Models.Customers
-@using Grand.Web.Admin.Models.Directory
-@using Grand.Web.Admin.Models.Discounts
-@using Grand.Web.Admin.Models.Documents
-@using Grand.Web.Admin.Models.ExternalAuthentication
-@using Grand.Web.Admin.Models.Home
-@using Grand.Web.Admin.Models.Layouts
-@using Grand.Web.Admin.Models.Localization
-@using Grand.Web.Admin.Models.Menu
-@using Grand.Web.Admin.Models.Messages
-@using Grand.Web.Admin.Models.News
-@using Grand.Web.Admin.Models.Orders
-@using Grand.Web.Admin.Models.Payments
-@using Grand.Web.Admin.Models.Plugins
-@using Grand.Web.Admin.Models.Settings
-@using Grand.Web.Admin.Models.Shipping
-@using Grand.Web.Admin.Models.ShoppingCart
-@using Grand.Web.Admin.Models.Stores
-@using Grand.Web.Admin.Models.Tasks
-@using Grand.Web.Admin.Models.Tax
-@using Grand.Web.Admin.Models.Pages
-@using Grand.Web.Admin.Models.Vendors
-@using Grand.Web.Admin.Models.Knowledgebase
-@using Grand.Web.Admin.Models.Permissions
+@using Grand.Web.AdminShared.Extensions;
+@using Grand.Web.AdminShared.Models.Affiliates
+@using Grand.Web.AdminShared.Models.Blogs
+@using Grand.Web.AdminShared.Models.Catalog
+@using Grand.Web.AdminShared.Models.Cms
+@using Grand.Web.AdminShared.Models.Common
+@using Grand.Web.AdminShared.Models.Courses
+@using Grand.Web.AdminShared.Models.Country
+@using Grand.Web.AdminShared.Models.Customers
+@using Grand.Web.AdminShared.Models.Directory
+@using Grand.Web.AdminShared.Models.Documents
+@using Grand.Web.AdminShared.Models.Discounts
+@using Grand.Web.AdminShared.Models.ExternalAuthentication
+@using Grand.Web.AdminShared.Models.Home
+@using Grand.Web.AdminShared.Models.Layouts
+@using Grand.Web.AdminShared.Models.Localization
+@using Grand.Web.AdminShared.Models.Menu
+@using Grand.Web.AdminShared.Models.Messages
+@using Grand.Web.AdminShared.Models.News
+@using Grand.Web.AdminShared.Models.Orders
+@using Grand.Web.AdminShared.Models.Payments
+@using Grand.Web.AdminShared.Models.Plugins
+@using Grand.Web.AdminShared.Models.Settings
+@using Grand.Web.AdminShared.Models.Shipping
+@using Grand.Web.AdminShared.Models.ShoppingCart
+@using Grand.Web.AdminShared.Models.Stores
+@using Grand.Web.AdminShared.Models.Tasks
+@using Grand.Web.AdminShared.Models.Tax
+@using Grand.Web.AdminShared.Models.Pages
+@using Grand.Web.AdminShared.Models.Vendors
+@using Grand.Web.AdminShared.Models.Knowledgebase
+@using Grand.Web.AdminShared.Models.Permissions
@using Grand.Web.Common.Localization
+
@inject LocService Loc
-@inject IEnumTranslationService EnumTranslationService
\ No newline at end of file
+@inject IEnumTranslationService EnumTranslationService
+@using Grand.Web.AdminShared.Interfaces
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Components/AdminLanguageSelector.cs b/src/Web/Grand.Web.Admin/Components/AdminLanguageSelector.cs
index 222286b3a..775a38491 100644
--- a/src/Web/Grand.Web.Admin/Components/AdminLanguageSelector.cs
+++ b/src/Web/Grand.Web.Admin/Components/AdminLanguageSelector.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/AdminWidget.cs b/src/Web/Grand.Web.Admin/Components/AdminWidget.cs
index a8fcafb6d..5d1e038b8 100644
--- a/src/Web/Grand.Web.Admin/Components/AdminWidget.cs
+++ b/src/Web/Grand.Web.Admin/Components/AdminWidget.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Infrastructure;
-using Grand.Web.Admin.Models.Cms;
+using Grand.Web.AdminShared.Models.Cms;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/StoreScope.cs b/src/Web/Grand.Web.Admin/Components/StoreScope.cs
index 0468e82ef..340819741 100644
--- a/src/Web/Grand.Web.Admin/Components/StoreScope.cs
+++ b/src/Web/Grand.Web.Admin/Components/StoreScope.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Infrastructure;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.Components;
using Grand.Web.Common.Helpers;
using Grand.Web.Common.Models;
@@ -45,7 +45,7 @@ public class StoreScopeViewComponent : BaseAdminViewComponent
if (allStores.Count < 2)
return Content("");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
allStores = allStores.Where(x => x.Id == _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
var model = new StoreScopeModel();
diff --git a/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
index cf4ba175c..f29f4fce8 100644
--- a/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
@@ -2,8 +2,8 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs b/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
index 676425161..e8671dd2d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
@@ -2,8 +2,8 @@
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Affiliates;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Affiliates;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs b/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
index 828f2f5bb..e6c235c95 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
@@ -2,8 +2,8 @@
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/BaseAdminController.cs b/src/Web/Grand.Web.Admin/Controllers/BaseAdminController.cs
index 770f1c546..49774c2b5 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BaseAdminController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BaseAdminController.cs
@@ -16,37 +16,6 @@ namespace Grand.Web.Admin.Controllers;
[AuthorizeMenu]
public abstract class BaseAdminController : BaseController
{
- /// <summary>
- /// Save selected TAB index
- /// </summary>
- /// <param name="index">Idnex to save; null to automatically detect it</param>
- /// <param name="persistForTheNextRequest">A value indicating whether a message should be persisted for the next request</param>
- protected async Task SaveSelectedTabIndex(int? index = null, bool persistForTheNextRequest = true)
- {
- if (!index.HasValue)
- {
- var form = await HttpContext.Request.ReadFormAsync();
- var tabindex = form["selected-tab-index"];
- if (tabindex.Count > 0)
- {
- if (int.TryParse(tabindex[0], out var tmp)) index = tmp;
- }
- else
- {
- index = 1;
- }
- }
-
- if (index.HasValue)
- {
- var dataKey = "Grand.selected-tab-index";
- if (persistForTheNextRequest)
- TempData[dataKey] = index;
- else
- ViewData[dataKey] = index;
- }
- }
-
/// <summary>
/// Get active store scope (for multi-store configuration mode)
/// </summary>
@@ -61,13 +30,17 @@ public abstract class BaseAdminController : BaseController
if (stores.Count < 2)
return stores.FirstOrDefault()?.Id;
- if (await groupService.IsStaff(workContext.CurrentCustomer)) return workContext.CurrentCustomer.StaffStoreId;
+ if (await groupService.IsStoreManager(workContext.CurrentCustomer)) return workContext.CurrentCustomer.StaffStoreId;
var storeId =
workContext.CurrentCustomer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames
.AdminAreaStoreScopeConfiguration);
- if (string.IsNullOrEmpty(storeId)) return stores.FirstOrDefault()?.Id;
+ if (string.IsNullOrEmpty(storeId))
+ {
+ return stores.First()?.Id;
+ }
+
var store = await storeService.GetStoreById(storeId);
- return store != null ? store.Id : stores.FirstOrDefault()?.Id;
+ return store != null ? store.Id : stores.First()?.Id;
}
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Controllers/BlogController.cs b/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
index 88ff7e391..5dd83c6bf 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
@@ -7,10 +7,11 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Blogs;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Blogs;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -110,7 +111,7 @@ public class BlogController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
var blogPost = await _blogViewModelService.InsertBlogPostModel(model);
Success(_translationService.GetResource("Admin.Content.Blog.BlogPosts.Added"));
@@ -131,7 +132,7 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!blogPost.LimitedToStores || (blogPost.LimitedToStores &&
blogPost.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -172,13 +173,13 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogPost.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = blogPost.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
blogPost = await _blogViewModelService.UpdateBlogPostModel(model, blogPost);
@@ -221,7 +222,7 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogPost.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = blogPost.Id });
@@ -320,7 +321,7 @@ public class BlogController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
var blogCategory = model.ToEntity();
@@ -351,7 +352,7 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("CategoryList");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!blogCategory.LimitedToStores || (blogCategory.LimitedToStores &&
blogCategory.Stores.Contains(
@@ -387,13 +388,13 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("CategoryList");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogCategory.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("CategoryEdit", new { id = blogCategory.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
blogCategory = model.ToEntity(blogCategory);
@@ -435,7 +436,7 @@ public class BlogController : BaseAdminController
//No blog post found with the specified id
return RedirectToAction("CategoryList");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogcategory.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("CategoryEdit", new { id = blogcategory.Id });
@@ -487,7 +488,7 @@ public class BlogController : BaseAdminController
if (blogCategory == null)
return ErrorForKendoGridJson("blogCategory no exists");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogCategory.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return ErrorForKendoGridJson("blogCategory no permission");
@@ -528,7 +529,7 @@ public class BlogController : BaseAdminController
{
var gridModel = new DataSourceResult();
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var posts = await _blogService.GetAllBlogPosts(model.SearchStoreId, blogPostName: model.SearchBlogTitle,
@@ -593,7 +594,7 @@ public class BlogController : BaseAdminController
throw new ArgumentException("No comment found with the specified id");
var blogPost = await _blogService.GetBlogPostById(comment.BlogPostId);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!blogPost.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return ErrorForKendoGridJson("blogPost no permission");
diff --git a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
index c48b258ec..e0a1ad7eb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
@@ -1,18 +1,15 @@
using Grand.Business.Core.Dto;
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Catalog.Brands;
-using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
-using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
+using Grand.Domain.Permissions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -29,48 +26,28 @@ public class BrandController : BaseAdminController
public BrandController(
IBrandViewModelService brandViewModelService,
IBrandService brandService,
- IContextAccessor contextAccessor,
IStoreService storeService,
ILanguageService languageService,
ITranslationService translationService,
- IGroupService groupService,
IPictureViewModelService pictureViewModelService)
{
_brandViewModelService = brandViewModelService;
_brandService = brandService;
- _contextAccessor = contextAccessor;
_storeService = storeService;
_languageService = languageService;
_translationService = translationService;
- _groupService = groupService;
_pictureViewModelService = pictureViewModelService;
}
#endregion
- #region Utilities
-
- protected async Task<(bool allow, string message)> CheckAccessToBrand(Brand brand)
- {
- if (brand == null) return (false, "Brand not exists");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!(!brand.LimitedToStores || (brand.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- brand.LimitedToStores)))
- return (false, "This is not your collection");
- return (true, null);
- }
-
- #endregion
-
#region Fields
private readonly IBrandViewModelService _brandViewModelService;
private readonly IBrandService _brandService;
- private readonly IContextAccessor _contextAccessor;
private readonly IStoreService _storeService;
private readonly ILanguageService _languageService;
private readonly ITranslationService _translationService;
- private readonly IGroupService _groupService;
private readonly IPictureViewModelService _pictureViewModelService;
#endregion
@@ -84,12 +61,9 @@ public class BrandController : BaseAdminController
public async Task<IActionResult> List()
{
- var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var model = new BrandListModel();
- model.AvailableStores.Add(new SelectListItem
- { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var s in (await _storeService.GetAllStores()).Where(x =>
- x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
+ 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 });
return View(model);
@@ -99,8 +73,6 @@ public class BrandController : BaseAdminController
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, BrandListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var brands = await _brandService.GetAllBrands(model.SearchBrandName,
model.SearchStoreId, command.Page - 1, command.PageSize, true);
var gridModel = new DataSourceResult {
@@ -126,8 +98,8 @@ public class BrandController : BaseAdminController
//discounts
await _brandViewModelService.PrepareDiscountModel(model, null, true);
//default values
- model.PageSize = catalogSettings.DefaultCollectionPageSize;
- model.PageSizeOptions = catalogSettings.DefaultCollectionPageSizeOptions;
+ model.PageSize = catalogSettings.DefaultPageSize;
+ model.PageSizeOptions = catalogSettings.DefaultPageSizeOptions;
model.Published = true;
model.AllowCustomersToSelectPageSize = true;
//sort options
@@ -143,9 +115,6 @@ public class BrandController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
var collection = await _brandViewModelService.InsertBrandModel(model);
Success(_translationService.GetResource("Admin.Catalog.Brands.Added"));
return continueEditing ? RedirectToAction("Edit", new { id = collection.Id }) : RedirectToAction("List");
@@ -170,21 +139,6 @@ public class BrandController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- if (!brand.LimitedToStores || (brand.LimitedToStores &&
- brand.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- brand.Stores.Count > 1))
- {
- Warning(_translationService.GetResource("Admin.Catalog.Brands.Permissions"));
- }
- else
- {
- if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("List");
- }
- }
-
var model = brand.ToModel();
//locales
await AddLocales(_languageService, model.Locales, (locale, languageId) =>
@@ -217,13 +171,8 @@ public class BrandController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = brand.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
brand = await _brandViewModelService.UpdateBrandModel(brand, model);
Success(_translationService.GetResource("Admin.Catalog.Brands.Updated"));
@@ -259,10 +208,6 @@ public class BrandController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = brand.Id });
-
if (ModelState.IsValid)
{
await _brandViewModelService.DeleteBrand(brand);
@@ -289,10 +234,6 @@ public class BrandController : BaseAdminController
if (string.IsNullOrEmpty(brand.PictureId))
return Content("Picture not exist");
- var permission = await CheckAccessToBrand(brand);
- if (!permission.allow)
- return Content(permission.message);
-
return View("Partials/PicturePopup",
await _pictureViewModelService.PreparePictureModel(brand.PictureId, brand.Id));
}
@@ -307,10 +248,6 @@ public class BrandController : BaseAdminController
if (brand == null)
throw new ArgumentException("No brand found with the specified id");
- var permission = await CheckAccessToBrand(brand);
- if (!permission.allow)
- return Content(permission.message);
-
if (string.IsNullOrEmpty(brand.PictureId))
throw new ArgumentException("No picture found with the specified id");
@@ -336,8 +273,7 @@ public class BrandController : BaseAdminController
{
try
{
- var bytes = await exportManager.Export(await _brandService.GetAllBrands(showHidden: true,
- storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId));
+ var bytes = await exportManager.Export(await _brandService.GetAllBrands(showHidden: true));
return File(bytes, "text/xls", "brands.xlsx");
}
catch (Exception exc)
diff --git a/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs b/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
index 4058c1d04..349bb0b2e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
@@ -8,8 +8,8 @@ using Grand.Domain.Messages;
using Grand.Infrastructure;
using Grand.SharedKernel;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
index df3133461..61cecf604 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
@@ -1,17 +1,14 @@
using Grand.Business.Core.Dto;
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Catalog.Categories;
-using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
-using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
+using Grand.Domain.Permissions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -29,43 +26,23 @@ public class CategoryController : BaseAdminController
ICategoryViewModelService categoryViewModelService,
ILanguageService languageService,
ITranslationService translationService,
- IContextAccessor contextAccessor,
- IGroupService groupService,
IPictureViewModelService pictureViewModelService)
{
_categoryService = categoryService;
_categoryViewModelService = categoryViewModelService;
_languageService = languageService;
_translationService = translationService;
- _contextAccessor = contextAccessor;
- _groupService = groupService;
_pictureViewModelService = pictureViewModelService;
}
#endregion
- #region Utilities
-
- protected async Task<(bool allow, string message)> CheckAccessToCategory(Category category)
- {
- if (category == null) return (false, "Category not exists");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!(!category.LimitedToStores || (category.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- category.LimitedToStores)))
- return (false, "This is not your category");
- return (true, null);
- }
-
- #endregion
-
#region Fields
private readonly ICategoryService _categoryService;
private readonly ICategoryViewModelService _categoryViewModelService;
private readonly ILanguageService _languageService;
private readonly ITranslationService _translationService;
- private readonly IContextAccessor _contextAccessor;
- private readonly IGroupService _groupService;
private readonly IPictureViewModelService _pictureViewModelService;
#endregion
@@ -79,7 +56,7 @@ public class CategoryController : BaseAdminController
public async Task<IActionResult> List()
{
- var model = await _categoryViewModelService.PrepareCategoryListModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ var model = await _categoryViewModelService.PrepareCategoryListModel(string.Empty);
return View(model);
}
@@ -87,11 +64,7 @@ public class CategoryController : BaseAdminController
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, CategoryListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var categories =
- await _categoryViewModelService.PrepareCategoryListModel(model, command.Page, command.PageSize);
+ var categories = await _categoryViewModelService.PrepareCategoryListModel(model, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
Data = categories.categoryListModel,
Total = categories.totalCount
@@ -106,7 +79,7 @@ public class CategoryController : BaseAdminController
[PermissionAuthorizeAction(PermissionActionName.Create)]
public async Task<IActionResult> Create()
{
- var model = await _categoryViewModelService.PrepareCategoryModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ var model = await _categoryViewModelService.PrepareCategoryModel(string.Empty);
//locales
await AddLocales(_languageService, model.Locales);
@@ -120,17 +93,13 @@ public class CategoryController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
var category = await _categoryViewModelService.InsertCategoryModel(model);
Success(_translationService.GetResource("Admin.Catalog.Categories.Added"));
return continueEditing ? RedirectToAction("Edit", new { id = category.Id }) : RedirectToAction("List");
}
//If we got this far, something failed, redisplay form
- model = await _categoryViewModelService.PrepareCategoryModel(model, null,
- _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model = await _categoryViewModelService.PrepareCategoryModel(model, null, string.Empty);
return View(model);
}
@@ -143,21 +112,6 @@ public class CategoryController : BaseAdminController
//No category found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- if (!category.LimitedToStores || (category.LimitedToStores &&
- category.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- category.Stores.Count > 1))
- {
- Warning(_translationService.GetResource("Admin.Catalog.Categories.Permissions"));
- }
- else
- {
- if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("List");
- }
- }
-
var model = category.ToModel();
//locales
await AddLocales(_languageService, model.Locales, (locale, languageId) =>
@@ -171,8 +125,7 @@ public class CategoryController : BaseAdminController
locale.SeName = category.GetSeName(languageId, false);
locale.Flag = category.GetTranslation(x => x.Flag, languageId, false);
});
- model = await _categoryViewModelService.PrepareCategoryModel(model, category,
- _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model = await _categoryViewModelService.PrepareCategoryModel(model, category, string.Empty);
return View(model);
}
@@ -187,32 +140,21 @@ public class CategoryController : BaseAdminController
//No category found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = category.Id });
-
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
category = await _categoryViewModelService.UpdateCategoryModel(category, model);
-
Success(_translationService.GetResource("Admin.Catalog.Categories.Updated"));
if (continueEditing)
{
//selected tab
await SaveSelectedTabIndex();
-
return RedirectToAction("Edit", new { id = category.Id });
}
-
return RedirectToAction("List");
}
//If we got this far, something failed, redisplay form
- model = await _categoryViewModelService.PrepareCategoryModel(model, category,
- _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model = await _categoryViewModelService.PrepareCategoryModel(model, category, string.Empty);
return View(model);
}
@@ -226,10 +168,6 @@ public class CategoryController : BaseAdminController
//No category found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = category.Id });
-
if (ModelState.IsValid)
{
await _categoryViewModelService.DeleteCategory(category);
@@ -253,10 +191,6 @@ public class CategoryController : BaseAdminController
if (string.IsNullOrEmpty(category.PictureId))
return Content("Picture not exist");
- var permission = await CheckAccessToCategory(category);
- if (!permission.allow)
- return Content(permission.message);
-
return View("Partials/PicturePopup",
await _pictureViewModelService.PreparePictureModel(category.PictureId, category.Id));
}
@@ -296,8 +230,7 @@ public class CategoryController : BaseAdminController
{
try
{
- var bytes = await exportManager.Export(await _categoryService.GetAllCategories(showHidden: true,
- storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId));
+ var bytes = await exportManager.Export(await _categoryService.GetAllCategories(showHidden: true));
return File(bytes, "text/xls", "categories.xlsx");
}
catch (Exception exc)
@@ -343,12 +276,7 @@ public class CategoryController : BaseAdminController
public async Task<IActionResult> ProductList(DataSourceRequest command, string categoryId)
{
var category = await _categoryService.GetCategoryById(categoryId);
- var permission = await CheckAccessToCategory(category);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
- var productCategories =
- await _categoryViewModelService.PrepareCategoryProductModel(categoryId, command.Page, command.PageSize);
+ var productCategories = await _categoryViewModelService.PrepareCategoryProductModel(categoryId, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
Data = productCategories.categoryProductModels,
Total = productCategories.totalCount
@@ -384,8 +312,7 @@ public class CategoryController : BaseAdminController
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> ProductAddPopup(string categoryId)
{
- var model = await _categoryViewModelService.PrepareAddCategoryProductModel(_contextAccessor.WorkContext.CurrentCustomer
- .StaffStoreId);
+ var model = await _categoryViewModelService.PrepareAddCategoryProductModel(string.Empty);
model.CategoryId = categoryId;
return View(model);
}
@@ -396,8 +323,7 @@ public class CategoryController : BaseAdminController
CategoryModel.AddCategoryProductModel model)
{
var gridModel = new DataSourceResult();
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
var products = await _categoryViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
gridModel.Data = products.products.ToList();
gridModel.Total = products.totalCount;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
index 12be9a0fb..0f41142c4 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
@@ -5,9 +5,9 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Directory;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
index 769823fc5..d871db579 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
@@ -1,18 +1,15 @@
using Grand.Business.Core.Dto;
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Catalog.Collections;
-using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
-using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
+using Grand.Domain.Permissions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -29,49 +26,28 @@ public class CollectionController : BaseAdminController
public CollectionController(
ICollectionViewModelService collectionViewModelService,
ICollectionService collectionService,
- IContextAccessor contextAccessor,
IStoreService storeService,
ILanguageService languageService,
ITranslationService translationService,
- IGroupService groupService,
IPictureViewModelService pictureViewModelService)
{
_collectionViewModelService = collectionViewModelService;
_collectionService = collectionService;
- _contextAccessor = contextAccessor;
_storeService = storeService;
_languageService = languageService;
_translationService = translationService;
- _groupService = groupService;
_pictureViewModelService = pictureViewModelService;
}
#endregion
- #region Utilities
-
- protected async Task<(bool allow, string message)> CheckAccessToCollection(Collection collection)
- {
- if (collection == null) return (false, "Collection not exists");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!(!collection.LimitedToStores ||
- (collection.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- collection.LimitedToStores)))
- return (false, "This is not your collection");
- return (true, null);
- }
-
- #endregion
-
#region Fields
private readonly ICollectionViewModelService _collectionViewModelService;
private readonly ICollectionService _collectionService;
- private readonly IContextAccessor _contextAccessor;
private readonly IStoreService _storeService;
private readonly ILanguageService _languageService;
private readonly ITranslationService _translationService;
- private readonly IGroupService _groupService;
private readonly IPictureViewModelService _pictureViewModelService;
#endregion
@@ -85,12 +61,9 @@ public class CollectionController : BaseAdminController
public async Task<IActionResult> List()
{
- var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var model = new CollectionListModel();
- model.AvailableStores.Add(new SelectListItem
- { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var s in (await _storeService.GetAllStores()).Where(x =>
- x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
+ 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 });
return View(model);
@@ -100,8 +73,6 @@ public class CollectionController : BaseAdminController
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, CollectionListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var collections = await _collectionService.GetAllCollections(model.SearchCollectionName,
model.SearchStoreId, command.Page - 1, command.PageSize, true);
var gridModel = new DataSourceResult {
@@ -127,8 +98,8 @@ public class CollectionController : BaseAdminController
//discounts
await _collectionViewModelService.PrepareDiscountModel(model, null, true);
//default values
- model.PageSize = catalogSettings.DefaultCollectionPageSize;
- model.PageSizeOptions = catalogSettings.DefaultCollectionPageSizeOptions;
+ model.PageSize = catalogSettings.DefaultPageSize;
+ model.PageSizeOptions = catalogSettings.DefaultPageSizeOptions;
model.Published = true;
model.AllowCustomersToSelectPageSize = true;
//sort options
@@ -144,9 +115,6 @@ public class CollectionController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
var collection = await _collectionViewModelService.InsertCollectionModel(model);
Success(_translationService.GetResource("Admin.Catalog.Collections.Added"));
return continueEditing ? RedirectToAction("Edit", new { id = collection.Id }) : RedirectToAction("List");
@@ -171,21 +139,6 @@ public class CollectionController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- if (!collection.LimitedToStores || (collection.LimitedToStores &&
- collection.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- collection.Stores.Count > 1))
- {
- Warning(_translationService.GetResource("Admin.Catalog.Collections.Permissions"));
- }
- else
- {
- if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("List");
- }
- }
-
var model = collection.ToModel();
//locales
await AddLocales(_languageService, model.Locales, (locale, languageId) =>
@@ -218,13 +171,8 @@ public class CollectionController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = collection.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
collection = await _collectionViewModelService.UpdateCollectionModel(collection, model);
Success(_translationService.GetResource("Admin.Catalog.Collections.Updated"));
@@ -232,14 +180,11 @@ public class CollectionController : BaseAdminController
{
//selected tab
await SaveSelectedTabIndex();
-
return RedirectToAction("Edit", new { id = collection.Id });
}
-
return RedirectToAction("List");
}
-
//If we got this far, something failed, redisplay form
//layouts
await _collectionViewModelService.PrepareLayoutsModel(model);
@@ -260,10 +205,6 @@ public class CollectionController : BaseAdminController
//No collection found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = collection.Id });
-
if (ModelState.IsValid)
{
await _collectionViewModelService.DeleteCollection(collection);
@@ -290,10 +231,6 @@ public class CollectionController : BaseAdminController
if (string.IsNullOrEmpty(collection.PictureId))
return Content("Picture not exist");
- var permission = await CheckAccessToCollection(collection);
- if (!permission.allow)
- return Content(permission.message);
-
return View("Partials/PicturePopup",
await _pictureViewModelService.PreparePictureModel(collection.PictureId, collection.Id));
}
@@ -304,13 +241,7 @@ public class CollectionController : BaseAdminController
{
if (ModelState.IsValid)
{
- var collection = await _collectionService.GetCollectionById(model.ObjectId);
- if (collection == null)
- throw new ArgumentException("No collection found with the specified id");
-
- var permission = await CheckAccessToCollection(collection);
- if (!permission.allow)
- return Content(permission.message);
+ var collection = await _collectionService.GetCollectionById(model.ObjectId) ?? throw new ArgumentException("No collection found with the specified id");
if (string.IsNullOrEmpty(collection.PictureId))
throw new ArgumentException("No picture found with the specified id");
@@ -337,8 +268,7 @@ public class CollectionController : BaseAdminController
{
try
{
- var bytes = await exportManager.Export(await _collectionService.GetAllCollections(showHidden: true,
- storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId));
+ var bytes = await exportManager.Export(await _collectionService.GetAllCollections(showHidden: true));
return File(bytes, "text/xls", "collections.xlsx");
}
catch (Exception exc)
@@ -384,13 +314,8 @@ public class CollectionController : BaseAdminController
public async Task<IActionResult> ProductList(DataSourceRequest command, string collectionId)
{
var collection = await _collectionService.GetCollectionById(collectionId);
- var permission = await CheckAccessToCollection(collection);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
- var (collectionProductModels, totalCount) =
- await _collectionViewModelService.PrepareCollectionProductModel(collectionId, _contextAccessor.StoreContext.CurrentStore.Id,
- command.Page, command.PageSize);
+ var (collectionProductModels, totalCount) = await _collectionViewModelService.PrepareCollectionProductModel(collectionId, string.Empty, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
Data = collectionProductModels.ToList(),
@@ -428,8 +353,7 @@ public class CollectionController : BaseAdminController
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> ProductAddPopup(string collectionId)
{
- var model = await _collectionViewModelService.PrepareAddCollectionProductModel(_contextAccessor.WorkContext.CurrentCustomer
- .StaffStoreId);
+ var model = await _collectionViewModelService.PrepareAddCollectionProductModel(string.Empty);
model.CollectionId = collectionId;
return View(model);
}
@@ -439,8 +363,6 @@ public class CollectionController : BaseAdminController
public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command,
CollectionModel.AddCollectionProductModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var products = await _collectionViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
Data = products.products.ToList(),
diff --git a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
index 318bc65e4..3fe355eb7 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs b/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
index 5e9a5d67c..7cd57f65b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CountryController.cs b/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
index d2433fae2..da9404f77 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
@@ -4,10 +4,10 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.ExportImport;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Country;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Country;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CourseController.cs b/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
index f2f4d262f..24013410f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
@@ -7,14 +7,15 @@ using Grand.Domain.Permissions;
using Grand.Domain.Courses;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Courses;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.AdminShared.Extensions;
namespace Grand.Web.Admin.Controllers;
@@ -154,7 +155,7 @@ public class CourseController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
var course = await _courseViewModelService.InsertCourseModel(model);
@@ -176,7 +177,7 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!course.LimitedToStores || (course.LimitedToStores &&
course.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -219,13 +220,13 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!course.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = course.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
course = await _courseViewModelService.UpdateCourseModel(course, model);
@@ -257,7 +258,7 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!course.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = course.Id });
@@ -393,7 +394,7 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!course.LimitedToStores || (course.LimitedToStores &&
course.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -423,7 +424,7 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!course.LimitedToStores || (course.LimitedToStores &&
course.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -467,7 +468,7 @@ public class CourseController : BaseAdminController
//No course found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!course.LimitedToStores || (course.LimitedToStores &&
course.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -502,7 +503,7 @@ public class CourseController : BaseAdminController
//No category found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!course.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = course.Id });
if (ModelState.IsValid)
@@ -540,7 +541,7 @@ public class CourseController : BaseAdminController
//No category found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!course.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = course.Id });
await _courseViewModelService.DeleteCourseLesson(lesson);
diff --git a/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs b/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
index 940718228..45d1b88e0 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
@@ -6,9 +6,9 @@ using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Infrastructure.Caching;
using Grand.SharedKernel;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
index 6dee3b44e..1e748ebf0 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
@@ -2,8 +2,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
index 8ad48cd27..f73d8046c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
@@ -17,15 +17,16 @@ using Grand.Infrastructure;
using Grand.SharedKernel;
using Grand.SharedKernel.Extensions;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Models;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.AdminShared.Extensions;
namespace Grand.Web.Admin.Controllers;
@@ -696,7 +697,7 @@ public class CustomerController : BaseAdminController
var model = new OrderListModel {
CustomerId = customerId
};
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var (orderModels, totalCount) =
@@ -723,7 +724,7 @@ public class CustomerController : BaseAdminController
if (order == null)
throw new ArgumentException("No order found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer) &&
order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
return Json(new DataSourceResult {
Data = null,
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
index ddb19bf64..f770079de 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
@@ -5,9 +5,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
index 3abe0b1e9..2975d5e61 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Customers;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs b/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
index f41d4e91d..d5f3a3e9d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
@@ -11,16 +11,16 @@ using Grand.Domain.Permissions;
using Grand.Domain;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
using MediatR;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.AdminShared.Models.Discounts;
+using Grand.Web.AdminShared.Extensions;
namespace Grand.Web.Admin.Controllers;
@@ -110,7 +110,7 @@ public class DiscountController : BaseAdminController
{
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
var discount = await _discountViewModelService.InsertDiscountModel(model);
@@ -133,7 +133,7 @@ public class DiscountController : BaseAdminController
//No discount found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
{
if (!discount.LimitedToStores || (discount.LimitedToStores &&
discount.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
@@ -164,13 +164,13 @@ public class DiscountController : BaseAdminController
//No discount found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!discount.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = discount.Id });
if (ModelState.IsValid)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
discount = await _discountViewModelService.UpdateDiscountModel(discount, model);
@@ -201,7 +201,7 @@ public class DiscountController : BaseAdminController
//No discount found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
if (!discount.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return RedirectToAction("Edit", new { id = discount.Id });
diff --git a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs b/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
index 4b2394a81..a9ab6cbf2 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.Documents;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Documents;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs b/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
index 6016e4e3b..967dd0502 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
+using Grand.Web.AdminShared.Interfaces;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs b/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
index e0ba39e55..e93b33183 100644
--- a/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
@@ -5,9 +5,9 @@ using Grand.Domain.Permissions;
using Grand.Domain.Messages;
using Grand.Infrastructure.Caching;
using Grand.SharedKernel;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs b/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
index 7ab4775a7..66de5cb3e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
@@ -4,8 +4,8 @@ using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Infrastructure.Plugins;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.ExternalAuthentication;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.ExternalAuthentication;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs b/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
index 96a1c81f6..e531579c2 100644
--- a/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Checkout.GiftVouchers;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/HomeController.cs b/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
index 9d76631bd..0cca1e8da 100644
--- a/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
@@ -10,7 +10,7 @@ using Grand.Domain.Customers;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Home;
+using Grand.Web.AdminShared.Models.Home;
using MediatR;
using Microsoft.AspNetCore.Mvc;
@@ -53,7 +53,7 @@ public class HomeController : BaseAdminController
var model = new DashboardActivityModel();
var storeId = string.Empty;
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
model.OrdersPending =
@@ -137,7 +137,7 @@ public class HomeController : BaseAdminController
if (storeid != null)
storeid = storeid.Trim();
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
returnUrl = Url.Action("Index", "Home", new { area = Constants.AreaAdmin });
var store = await _storeService.GetStoreById(storeid);
@@ -196,17 +196,9 @@ public class HomeController : BaseAdminController
return Json(result);
}
- public async Task<IActionResult> AccessDenied()
+ public IActionResult AccessDenied()
{
- var currentCustomer = _contextAccessor.WorkContext.CurrentCustomer;
- if (currentCustomer == null || await _groupService.IsGuest(currentCustomer))
- {
- _logger.LogInformation("Access denied to anonymous request");
- return View();
- }
-
- _logger.LogInformation("Access denied to user #{CurrentCustomerEmail}", currentCustomer.Email);
-
+ _logger.LogInformation("Access denied");
return View();
}
diff --git a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
index fad94bbe7..9904c1455 100644
--- a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Knowledgebase;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs b/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
index c68fd540e..1d9199b71 100644
--- a/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Localization;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
diff --git a/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs b/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
index c65799b7a..e2dd7f78d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
@@ -6,8 +6,8 @@ using Grand.Business.Core.Interfaces.Cms;
using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Pages;
-using Grand.Web.Admin.Extensions.Mapping.Layouts;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Extensions.Mapping.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/LoginController.cs b/src/Web/Grand.Web.Admin/Controllers/LoginController.cs
index e70962902..f249a8ee6 100644
--- a/src/Web/Grand.Web.Admin/Controllers/LoginController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/LoginController.cs
@@ -1,5 +1,4 @@
-using Grand.Business.Core.Events.Customers;
-using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Business.Core.Interfaces.Authentication;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
@@ -7,174 +6,16 @@ using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Common.Controllers;
-using Grand.Web.Common.Security.Captcha;
+using Grand.Web.AdminShared.Controllers;
using MediatR;
using Microsoft.AspNetCore.Mvc;
namespace Grand.Web.Admin.Controllers;
[Area(Constants.AreaAdmin)]
-public class LoginController : BaseController
+public class LoginController : BaseLoginController
{
- private readonly IGrandAuthenticationService _authenticationService;
- private readonly CaptchaSettings _captchaSettings;
- private readonly ICustomerManagerService _customerManagerService;
- private readonly ICustomerService _customerService;
- private readonly CustomerSettings _customerSettings;
- private readonly IMediator _mediator;
- private readonly IMessageProviderService _messageProviderService;
- private readonly ITranslationService _translationService;
- private readonly IContextAccessor _contextAccessor;
-
- public LoginController(
- CustomerSettings customerSettings,
- CaptchaSettings captchaSettings,
- ITranslationService translationService,
- ICustomerManagerService customerManagerService,
- ICustomerService customerService,
- IGrandAuthenticationService authenticationService,
- IMessageProviderService messageProviderService,
- IContextAccessor contextAccessor,
- IMediator mediator)
- {
- _customerSettings = customerSettings;
- _captchaSettings = captchaSettings;
- _translationService = translationService;
- _customerManagerService = customerManagerService;
- _customerService = customerService;
- _authenticationService = authenticationService;
- _messageProviderService = messageProviderService;
- _contextAccessor = contextAccessor;
- _mediator = mediator;
- }
-
- public IActionResult Index()
- {
- var model = new LoginModel {
- UsernamesEnabled = _customerSettings.UsernamesEnabled,
- DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage
- };
- return View(model);
- }
-
- [HttpPost]
- [AutoValidateAntiforgeryToken]
- public virtual async Task<IActionResult> Index(LoginModel model)
- {
- if (ModelState.IsValid)
- {
- var loginResult =
- await _customerManagerService.LoginCustomer(
- _customerSettings.UsernamesEnabled ? model.Username : model.Email, model.Password);
- switch (loginResult)
- {
- case CustomerLoginResults.Successful:
- {
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(model.Username)
- : await _customerService.GetCustomerByEmail(model.Email);
- //sign in
- return await SignInAction(customer, model.RememberMe);
- }
- case CustomerLoginResults.RequiresTwoFactor:
- {
- var userName = _customerSettings.UsernamesEnabled ? model.Username : model.Email;
- HttpContext.Session.SetString("RequiresTwoFactor", userName);
- return RedirectToRoute("TwoFactorAuthorization");
- }
- }
- }
-
- //If we got this far, something failed, redisplay form
- model.UsernamesEnabled = _customerSettings.UsernamesEnabled;
- model.DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage;
-
- return View(model);
- }
-
- protected async Task<IActionResult> SignInAction(Customer customer, bool createPersistent)
+ public LoginController(CustomerSettings customerSettings, CaptchaSettings captchaSettings, ITranslationService translationService, ICustomerManagerService customerManagerService, ICustomerService customerService, IGrandAuthenticationService authenticationService, IMessageProviderService messageProviderService, IContextAccessor contextAccessor, IMediator mediator) : base(customerSettings, captchaSettings, translationService, customerManagerService, customerService, authenticationService, messageProviderService, contextAccessor, mediator)
{
- //sign in new customer
- await _authenticationService.SignIn(customer, createPersistent);
-
- //raise event
- await _mediator.Publish(new CustomerLoggedInEvent(customer));
-
- return RedirectToRoute("AdminIndex");
- }
-
- public async Task<IActionResult> TwoFactorAuthorization(
- [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
- {
- if (!_customerSettings.TwoFactorAuthenticationEnabled)
- return RedirectToRoute("AdminLogin");
-
- var username = HttpContext.Session.GetString("AdminRequiresTwoFactor");
- if (string.IsNullOrEmpty(username))
- return RedirectToRoute("AdminLogin");
-
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(username)
- : await _customerService.GetCustomerByEmail(username);
- if (customer == null)
- return RedirectToRoute("AdminLogin");
-
- if (!customer.GetUserFieldFromEntity<bool>(SystemCustomerFieldNames.TwoFactorEnabled))
- return RedirectToRoute("AdminLogin");
-
- if (_customerSettings.TwoFactorAuthenticationType != TwoFactorAuthenticationType.AppVerification)
- {
- await twoFactorAuthenticationService.GenerateCodeSetup("", customer, _contextAccessor.WorkContext.WorkingLanguage,
- _customerSettings.TwoFactorAuthenticationType);
- if (_customerSettings.TwoFactorAuthenticationType == TwoFactorAuthenticationType.EmailVerification)
- await _messageProviderService.SendCustomerEmailTokenValidationMessage(customer,
- _contextAccessor.StoreContext.CurrentStore, _contextAccessor.WorkContext.WorkingLanguage.Id);
- }
-
- return View();
- }
-
- [HttpPost]
- public async Task<IActionResult> TwoFactorAuthorization(string token,
- [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
- {
- if (!_customerSettings.TwoFactorAuthenticationEnabled)
- return RedirectToRoute("AdminLogin");
-
- var username = HttpContext.Session.GetString("AdminRequiresTwoFactor");
- if (string.IsNullOrEmpty(username))
- return RedirectToRoute("HomePage");
-
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(username)
- : await _customerService.GetCustomerByEmail(username);
- if (customer == null)
- return RedirectToRoute("AdminLogin");
-
- if (string.IsNullOrEmpty(token))
- {
- ModelState.AddModelError("",
- _translationService.GetResource("Account.TwoFactorAuth.SecurityCodeIsRequired"));
- }
- else
- {
- var secretKey = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.TwoFactorSecretKey);
- if (await twoFactorAuthenticationService.AuthenticateTwoFactor(secretKey, token, customer,
- _customerSettings.TwoFactorAuthenticationType))
- {
- //remove session
- HttpContext.Session.Remove("AdminRequiresTwoFactor");
-
- //sign in
- return await SignInAction(customer, false);
- }
-
- ModelState.AddModelError("", _translationService.GetResource("Account.TwoFactorAuth.WrongSecurityCode"));
- }
-
- await _mediator.Publish(new CustomerLoginFailedEvent(customer));
- return View();
}
-}
\ No newline at end of file
+}
diff --git a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
index b51ca8b8d..94fb53504 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
@@ -10,8 +10,8 @@ using Grand.Domain.Common;
using Grand.Domain.Media;
using Grand.Domain.Seo;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using MediatR;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs b/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
index ca1e4b462..4aa49ee15 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
@@ -4,8 +4,8 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Infrastructure.Caching;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MenuController.cs b/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
index 2db7a59c7..5389236a1 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Menu;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs b/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
index 795de9f54..b4208c09f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
@@ -1,14 +1,12 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Addresses;
-using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Orders;
-using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Domain.Permissions;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -25,16 +23,12 @@ public class MerchandiseReturnController : BaseAdminController
IMerchandiseReturnViewModelService merchandiseReturnViewModelService,
ITranslationService translationService,
IMerchandiseReturnService merchandiseReturnService,
- IOrderService orderService,
- IContextAccessor contextAccessor,
- IGroupService groupService)
+ IOrderService orderService)
{
_merchandiseReturnViewModelService = merchandiseReturnViewModelService;
_translationService = translationService;
_merchandiseReturnService = merchandiseReturnService;
_orderService = orderService;
- _contextAccessor = contextAccessor;
- _groupService = groupService;
}
#endregion
@@ -45,8 +39,6 @@ public class MerchandiseReturnController : BaseAdminController
private readonly ITranslationService _translationService;
private readonly IMerchandiseReturnService _merchandiseReturnService;
private readonly IOrderService _orderService;
- private readonly IContextAccessor _contextAccessor;
- private readonly IGroupService _groupService;
#endregion Fields
@@ -68,11 +60,7 @@ public class MerchandiseReturnController : BaseAdminController
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, MerchandiseReturnListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
- var merchandiseReturnModels =
- await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, command.Page,
- command.PageSize);
+ var merchandiseReturnModels = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
Data = merchandiseReturnModels.merchandiseReturnModels,
Total = merchandiseReturnModels.totalCount
@@ -96,10 +84,6 @@ public class MerchandiseReturnController : BaseAdminController
//not found
return RedirectToAction("List", "MerchandiseReturn");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "MerchandiseReturn");
-
return RedirectToAction("Edit", "MerchandiseReturn", new { id = merchandiseReturn.Id });
}
@@ -111,9 +95,6 @@ public class MerchandiseReturnController : BaseAdminController
if (merchandiseReturn == null)
return ErrorForKendoGridJson("Merchandise return not found");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return ErrorForKendoGridJson("Merchandise return is not your");
var items = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnItemModel(merchandiseReturnId);
var gridModel = new DataSourceResult {
Data = items,
@@ -132,9 +113,6 @@ public class MerchandiseReturnController : BaseAdminController
//No merchandise return found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "MerchandiseReturn");
var model = new MerchandiseReturnModel();
await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, merchandiseReturn, false);
return View(model);
@@ -154,10 +132,6 @@ public class MerchandiseReturnController : BaseAdminController
//No merchandise return found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "MerchandiseReturn");
-
if (ModelState.IsValid)
{
var customAddressAttributes = new List<CustomAttribute>();
@@ -190,9 +164,6 @@ public class MerchandiseReturnController : BaseAdminController
//No merchandise return found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "MerchandiseReturn");
if (ModelState.IsValid)
{
await _merchandiseReturnViewModelService.DeleteMerchandiseReturn(merchandiseReturn);
@@ -216,11 +187,8 @@ public class MerchandiseReturnController : BaseAdminController
if (merchandiseReturn == null)
throw new ArgumentException("No merchandise return found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Content("");
//merchandise return notes
- var merchandiseReturnNoteModels =
- await _merchandiseReturnViewModelService.PrepareMerchandiseReturnNotes(merchandiseReturn);
+ var merchandiseReturnNoteModels = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnNotes(merchandiseReturn);
var gridModel = new DataSourceResult {
Data = merchandiseReturnNoteModels,
Total = merchandiseReturnNoteModels.Count
@@ -240,8 +208,6 @@ public class MerchandiseReturnController : BaseAdminController
if (order == null)
return Json(new { Result = false });
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
await _merchandiseReturnViewModelService.InsertMerchandiseReturnNote(merchandiseReturn, order, downloadId,
displayToCustomer, message);
@@ -256,9 +222,6 @@ public class MerchandiseReturnController : BaseAdminController
if (merchandiseReturn == null)
throw new ArgumentException("No merchandise return found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
-
await _merchandiseReturnViewModelService.DeleteMerchandiseReturnNote(merchandiseReturn, id);
return new JsonResult("");
diff --git a/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs b/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
index d0c53535b..b5d5de26d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
@@ -5,8 +5,8 @@ using Grand.Business.Core.Interfaces.Messages;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Permissions;
using Grand.Domain.Messages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
index 654e7e741..4c4e9b8d3 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
@@ -5,9 +5,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Domain.Permissions;
using Grand.Domain.News;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.News;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
index 175b9988a..44c9e8196 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
@@ -2,8 +2,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
index aaa3fb7f8..bc8e3b3e1 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
@@ -5,8 +5,8 @@ using Grand.Business.Core.Interfaces.Marketing.Newsletters;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
@@ -122,7 +122,7 @@ public class NewsLetterSubscriptionController : BaseAdminController
break;
}
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var newsletterSubscriptions = await _newsLetterSubscriptionService.GetAllNewsLetterSubscriptions(
@@ -189,7 +189,7 @@ public class NewsLetterSubscriptionController : BaseAdminController
break;
}
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var subscriptions = await _newsLetterSubscriptionService.GetAllNewsLetterSubscriptions(model.SearchEmail,
diff --git a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
index e5ad28f11..64c52d59e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Infrastructure;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
index 1816ac502..412c3758f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
@@ -7,14 +7,14 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using MediatR;
@@ -45,14 +45,6 @@ public class OrderController(
#endregion
- #region Fields
-
- #endregion
-
- #region Ctor
-
- #endregion
-
#region Order list
public IActionResult Index()
@@ -63,8 +55,7 @@ public class OrderController(
public async Task<IActionResult> List(int? orderStatusId = null,
int? paymentStatusId = null, int? shippingStatusId = null, DateTime? startDate = null, string code = null)
{
- var model = await orderViewModelService.PrepareOrderListModel(orderStatusId, paymentStatusId, shippingStatusId,
- startDate, contextAccessor.WorkContext.CurrentCustomer.StaffStoreId, code);
+ var model = await orderViewModelService.PrepareOrderListModel(orderStatusId, paymentStatusId, shippingStatusId, startDate, "", code);
return View(model);
}
@@ -75,23 +66,19 @@ public class OrderController(
if (string.IsNullOrWhiteSpace(term) || term.Length < searchTermMinimumLength)
return Content("");
- var storeId = string.Empty;
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//products
const int productNumber = 15;
var products = (await productService.SearchProducts(
- storeId: storeId,
keywords: term,
pageSize: productNumber,
showHidden: true)).products;
var result = (from p in products
- select new {
- label = p.Name,
- productid = p.Id
- })
+ select new
+ {
+ label = p.Name,
+ productid = p.Id
+ })
.ToList();
return Json(result);
}
@@ -100,9 +87,6 @@ public class OrderController(
[HttpPost]
public async Task<IActionResult> OrderList(DataSourceRequest command, OrderListModel model)
{
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var (orderModels, totalCount) =
await orderViewModelService.PrepareOrderModel(model, command.Page, command.PageSize);
@@ -133,9 +117,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
return RedirectToAction("Edit", "Order", new { id = order.Id });
}
@@ -147,9 +128,6 @@ public class OrderController(
[HttpPost]
public async Task<IActionResult> ExportExcelAll(OrderListModel model)
{
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//load orders
var orders = await orderViewModelService.PrepareOrders(model);
try
@@ -178,8 +156,6 @@ public class OrderController(
orders.AddRange(await orderService.GetOrdersByIds(ids));
}
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- orders = orders.Where(x => x.StoreId == contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
var bytes = await exportManager.Export(orders);
return File(bytes, "text/xls", "orders.xlsx");
}
@@ -199,8 +175,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
try
{
await mediator.Send(new CancelOrderCommand { Order = order, NotifyCustomer = true });
@@ -225,9 +199,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
try
{
await orderViewModelService.SaveOrderTags(order, orderModel.OrderTags);
@@ -253,9 +224,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
try
{
var status = await orderStatusService.GetByStatusId(model.OrderStatusId);
@@ -294,9 +262,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
var model = new OrderModel();
await orderViewModelService.PrepareOrderDetailsModel(model, order);
@@ -329,9 +294,6 @@ public class OrderController(
ICollection<string> selectedIds,
[FromServices] IShipmentService shipmentService)
{
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- return RedirectToAction("List", "Order");
-
if (selectedIds != null)
{
var orders = new List<Order>();
@@ -353,9 +315,7 @@ public class OrderController(
public async Task<IActionResult> PdfInvoice(string orderId)
{
var order = await orderService.GetOrderById(orderId);
- if ((await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) ||
- await CheckSalesManager(order)) return RedirectToAction("List");
+ if (await CheckSalesManager(order)) return RedirectToAction("List");
var orders = new List<Order> {
order
@@ -376,8 +336,6 @@ public class OrderController(
{
//load orders
var orders = await orderViewModelService.PrepareOrders(model);
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- orders = orders.Where(x => x.StoreId == contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
byte[] bytes;
using (var stream = new MemoryStream())
@@ -403,9 +361,6 @@ public class OrderController(
orders.AddRange(await orderService.GetOrdersByIds(ids));
}
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- orders = orders.Where(x => x.StoreId == contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
-
//ensure that we at least one order selected
if (orders.Count == 0)
{
@@ -432,10 +387,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
order.OrderSubtotalInclTax = model.OrderSubtotalInclTaxValue;
order.OrderSubtotalExclTax = model.OrderSubtotalExclTaxValue;
order.OrderSubTotalDiscountInclTax = model.OrderSubTotalDiscountInclTaxValue;
@@ -470,10 +421,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
order.ShippingMethod = model.ShippingMethod;
await orderService.UpdateOrder(order);
@@ -499,10 +446,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
order.UserFields = model.UserFields;
await orderService.UpdateOrder(order);
@@ -524,9 +467,6 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
if (order.OrderStatusId == (int)OrderStatusSystem.Cancelled)
{
Error("You can't edit position when order is canceled");
@@ -588,14 +528,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
-
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
var result = await mediator.Send(new DeleteOrderItemCommand { Order = order, OrderItem = orderItem });
if (result.error)
Error(result.message);
@@ -615,15 +548,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
-
-
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
var result = await mediator.Send(new CancelOrderItemCommand { Order = order, OrderItem = orderItem });
if (result.error)
Error(result.message);
@@ -645,14 +570,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
-
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
orderItem.DownloadCount = 0;
await orderService.UpdateOrder(order);
var model = new OrderModel();
@@ -673,14 +591,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
-
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
orderItem.IsDownloadActivated = !orderItem.IsDownloadActivated;
await orderService.UpdateOrder(order);
var model = new OrderModel();
@@ -701,14 +612,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
-
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
var product = await productService.GetProductByIdIncludeArch(orderItem.ProductId);
if (!product.IsDownload)
@@ -731,13 +635,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id = order.Id });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId) ?? throw new ArgumentException("No order item found with the specified id");
//attach license
orderItem.LicenseDownloadId = !string.IsNullOrEmpty(model.LicenseDownloadId) ? model.LicenseDownloadId : null;
@@ -758,13 +656,7 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("Edit", "Order", new { id = model.OrderId });
-
- var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId);
- if (orderItem == null)
- throw new ArgumentException("No order item found with the specified id");
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId) ?? throw new ArgumentException("No order item found with the specified id");
//attach license
orderItem.LicenseDownloadId = null;
@@ -797,12 +689,8 @@ public class OrderController(
if (!string.IsNullOrEmpty(model.SearchCategoryId))
categoryIds.Add(model.SearchCategoryId);
- var storeId = string.Empty;
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer)) storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var gridModel = new DataSourceResult();
var products = (await productService.SearchProducts(categoryIds: categoryIds,
- storeId: storeId,
brandId: model.SearchBrandId,
collectionId: model.SearchCollectionId,
productType: model.SearchProductTypeId > 0 ? (ProductType?)model.SearchProductTypeId : null,
@@ -832,9 +720,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
var model = await orderViewModelService.PrepareAddProductToOrderModel(order, productId);
return View(model);
}
@@ -847,9 +732,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
var warnings = await orderViewModelService.AddProductToOrderDetails(model);
if (!warnings.Any())
//redirect to order details page
@@ -875,24 +757,21 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
var address = new Address();
switch (billingAddress)
{
case true when order.BillingAddress != null:
- {
- if (order.BillingAddress.Id == addressId)
- address = order.BillingAddress;
- break;
- }
+ {
+ if (order.BillingAddress.Id == addressId)
+ address = order.BillingAddress;
+ break;
+ }
case false when order.ShippingAddress != null:
- {
- if (order.ShippingAddress.Id == addressId)
- address = order.ShippingAddress;
- break;
- }
+ {
+ if (order.ShippingAddress.Id == addressId)
+ address = order.ShippingAddress;
+ break;
+ }
}
if (address == null)
@@ -914,24 +793,21 @@ public class OrderController(
//No order found with the specified id
return RedirectToAction("List");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
-
var address = new Address();
switch (model.BillingAddress)
{
case true when order.BillingAddress != null:
- {
- if (order.BillingAddress.Id == model.Address.Id)
- address = order.BillingAddress;
- break;
- }
+ {
+ if (order.BillingAddress.Id == model.Address.Id)
+ address = order.BillingAddress;
+ break;
+ }
case false when order.ShippingAddress != null:
- {
- if (order.ShippingAddress.Id == model.Address.Id)
- address = order.ShippingAddress;
- break;
- }
+ {
+ if (order.ShippingAddress.Id == model.Address.Id)
+ address = order.ShippingAddress;
+ break;
+ }
}
if (ModelState.IsValid)
@@ -960,8 +836,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
throw new ArgumentException("No order found with the specified id");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Content("");
//order notes
var orderNoteModels = await orderViewModelService.PrepareOrderNotes(order);
var gridModel = new DataSourceResult {
@@ -979,8 +853,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
return Json(new { Result = false });
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
await orderViewModelService.InsertOrderNote(order, downloadId, displayToCustomer, message);
return Json(new { Result = true });
@@ -994,9 +866,6 @@ public class OrderController(
if (order == null || await CheckSalesManager(order))
throw new ArgumentException("No order found with the specified id");
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
-
await orderViewModelService.DeleteOrderNote(order, id);
return new JsonResult("");
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
index 7654f3e12..e13aceddb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Domain.Permissions;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
index fda41aa40..99983b1c4 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PageController.cs b/src/Web/Grand.Web.Admin/Controllers/PageController.cs
index 07e71086d..01ae93cf3 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PageController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PageController.cs
@@ -4,9 +4,9 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Pages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
index c5236c8a9..c552cd35f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
@@ -9,13 +9,14 @@ using Grand.Domain.Payments;
using Grand.Infrastructure;
using Grand.Infrastructure.Plugins;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Extensions.Mapping.Settings;
-using Grand.Web.Admin.Models.Payments;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Extensions.Mapping.Settings;
+using Grand.Web.AdminShared.Models.Payments;
+using Grand.Web.AdminShared.Models.Shipping;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.AdminShared.Extensions;
namespace Grand.Web.Admin.Controllers;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
index fc4034136..04159eb40 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
@@ -4,11 +4,11 @@ using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Queries.Checkout.Orders;
-using Grand.Domain.Permissions;
using Grand.Domain.Payments;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.SharedKernel;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Security.Authorization;
@@ -28,7 +28,6 @@ public class PaymentTransactionController : BaseAdminController
IPaymentTransactionService paymentTransactionService,
IOrderService orderService,
IContextAccessor contextAccessor,
- IGroupService groupService,
IDateTimeService dateTimeService,
IMediator mediator,
IEnumTranslationService enumTranslationService)
@@ -37,7 +36,6 @@ public class PaymentTransactionController : BaseAdminController
_paymentTransactionService = paymentTransactionService;
_orderService = orderService;
_contextAccessor = contextAccessor;
- _groupService = groupService;
_dateTimeService = dateTimeService;
_mediator = mediator;
_enumTranslationService = enumTranslationService;
@@ -51,11 +49,10 @@ public class PaymentTransactionController : BaseAdminController
private readonly IOrderService _orderService;
private readonly ITranslationService _translationService;
private readonly IContextAccessor _contextAccessor;
- private readonly IGroupService _groupService;
private readonly IDateTimeService _dateTimeService;
private readonly IMediator _mediator;
private readonly IEnumTranslationService _enumTranslationService;
-
+
#endregion Fields
#region Methods
@@ -73,8 +70,7 @@ public class PaymentTransactionController : BaseAdminController
.ToList()
};
model.PaymentTransactionStatus.Insert(0,
- new SelectListItem
- { Text = _translationService.GetResource("Admin.Common.All"), Value = "-1", Selected = true });
+ new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "-1", Selected = true });
return View(model);
}
@@ -82,8 +78,6 @@ public class PaymentTransactionController : BaseAdminController
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, PaymentTransactionListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
DateTime? startDateValue = model.StartDate == null
? null
: _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
@@ -161,10 +155,6 @@ public class PaymentTransactionController : BaseAdminController
//not found
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
return RedirectToAction("Edit", "PaymentTransaction", new { id = paymentTransaction.Id });
}
@@ -177,10 +167,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
var order = await _orderService.GetOrderByGuid(paymentTransaction.OrderGuid);
var model = new PaymentTransactionModel {
@@ -207,17 +193,12 @@ public class PaymentTransactionController : BaseAdminController
//payment method buttons
//model.CanCancelOrder = await _mediator.Send(new CanCancelOrderQuery() { Order = order });
CanCapture = await _mediator.Send(new CanCaptureQuery { PaymentTransaction = paymentTransaction }),
- CanMarkAsPaid = await _mediator.Send(new CanMarkPaymentTransactionAsPaidQuery
- { PaymentTransaction = paymentTransaction }),
+ CanMarkAsPaid = await _mediator.Send(new CanMarkPaymentTransactionAsPaidQuery { PaymentTransaction = paymentTransaction }),
CanRefund = await _mediator.Send(new CanRefundQuery { PaymentTransaction = paymentTransaction }),
- CanRefundOffline = await _mediator.Send(new CanRefundOfflineQuery
- { PaymentTransaction = paymentTransaction }),
- CanPartiallyRefund = await _mediator.Send(new CanPartiallyRefundQuery
- { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
- CanPartiallyRefundOffline = await _mediator.Send(new CanPartiallyRefundOfflineQuery
- { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
- CanPartiallyPaidOffline = await _mediator.Send(new CanPartiallyPaidOfflineQuery
- { PaymentTransaction = paymentTransaction, AmountToPaid = 0 }),
+ CanRefundOffline = await _mediator.Send(new CanRefundOfflineQuery { PaymentTransaction = paymentTransaction }),
+ CanPartiallyRefund = await _mediator.Send(new CanPartiallyRefundQuery { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
+ CanPartiallyRefundOffline = await _mediator.Send(new CanPartiallyRefundOfflineQuery { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
+ CanPartiallyPaidOffline = await _mediator.Send(new CanPartiallyPaidOfflineQuery { PaymentTransaction = paymentTransaction, AmountToPaid = 0 }),
CanVoid = await _mediator.Send(new CanVoidQuery { PaymentTransaction = paymentTransaction }),
CanVoidOffline = await _mediator.Send(new CanVoidOfflineQuery { PaymentTransaction = paymentTransaction }),
MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
@@ -236,10 +217,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
var errors = await _mediator.Send(new CaptureCommand { PaymentTransaction = paymentTransaction });
@@ -265,10 +242,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
await _mediator.Send(new MarkAsPaidCommand { PaymentTransaction = paymentTransaction });
@@ -290,10 +263,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
var errors = await _mediator.Send(new RefundCommand { PaymentTransaction = paymentTransaction });
@@ -318,10 +287,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
await _mediator.Send(new RefundOfflineCommand { PaymentTransaction = paymentTransaction });
@@ -343,10 +308,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
var errors = await _mediator.Send(new VoidCommand { PaymentTransaction = paymentTransaction });
@@ -371,10 +332,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
await _mediator.Send(new VoidOfflineCommand { PaymentTransaction = paymentTransaction });
@@ -395,10 +352,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
var model = new PaymentTransactionModel {
Id = paymentTransaction.Id,
MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
@@ -416,10 +369,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
var amountToRefund = model.AmountToRefund;
@@ -432,11 +381,9 @@ public class PaymentTransactionController : BaseAdminController
var errors = new List<string>();
if (online)
- errors = (await _mediator.Send(new PartiallyRefundCommand
- { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund })).ToList();
+ errors = (await _mediator.Send(new PartiallyRefundCommand { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund })).ToList();
else
- await _mediator.Send(new PartiallyRefundOfflineCommand
- { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund });
+ await _mediator.Send(new PartiallyRefundOfflineCommand { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund });
if (errors.Count == 0)
{
@@ -466,10 +413,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
var model = new PaymentTransactionModel {
Id = paymentTransaction.Id,
MaxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount,
@@ -487,10 +430,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List", "PaymentTransaction");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "PaymentTransaction");
-
try
{
var amountToPaid = model.AmountToPaid;
@@ -501,8 +440,7 @@ public class PaymentTransactionController : BaseAdminController
if (amountToPaid > maxAmountToPaid)
amountToPaid = maxAmountToPaid;
- await _mediator.Send(new PartiallyPaidOfflineCommand
- { PaymentTransaction = paymentTransaction, AmountToPaid = amountToPaid });
+ await _mediator.Send(new PartiallyPaidOfflineCommand { PaymentTransaction = paymentTransaction, AmountToPaid = amountToPaid });
ViewBag.RefreshPage = true;
return View(model);
@@ -523,9 +461,6 @@ public class PaymentTransactionController : BaseAdminController
if (paymentTransaction == null)
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List", "MerchandiseReturn");
if (ModelState.IsValid)
{
await _paymentTransactionService.DeletePaymentTransaction(paymentTransaction);
diff --git a/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs b/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
index a8632b632..b3bb72221 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
@@ -5,8 +5,8 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Permissions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Permissions;
using Grand.Web.Common.Models;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
index 05f5dbe4e..77914ae02 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
@@ -32,8 +32,7 @@ public class PictureController : BaseAdminController
_mediaSettings = mediaSettings;
}
- [HttpPost]
- [IgnoreAntiforgeryToken]
+ [HttpPost]
public virtual async Task<IActionResult> AsyncUpload(IFormFile file, Reference reference = Reference.None, string objectId = "")
{
if (file == null)
@@ -73,8 +72,7 @@ public class PictureController : BaseAdminController
});
}
- [HttpPost]
- [IgnoreAntiforgeryToken]
+ [HttpPost]
public virtual async Task<IActionResult> AsyncLogoUpload(IFormFile file)
{
if (!await _permissionService.Authorize(StandardPermission.ManageSettings))
diff --git a/src/Web/Grand.Web.Admin/Controllers/PluginController.cs b/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
index 56eba672d..a2e9ad52f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
@@ -5,8 +5,9 @@ using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Plugins;
using Grand.SharedKernel.Extensions;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Plugins;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Plugins;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
index a99203f30..20263e7ec 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
@@ -5,8 +5,8 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -102,7 +102,7 @@ public class ProductAttributeController : BaseAdminController
string.IsNullOrEmpty(productAttribute.SeName) ? productAttribute.Name : productAttribute.SeName,
_seoSettings.ConvertNonWesternChars, _seoSettings.AllowUnicodeCharsInUrls,
_seoSettings.SeoCharConversion);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
await _productAttributeService.InsertProductAttribute(productAttribute);
@@ -154,7 +154,7 @@ public class ProductAttributeController : BaseAdminController
string.IsNullOrEmpty(productAttribute.SeName) ? productAttribute.Name : productAttribute.SeName,
_seoSettings.ConvertNonWesternChars, _seoSettings.AllowUnicodeCharsInUrls,
_seoSettings.SeoCharConversion);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
await _productAttributeService.UpdateProductAttribute(productAttribute);
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
index c46296845..ec406619b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
@@ -6,26 +6,24 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.ExportImport;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Media;
-using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Domain.Permissions;
+using Grand.SharedKernel.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
+using Grand.Web.Common.Helpers;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.StaticFiles;
-using Grand.Web.Common.Helpers;
-using Grand.SharedKernel.Extensions;
namespace Grand.Web.Admin.Controllers;
@@ -38,21 +36,17 @@ public class ProductController : BaseAdminController
IProductViewModelService productViewModelService,
IProductService productService,
IInventoryManageService inventoryManageService,
- IContextAccessor contextAccessor,
- IGroupService groupService,
ILanguageService languageService,
ITranslationService translationService,
IProductReservationService productReservationService,
IAuctionService auctionService,
IDateTimeService dateTimeService,
- IPermissionService permissionService,
+ IPermissionService permissionService,
IEnumTranslationService enumTranslationService)
{
_productViewModelService = productViewModelService;
_productService = productService;
_inventoryManageService = inventoryManageService;
- _contextAccessor = contextAccessor;
- _groupService = groupService;
_languageService = languageService;
_translationService = translationService;
_productReservationService = productReservationService;
@@ -69,8 +63,6 @@ public class ProductController : BaseAdminController
private readonly IProductViewModelService _productViewModelService;
private readonly IProductService _productService;
private readonly IInventoryManageService _inventoryManageService;
- private readonly IContextAccessor _contextAccessor;
- private readonly IGroupService _groupService;
private readonly ILanguageService _languageService;
private readonly ITranslationService _translationService;
private readonly IProductReservationService _productReservationService;
@@ -78,19 +70,11 @@ public class ProductController : BaseAdminController
private readonly IDateTimeService _dateTimeService;
private readonly IPermissionService _permissionService;
private readonly IEnumTranslationService _enumTranslationService;
-
+
#endregion
#region Methods
- protected async Task<(bool allow, string message)> CheckAccessToProduct(Product product)
- {
- if (product == null) return (false, "Product not exists");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !(!product.LimitedToStores || (product.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) && product.LimitedToStores)))
- return (false, "This is not your product");
- return (true, null);
- }
-
#region Product list / create / edit / delete
//list products
@@ -129,14 +113,6 @@ public class ProductController : BaseAdminController
var product = await _productService.GetProductBySku(sku);
if (product != null)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- if (!product.LimitedToStores || (product.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- product.LimitedToStores))
- return RedirectToAction("Edit", new { id = product.Id });
- return RedirectToAction("List", "Product");
- }
-
return RedirectToAction("Edit", "Product", new { id = product.Id });
}
@@ -180,20 +156,6 @@ public class ProductController : BaseAdminController
if (product == null)
//No product found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- if (!product.LimitedToStores || (product.LimitedToStores &&
- product.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- product.Stores.Count > 1))
- {
- Warning(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
- }
- else
- {
- if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("List");
- }
- }
var model = product.ToModel(_dateTimeService);
//model.Ticks = product.UpdatedOnUtc.Ticks;
@@ -223,9 +185,6 @@ public class ProductController : BaseAdminController
//No product found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = product.Id });
-
if (model.Ticks != product.Ticks)
{
Error(_translationService.GetResource("Admin.Catalog.Products.Fields.ChangedWarning"));
@@ -262,9 +221,6 @@ public class ProductController : BaseAdminController
//No product found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return RedirectToAction("Edit", new { id = product.Id });
-
if (ModelState.IsValid)
{
await _productViewModelService.DeleteProduct(product);
@@ -294,13 +250,6 @@ public class ProductController : BaseAdminController
try
{
var originalProduct = await _productService.GetProductById(copyModel.Id, true);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- {
- originalProduct.LimitedToStores = true;
- originalProduct.Stores.Clear();
- originalProduct.Stores.Add(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
- }
-
var newProduct = await copyProductService.CopyProduct(originalProduct,
copyModel.Name, copyModel.Published);
@@ -403,10 +352,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var productCategoriesModel = await _productViewModelService.PrepareProductCategoryModel(product);
var gridModel = new DataSourceResult {
Data = productCategoriesModel,
@@ -475,10 +420,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var productCollectionsModel = await _productViewModelService.PrepareProductCollectionModel(product);
var gridModel = new DataSourceResult {
Data = productCollectionsModel,
@@ -547,10 +488,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var relatedProducts = product.RelatedProducts.OrderBy(x => x.DisplayOrder);
var relatedProductsModel = new List<ProductModel.RelatedProductModel>();
foreach (var x in relatedProducts)
@@ -644,10 +581,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var similarProducts = product.SimilarProducts.OrderBy(x => x.DisplayOrder);
var similarProductsModel = new List<ProductModel.SimilarProductModel>();
foreach (var x in similarProducts)
@@ -741,10 +674,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var bundleProducts = product.BundleProducts.OrderBy(x => x.DisplayOrder);
var bundleProductsModel = new List<ProductModel.BundleProductModel>();
foreach (var x in bundleProducts)
@@ -838,10 +767,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var crossSellProducts = product.CrossSellProduct;
var crossSellProductsModel = new List<ProductModel.CrossSellProductModel>();
foreach (var x in crossSellProducts)
@@ -925,10 +850,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var recommendedProductsModel = new List<ProductModel.RecommendedProductModel>();
foreach (var x in product.RecommendedProduct)
recommendedProductsModel.Add(new ProductModel.RecommendedProductModel {
@@ -1011,9 +932,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
var associatedProducts = await _productService.GetAssociatedProducts(productId,
showHidden: true);
var associatedProductsModel = associatedProducts
@@ -1110,8 +1028,7 @@ public class ProductController : BaseAdminController
#region Product pictures
- [HttpPost]
- [IgnoreAntiforgeryToken]
+ [HttpPost]
public async Task<IActionResult> ProductPictureAdd(
IFormFileCollection files,
Reference reference, string objectId,
@@ -1119,31 +1036,27 @@ public class ProductController : BaseAdminController
[FromServices] MediaSettings mediaSettings)
{
if (!await _permissionService.Authorize(PermissionSystemName.Pictures))
- return Json(new {
+ return Json(new
+ {
success = false,
message = "Access denied - picture permissions"
});
if (reference != Reference.Product || string.IsNullOrEmpty(objectId))
- return Json(new {
+ return Json(new
+ {
success = false,
message = "Please save form before upload new pictures"
});
if (!files.Any())
- return Json(new {
- success = false,
- message = "No files uploaded"
- });
-
- var product = await _productService.GetProductById(objectId);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
return Json(new
{
success = false,
- message = "Access denied - staff permissions"
+ message = "No files uploaded"
});
+ var product = await _productService.GetProductById(objectId);
var values = new List<(string pictureUrl, string pictureId)>();
foreach (var file in files)
{
@@ -1176,10 +1089,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var productPicturesModel = await _productViewModelService.PrepareProductPicturesModel(product);
var gridModel = new DataSourceResult {
Data = productPicturesModel,
@@ -1196,10 +1105,6 @@ public class ProductController : BaseAdminController
if (product == null)
return Content("Product not exist");
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var pp = product.ProductPictures.FirstOrDefault(x => x.Id == id);
if (pp == null)
return Content("Product picture not exist");
@@ -1267,7 +1172,7 @@ public class ProductController : BaseAdminController
(await specificationAttributeService.GetSpecificationAttributeById(attributeId))
.SpecificationAttributeOptions.OrderBy(x => x.DisplayOrder);
var result = (from o in options
- select new { id = o.Id, name = o.Name }).ToList();
+ select new { id = o.Id, name = o.Name }).ToList();
return Json(result);
}
@@ -1277,10 +1182,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var productrSpecsModel = await _productViewModelService.PrepareProductSpecificationAttributeModel(product);
var gridModel = new DataSourceResult {
Data = productrSpecsModel,
@@ -1296,10 +1197,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var model = new ProductModel.AddProductSpecificationAttributeModel {
//default specs values
ShowOnProductPage = true
@@ -1393,17 +1290,10 @@ public class ProductController : BaseAdminController
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var model = new OrderListModel {
ProductId = productId
};
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var (orderModels, totalCount) =
await orderViewModelService.PrepareOrderModel(model, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
@@ -1424,16 +1314,8 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
- var storeId = string.Empty;
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var productReviews = await productReviewService.GetAllProductReviews("", null,
- null, null, "", storeId, productId);
+ null, null, "", "", productId);
var items = new List<ProductReviewModel>();
foreach (var item in productReviews.PagedForCommand(command))
@@ -1569,10 +1451,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var items = new List<ProductModel.ProductPriceModel>();
foreach (var item in product.ProductPrices)
items.Add(new ProductModel.ProductPriceModel {
@@ -1686,10 +1564,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var tierPricesModel = await _productViewModelService.PrepareTierPriceModel(product);
var gridModel = new DataSourceResult {
Data = tierPricesModel,
@@ -1804,10 +1678,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var attributesModel = await _productViewModelService.PrepareProductAttributeMappingModels(product);
var gridModel = new DataSourceResult {
Data = attributesModel,
@@ -1822,10 +1692,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
if (string.IsNullOrEmpty(productAttributeMappingId))
{
var model = await _productViewModelService.PrepareProductAttributeMappingModel(product);
@@ -1877,9 +1743,6 @@ public class ProductController : BaseAdminController
if (productAttributeMapping == null)
throw new ArgumentException("No product attribute mapping found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
await productAttributeService.DeleteProductAttributeMapping(productAttributeMapping, product.Id);
return new JsonResult("");
}
@@ -1890,10 +1753,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var productAttributeMapping = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == id);
if (productAttributeMapping == null)
return Content("No attribute value found with the specified id");
@@ -1936,10 +1795,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var productAttributeMapping =
product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
if (productAttributeMapping == null)
@@ -1964,9 +1819,6 @@ public class ProductController : BaseAdminController
if (productAttributeMapping == null)
return Content("No attribute value found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
await _productViewModelService.UpdateProductAttributeConditionModel(product, productAttributeMapping, model);
return Content("");
}
@@ -1989,10 +1841,7 @@ public class ProductController : BaseAdminController
if (productAttributeMapping == null)
throw new ArgumentException("No product attribute mapping found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !(!product.LimitedToStores || (product.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) && product.LimitedToStores)))
- return Content("This is not your product");
- var productAttribute =
- await productAttributeService.GetProductAttributeById(productAttributeMapping.ProductAttributeId);
+ var productAttribute = await productAttributeService.GetProductAttributeById(productAttributeMapping.ProductAttributeId);
var model = new ProductModel.ProductAttributeValueListModel {
ProductName = product.Name,
ProductId = product.Id,
@@ -2010,10 +1859,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var productAttributeMapping =
product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
if (productAttributeMapping == null)
@@ -2035,10 +1880,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var productAttributeMapping =
product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
if (productAttributeMapping == null)
@@ -2083,10 +1924,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var pa = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
if (pa == null)
return RedirectToAction("List", "Product");
@@ -2148,9 +1985,6 @@ public class ProductController : BaseAdminController
if (pav == null)
throw new ArgumentException("No product attribute value found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- throw new ArgumentException(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
if (ModelState.IsValid)
{
await productAttributeService.DeleteProductAttributeValue(pav, productId, pam);
@@ -2202,10 +2036,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var combinationsModel = await _productViewModelService.PrepareProductAttributeCombinationModel(product);
var gridModel = new DataSourceResult {
Data = combinationsModel,
@@ -2227,9 +2057,6 @@ public class ProductController : BaseAdminController
if (combination == null)
throw new ArgumentException("No product attribute combination found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
await productAttributeService.DeleteProductAttributeCombination(combination, productId);
if (product.ManageInventoryMethodId == ManageInventoryMethod.ManageStockByAttributes)
{
@@ -2248,10 +2075,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return Content(permission.message);
-
var model = await _productViewModelService.PrepareProductAttributeCombinationModel(product, Id);
await _productViewModelService.PrepareAddProductAttributeCombinationModel(model, product);
return View(model);
@@ -2267,9 +2090,6 @@ public class ProductController : BaseAdminController
//No product found with the specified id
return RedirectToAction("List", "Product");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
var warnings = await _productViewModelService.InsertOrUpdateProductAttributeCombinationPopup(product, model);
if (!warnings.Any()) return Content("");
//If we got this far, something failed, redisplay form
@@ -2286,9 +2106,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
await _productViewModelService.GenerateAllAttributeCombinations(product);
return Json(new { Success = true });
@@ -2302,9 +2119,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- throw new ArgumentException(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
if (ModelState.IsValid)
{
await _productViewModelService.ClearAllAttributeCombinations(product);
@@ -2331,10 +2145,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var tierPriceModel =
await _productViewModelService.PrepareProductAttributeCombinationTierPricesModel(product,
productAttributeCombinationId);
@@ -2355,9 +2165,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content("", _translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
var combination =
product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
if (combination != null)
@@ -2376,11 +2183,7 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Content("", _translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
- var combination =
- product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
+ var combination = product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
if (combination != null)
await _productViewModelService.UpdateProductAttributeCombinationTierPricesModel(product, combination,
model);
@@ -2397,11 +2200,7 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
- var combination =
- product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
+ var combination = product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
if (combination != null)
{
var tierPrice = combination.TierPrices.FirstOrDefault(x => x.Id == id);
@@ -2425,10 +2224,6 @@ public class ProductController : BaseAdminController
{
var product = await _productService.GetProductById(productId);
- var permission = await CheckAccessToProduct(product);
- if (!permission.allow)
- return ErrorForKendoGridJson(permission.message);
-
var reservations =
await _productReservationService.GetProductReservationsByProductId(productId, null, null, command.Page - 1,
command.PageSize);
@@ -2459,9 +2254,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
-
var reservations = await _productReservationService.GetProductReservationsByProductId(productId, null, null);
if (reservations.Any())
if (((product.IntervalUnitId == IntervalUnit.Minute || product.IntervalUnitId == IntervalUnit.Hour) &&
@@ -2469,7 +2261,8 @@ public class ProductController : BaseAdminController
(product.IntervalUnitId == IntervalUnit.Day &&
((IntervalUnit)model.IntervalUnit == IntervalUnit.Minute ||
(IntervalUnit)model.IntervalUnit == IntervalUnit.Hour)))
- return Json(new {
+ return Json(new
+ {
errors = _translationService.GetResource("Admin.Catalog.Products.Calendar.CannotChangeInterval")
});
@@ -2478,11 +2271,11 @@ public class ProductController : BaseAdminController
var error = (Dictionary<string, Dictionary<string, object>>)ModelState.SerializeErrors();
var s = "";
foreach (var error1 in error)
- foreach (var error2 in error1.Value)
- {
- var v = (string[])error2.Value;
- s += v[0] + "\n";
- }
+ foreach (var error2 in error1.Value)
+ {
+ var v = (string[])error2.Value;
+ s += v[0] + "\n";
+ }
return Json(new { errors = s });
}
@@ -2592,9 +2385,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
-
var toDelete = await _productReservationService.GetProductReservationsByProductId(productId, true, null);
foreach (var record in toDelete) await _productReservationService.DeleteProductReservation(record);
@@ -2608,9 +2398,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
-
var toDelete =
(await _productReservationService.GetProductReservationsByProductId(productId, true, null)).Where(x =>
x.Date < DateTime.UtcNow);
@@ -2627,9 +2414,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
-
var toDelete = await _productReservationService.GetProductReservation(model.ReservationId);
if (toDelete != null)
{
@@ -2656,9 +2440,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
-
var (bidModels, totalCount) =
await _productViewModelService.PrepareBidMode(productId, command.Page, command.PageSize);
var gridModel = new DataSourceResult {
@@ -2676,9 +2457,6 @@ public class ProductController : BaseAdminController
if (product == null)
throw new ArgumentException("No product found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) && !product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- return Json(new DataSourceResult { Errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
-
var toDelete = await _auctionService.GetBid(model.BidId);
if (toDelete != null)
{
@@ -2689,8 +2467,7 @@ public class ProductController : BaseAdminController
return Json("");
}
- return Json(new DataSourceResult
- { Errors = _translationService.GetResource("Admin.Catalog.Products.Bids.CantDeleteWithOrder") });
+ return Json(new DataSourceResult { Errors = _translationService.GetResource("Admin.Catalog.Products.Bids.CantDeleteWithOrder") });
}
return Json(new DataSourceResult { Errors = "Bid not exists" });
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
index 32460840a..c3d140449 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
@@ -3,8 +3,8 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -63,7 +63,7 @@ public class ProductReviewController : BaseAdminController
public async Task<IActionResult> List(DataSourceRequest command, ProductReviewListModel model)
{
//limit for store manager
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var (productReviewModels, totalCount) =
@@ -86,7 +86,7 @@ public class ProductReviewController : BaseAdminController
//No product review found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer) &&
productReview.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
var model = new ProductReviewModel();
@@ -104,7 +104,7 @@ public class ProductReviewController : BaseAdminController
//No product review found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer) &&
productReview.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
if (ModelState.IsValid)
@@ -131,7 +131,7 @@ public class ProductReviewController : BaseAdminController
//No product review found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer) &&
productReview.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
if (ModelState.IsValid)
@@ -176,7 +176,7 @@ public class ProductReviewController : BaseAdminController
return Content("");
var storeId = string.Empty;
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
//products
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
index 1849f57a2..5deff039c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Seo;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs b/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
index 6339b5277..1d94fcaaa 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
@@ -6,7 +6,7 @@ using Grand.Business.Core.Interfaces.Marketing.PushNotifications;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Permissions;
using Grand.Domain.PushNotifications;
-using Grand.Web.Admin.Models.PushNotifications;
+using Grand.Web.AdminShared.Models.PushNotifications;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs b/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
index 6b5ee2646..33d4eecd8 100644
--- a/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
@@ -4,8 +4,8 @@ using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Permissions;
using Grand.Domain;
using Grand.Domain.Messages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
index eded05305..58b0bcfa3 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
@@ -8,18 +8,18 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.System.Reports;
-using Grand.Domain.Permissions;
using Grand.Business.Core.Utilities.System;
using Grand.Domain.Orders;
using Grand.Domain.Payments;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
@@ -37,7 +37,6 @@ public class ReportsController : BaseAdminController
private readonly ICustomerReportService _customerReportService;
private readonly ICustomerReportViewModelService _customerReportViewModelService;
private readonly IDateTimeService _dateTimeService;
- private readonly IGroupService _groupService;
private readonly IOrderReportService _orderReportService;
private readonly IOrderService _orderService;
private readonly IOrderStatusService _orderStatusService;
@@ -70,9 +69,8 @@ public class ReportsController : BaseAdminController
IVendorService vendorService,
IDateTimeService dateTimeService,
ISearchTermService searchTermService,
- IGroupService groupService,
IOrderStatusService orderStatusService,
- ICurrencyService currencyService,
+ ICurrencyService currencyService,
IEnumTranslationService enumTranslationService)
{
_orderService = orderService;
@@ -92,7 +90,6 @@ public class ReportsController : BaseAdminController
_vendorService = vendorService;
_dateTimeService = dateTimeService;
_searchTermService = searchTermService;
- _groupService = groupService;
_orderStatusService = orderStatusService;
_currencyService = currencyService;
_enumTranslationService = enumTranslationService;
@@ -102,12 +99,7 @@ public class ReportsController : BaseAdminController
protected async Task<DataSourceResult> GetBestsellersBriefReportModel(int pageIndex,
int pageSize, int orderBy)
{
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var items = await _orderReportService.BestSellersReport(
- storeId,
orderBy: orderBy,
pageIndex: pageIndex,
pageSize: pageSize,
@@ -201,16 +193,9 @@ public class ReportsController : BaseAdminController
public async Task<IActionResult> BestsellersReport()
{
var model = new BestsellersReportModel();
-
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//stores
- model.AvailableStores.Add(new SelectListItem
- { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
- foreach (var s in (await _storeService.GetAllStores()).Where(x =>
- x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
+ 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 });
var status = await _orderStatusService.GetAll();
@@ -232,8 +217,7 @@ public class ReportsController : BaseAdminController
new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
//vendors
- model.AvailableVendors.Add(new SelectListItem
- { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+ model.AvailableVendors.Add(new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
var vendors = await _vendorService.GetAllVendors(showHidden: true);
foreach (var v in vendors)
model.AvailableVendors.Add(new SelectListItem { Text = v.Name, Value = v.Id });
@@ -244,9 +228,6 @@ public class ReportsController : BaseAdminController
[HttpPost]
public async Task<IActionResult> BestsellersReportList(DataSourceRequest command, BestsellersReportModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
DateTime? startDateValue = model.StartDate == null
? null
: _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
@@ -317,11 +298,7 @@ public class ReportsController : BaseAdminController
if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
return Content("");
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var model = await _orderReportService.GetOrderByTimeReport(storeId, startDate, endDate);
+ var model = await _orderReportService.GetOrderByTimeReport("", startDate, endDate);
var gridModel = new DataSourceResult {
Data = model
};
@@ -345,11 +322,7 @@ public class ReportsController : BaseAdminController
? null
: _dateTimeService.ConvertToUtcTime(model.EndDate.Value, _dateTimeService.CurrentTimeZone).AddDays(1);
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var items = await _orderReportService.ProductsNeverSold(storeId, "",
+ var items = await _orderReportService.ProductsNeverSold("", "",
startDateValue, endDateValue,
command.Page - 1, command.PageSize, true);
var gridModel = new DataSourceResult {
@@ -370,15 +343,11 @@ public class ReportsController : BaseAdminController
if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
return Content("");
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var report = new List<OrderAverageReportLineSummary> {
- await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Pending),
- await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Processing),
- await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Complete),
- await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Cancelled)
+ await _orderReportService.OrderAverageReport("", (int)OrderStatusSystem.Pending),
+ await _orderReportService.OrderAverageReport("", (int)OrderStatusSystem.Processing),
+ await _orderReportService.OrderAverageReport("", (int)OrderStatusSystem.Complete),
+ await _orderReportService.OrderAverageReport("", (int)OrderStatusSystem.Cancelled)
};
var statuses = await _orderStatusService.GetAll();
@@ -411,13 +380,9 @@ public class ReportsController : BaseAdminController
{
if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
return Content("");
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
//load orders
var orders = await _orderService.SearchOrders(
- storeId,
createdFromUtc: startDate,
createdToUtc: endDate,
pageIndex: command.Page - 1,
@@ -457,15 +422,10 @@ public class ReportsController : BaseAdminController
if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
return Content("");
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
-
var model = new List<OrderIncompleteReportLineModel>();
//not paid
var psPending =
- await _orderReportService.GetOrderAverageReportLine(storeId, ps: PaymentStatus.Pending,
+ await _orderReportService.GetOrderAverageReportLine("", ps: PaymentStatus.Pending,
ignoreCancelledOrders: true);
model.Add(new OrderIncompleteReportLineModel {
Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalUnpaidOrders"),
@@ -476,7 +436,7 @@ public class ReportsController : BaseAdminController
});
//not shipped
var ssPending =
- await _orderReportService.GetOrderAverageReportLine(storeId, ss: ShippingStatus.Pending,
+ await _orderReportService.GetOrderAverageReportLine("", ss: ShippingStatus.Pending,
ignoreCancelledOrders: true);
model.Add(new OrderIncompleteReportLineModel {
Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalNotShippedOrders"),
@@ -486,7 +446,7 @@ public class ReportsController : BaseAdminController
new { shippingStatusId = ((int)ShippingStatus.Pending).ToString(), area = Constants.AreaAdmin })
});
//pending
- var osPending = await _orderReportService.GetOrderAverageReportLine(storeId, os: (int)OrderStatusSystem.Pending,
+ var osPending = await _orderReportService.GetOrderAverageReportLine("", os: (int)OrderStatusSystem.Pending,
ignoreCancelledOrders: true);
model.Add(new OrderIncompleteReportLineModel {
Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalIncompleteOrders"),
@@ -541,12 +501,7 @@ public class ReportsController : BaseAdminController
int? orderStatus = model.OrderStatusId > 0 ? model.OrderStatusId : null;
var paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)model.PaymentStatusId : null;
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var items = await _orderReportService.GetCountryReport(
- storeId,
os: orderStatus,
ps: paymentStatus,
startTimeUtc: startDateValue,
@@ -598,11 +553,7 @@ public class ReportsController : BaseAdminController
[HttpPost]
public async Task<IActionResult> LowStockReportList(DataSourceRequest command)
{
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var lowStockProducts = await _productsReportService.LowStockProducts(storeId: storeId);
+ var lowStockProducts = await _productsReportService.LowStockProducts();
var models = new List<LowStockProductModel>();
//products
@@ -659,9 +610,6 @@ public class ReportsController : BaseAdminController
public async Task<IActionResult> ReportBestCustomersByOrderTotalList(DataSourceRequest command,
BestCustomersReportModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var (bestCustomerReportLineModels, totalCount) =
await _customerReportViewModelService.PrepareBestCustomerReportLineModel(model, 1, command.Page,
command.PageSize);
@@ -676,9 +624,6 @@ public class ReportsController : BaseAdminController
public async Task<IActionResult> ReportBestCustomersByNumberOfOrdersList(DataSourceRequest command,
BestCustomersReportModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var (bestCustomerReportLineModels, totalCount) =
await _customerReportViewModelService.PrepareBestCustomerReportLineModel(model, 2, command.Page,
command.PageSize);
@@ -692,11 +637,7 @@ public class ReportsController : BaseAdminController
[HttpPost]
public async Task<IActionResult> ReportRegisteredCustomersList(DataSourceRequest command)
{
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var model = await _customerReportViewModelService.GetReportRegisteredCustomersModel(storeId);
+ var model = await _customerReportViewModelService.GetReportRegisteredCustomersModel("");
var gridModel = new DataSourceResult {
Data = model,
Total = model.Count
@@ -709,11 +650,7 @@ public class ReportsController : BaseAdminController
public async Task<IActionResult> ReportCustomerTimeChart(DataSourceRequest command, DateTime? startDate,
DateTime? endDate)
{
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- var model = await _customerReportService.GetCustomerByTimeReport(storeId, startDate, endDate);
+ var model = await _customerReportService.GetCustomerByTimeReport("", startDate, endDate);
var gridModel = new DataSourceResult {
Data = model
};
diff --git a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
index 32faea8f0..37f76f9ba 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
@@ -3,8 +3,8 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.Documents;
using Grand.Domain.Permissions;
using Grand.Domain.Customers;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs b/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
index a59787cec..e1a45a3af 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
@@ -4,8 +4,8 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.System.ScheduleTasks;
using Grand.Domain.Permissions;
using Grand.Domain.Tasks;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Tasks;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Tasks;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SearchController.cs b/src/Web/Grand.Web.Admin/Controllers/SearchController.cs
index e8dabb6f4..332e80e4b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SearchController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SearchController.cs
@@ -13,7 +13,7 @@ using Grand.Domain.Admin;
using Grand.Domain.Customers;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Helpers;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
index c55866007..0020c1c5f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
@@ -25,9 +25,9 @@ using Grand.Domain.Stores;
using Grand.Domain.Vendors;
using Grand.Infrastructure.Caching;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Extensions.Mapping.Settings;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Extensions.Mapping.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Localization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
index df9b8d0d5..c52e622a1 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
@@ -4,12 +4,12 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
-using Grand.Domain.Permissions;
using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Filters;
@@ -27,7 +27,6 @@ public class ShipmentController : BaseAdminController
IOrderService orderService,
ITranslationService translationService,
IContextAccessor contextAccessor,
- IGroupService groupService,
IPdfService pdfService,
IShipmentService shipmentService,
IDateTimeService dateTimeService,
@@ -37,7 +36,6 @@ public class ShipmentController : BaseAdminController
_orderService = orderService;
_translationService = translationService;
_contextAccessor = contextAccessor;
- _groupService = groupService;
_pdfService = pdfService;
_shipmentService = shipmentService;
_dateTimeService = dateTimeService;
@@ -50,7 +48,6 @@ public class ShipmentController : BaseAdminController
private readonly IOrderService _orderService;
private readonly ITranslationService _translationService;
private readonly IContextAccessor _contextAccessor;
- private readonly IGroupService _groupService;
private readonly IPdfService _pdfService;
private readonly IShipmentService _shipmentService;
private readonly IDateTimeService _dateTimeService;
@@ -70,9 +67,6 @@ public class ShipmentController : BaseAdminController
[HttpPost]
public async Task<IActionResult> ShipmentListSelect(DataSourceRequest command, ShipmentListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var shipments = await _shipmentViewModelService.PrepareShipments(model, command.Page, command.PageSize);
var items = new List<ShipmentModel>();
foreach (var item in shipments.shipments)
@@ -89,13 +83,7 @@ public class ShipmentController : BaseAdminController
[HttpPost]
public async Task<IActionResult> ShipmentsByOrder(string orderId, DataSourceRequest command)
{
- var order = await _orderService.GetOrderById(orderId);
- if (order == null)
- throw new ArgumentException("No order found with the specified id");
-
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return Content("");
+ var order = await _orderService.GetOrderById(orderId) ?? throw new ArgumentException("No order found with the specified id");
//shipments
var shipmentModels = new List<ShipmentModel>();
@@ -116,17 +104,8 @@ public class ShipmentController : BaseAdminController
[HttpPost]
public async Task<IActionResult> ShipmentsItemsByShipmentId(string shipmentId, DataSourceRequest command)
{
- var shipment = await _shipmentService.GetShipmentById(shipmentId);
- if (shipment == null)
- throw new ArgumentException("No shipment found with the specified id");
-
- var order = await _orderService.GetOrderById(shipment.OrderId);
- if (order == null)
- throw new ArgumentException("No order found with the specified id");
-
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return Content("");
+ var shipment = await _shipmentService.GetShipmentById(shipmentId) ?? throw new ArgumentException("No shipment found with the specified id");
+ var order = await _orderService.GetOrderById(shipment.OrderId) ?? throw new ArgumentException("No order found with the specified id");
//shipments
var shipmentModel = await _shipmentViewModelService.PrepareShipmentModel(shipment, true);
@@ -146,10 +125,6 @@ public class ShipmentController : BaseAdminController
//No order found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var model = await _shipmentViewModelService.PrepareShipmentModel(order);
return View(model);
@@ -165,10 +140,6 @@ public class ShipmentController : BaseAdminController
//No order found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var orderItems = order.OrderItems;
var sh = await _shipmentViewModelService.PrepareShipment(order, orderItems.ToList(), model);
@@ -215,10 +186,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var orderId = shipment.OrderId;
var order = await _orderService.GetOrderById(orderId);
if (order == null)
@@ -238,10 +205,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var orderId = shipment.OrderId;
var order = await _orderService.GetOrderById(orderId);
if (order == null)
@@ -272,10 +235,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -296,10 +255,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -320,10 +275,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -350,10 +301,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -383,10 +330,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -415,10 +358,6 @@ public class ShipmentController : BaseAdminController
//No shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -449,10 +388,6 @@ public class ShipmentController : BaseAdminController
//No order found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
-
shipment.UserFields = model.UserFields;
await _shipmentService.UpdateShipment(shipment);
@@ -470,10 +405,6 @@ public class ShipmentController : BaseAdminController
//no shipment found with the specified id
return RedirectToAction("List");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return RedirectToAction("List");
-
var order = await _orderService.GetOrderById(shipment.OrderId);
if (order == null)
//No order found with the specified id
@@ -497,9 +428,6 @@ public class ShipmentController : BaseAdminController
[HttpPost]
public async Task<IActionResult> PdfPackagingSlipAll(ShipmentListModel model)
{
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//load shipments
var shipments = await _shipmentViewModelService.PrepareShipments(model, 1, 100);
@@ -526,7 +454,6 @@ public class ShipmentController : BaseAdminController
public async Task<IActionResult> PdfPackagingSlipSelected(string selectedIds)
{
var shipments = new List<Shipment>();
- var shipments_access = new List<Shipment>();
if (selectedIds != null)
{
var ids = selectedIds
@@ -536,11 +463,6 @@ public class ShipmentController : BaseAdminController
shipments.AddRange(await _shipmentService.GetShipmentsByIds(ids));
}
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
- shipments_access = shipments.Where(x => x.StoreId == storeId || string.IsNullOrEmpty(storeId)).ToList();
//ensure that we at least one shipment selected
if (shipments.Count == 0)
{
@@ -551,7 +473,7 @@ public class ShipmentController : BaseAdminController
byte[] bytes;
using (var stream = new MemoryStream())
{
- await _pdfService.PrintPackagingSlipsToPdf(stream, shipments_access, _contextAccessor.WorkContext.WorkingLanguage.Id);
+ await _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _contextAccessor.WorkContext.WorkingLanguage.Id);
bytes = stream.ToArray();
}
@@ -563,15 +485,10 @@ public class ShipmentController : BaseAdminController
public async Task<IActionResult> SetAsShippedSelected(ICollection<string> selectedIds)
{
var shipments = new List<Shipment>();
- var shipments_access = new List<Shipment>();
- if (selectedIds != null) shipments.AddRange(await _shipmentService.GetShipmentsByIds(selectedIds.ToArray()));
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ if (selectedIds != null) shipments.AddRange(await _shipmentService.GetShipmentsByIds(selectedIds.ToArray()));
- shipments_access = shipments.Where(x => x.StoreId == storeId || string.IsNullOrEmpty(storeId)).ToList();
- foreach (var shipment in shipments_access)
+ foreach (var shipment in shipments)
try
{
await _mediator.Send(new ShipCommand { Shipment = shipment, NotifyCustomer = true });
@@ -589,14 +506,9 @@ public class ShipmentController : BaseAdminController
public async Task<IActionResult> SetAsDeliveredSelected(ICollection<string> selectedIds)
{
var shipments = new List<Shipment>();
- var shipments_access = new List<Shipment>();
if (selectedIds != null) shipments.AddRange(await _shipmentService.GetShipmentsByIds(selectedIds.ToArray()));
- var storeId = "";
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
- storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
- shipments_access = shipments.Where(x => x.StoreId == storeId || string.IsNullOrEmpty(storeId)).ToList();
- foreach (var shipment in shipments_access)
+ foreach (var shipment in shipments)
try
{
await _mediator.Send(new DeliveryCommand { Shipment = shipment, NotifyCustomer = true });
@@ -619,10 +531,6 @@ public class ShipmentController : BaseAdminController
if (shipment == null)
throw new ArgumentException("No shipment found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return Content("");
-
//shipment notes
var shipmentNoteModels = await _shipmentViewModelService.PrepareShipmentNotes(shipment);
var gridModel = new DataSourceResult {
@@ -640,10 +548,6 @@ public class ShipmentController : BaseAdminController
if (shipment == null)
return Json(new { Result = false });
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return Json(new { Result = false });
-
await _shipmentViewModelService.InsertShipmentNote(shipment, downloadId, displayToCustomer, message);
return Json(new { Result = true });
@@ -657,10 +561,6 @@ public class ShipmentController : BaseAdminController
if (shipment == null)
throw new ArgumentException("No shipment found with the specified id");
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer) &&
- shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
- return Json(new { Result = false });
-
await _shipmentViewModelService.DeleteShipmentNote(shipment, id);
return new JsonResult("");
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs b/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
index 59074c840..7724c6d6d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
@@ -9,11 +9,11 @@ using Grand.Domain;
using Grand.Domain.Customers;
using Grand.Domain.Directory;
using Grand.Domain.Shipping;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Extensions.Mapping.Settings;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Directory;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Extensions.Mapping.Settings;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Directory;
+using Grand.Web.AdminShared.Models.Shipping;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Models;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs b/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
index b48a05877..2c63fcb0c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.ShoppingCart;
+using Grand.Web.AdminShared.Models.ShoppingCart;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
index ae9b864e2..fcb7bc88c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
@@ -5,8 +5,8 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
@@ -160,7 +160,7 @@ public class SpecificationAttributeController : BaseAdminController
? specificationAttribute.Name
: specificationAttribute.SeName, _seoSettings.ConvertNonWesternChars,
_seoSettings.AllowUnicodeCharsInUrls, _seoSettings.SeoCharConversion);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
await _specificationAttributeService.InsertSpecificationAttribute(specificationAttribute);
@@ -211,7 +211,7 @@ public class SpecificationAttributeController : BaseAdminController
? specificationAttribute.Name
: specificationAttribute.SeName, _seoSettings.ConvertNonWesternChars,
_seoSettings.AllowUnicodeCharsInUrls, _seoSettings.SeoCharConversion);
- if (await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
await _specificationAttributeService.UpdateSpecificationAttribute(specificationAttribute);
diff --git a/src/Web/Grand.Web.Admin/Controllers/StoreController.cs b/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
index a4ca219b4..c3acf13ae 100644
--- a/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Stores;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
index d698ed5c8..5701c879c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
@@ -11,7 +11,7 @@ using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Roslyn;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs b/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
index d87a42e68..4ba877b09 100644
--- a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
@@ -7,10 +7,10 @@ using Grand.Domain.Directory;
using Grand.Domain.Tax;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Plugins;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Extensions.Mapping.Settings;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Extensions.Mapping.Settings;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Tax;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/VendorController.cs b/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
index 7d72bb4ce..b18f0ce99 100644
--- a/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Vendors;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs b/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
index 19f1d3b1d..ed1a18818 100644
--- a/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Permissions;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Vendors;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs b/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
index 9791e3fb0..80854c47b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
@@ -5,11 +5,12 @@ using Grand.Domain.Cms;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Plugins;
using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Models.Cms;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Models.Cms;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Grand.Web.AdminShared.Extensions;
namespace Grand.Web.Admin.Controllers;
diff --git a/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj b/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj
index f3f1ef0c0..37ec2ea02 100644
--- a/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj
+++ b/src/Web/Grand.Web.Admin/Grand.Web.Admin.csproj
@@ -28,6 +28,6 @@
<ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
<ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
<ProjectReference Include="..\Grand.SharedUIResources\Grand.SharedUIResources.csproj" />
- <ProjectReference Include="..\Grand.Web.Common\Grand.Web.Common.csproj" />
+ <ProjectReference Include="..\Grand.Web.AdminShared\Grand.Web.AdminShared.csproj" />
</ItemGroup>
</Project>
diff --git a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateDeleteModel.cs b/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateDeleteModel.cs
deleted file mode 100644
index 61b4c481b..000000000
--- a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateDeleteModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Affiliates;
-
-public record AffiliateDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupAclUpdateModel.cs b/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupAclUpdateModel.cs
deleted file mode 100644
index 25bea4f16..000000000
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupAclUpdateModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Customers;
-
-public record CustomerGroupAclUpdateModel(string CustomerGroupId, string Id, bool Access);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupDeleteModel.cs b/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupDeleteModel.cs
deleted file mode 100644
index 29664206d..000000000
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupDeleteModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Customers;
-
-public record CustomerGroupDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/ExchangeRateModel.cs b/src/Web/Grand.Web.Admin/Models/Directory/ExchangeRateModel.cs
deleted file mode 100644
index e5b86d7a8..000000000
--- a/src/Web/Grand.Web.Admin/Models/Directory/ExchangeRateModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Directory;
-
-public record ExchangeRateModel(string ExchangeRateProvider, bool AutoUpdateEnabled);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormDeleteModel.cs b/src/Web/Grand.Web.Admin/Models/Messages/ContactFormDeleteModel.cs
deleted file mode 100644
index d9c643493..000000000
--- a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormDeleteModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Messages;
-
-public record ContactFormDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherDeleteModel.cs b/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherDeleteModel.cs
deleted file mode 100644
index 5ea34fc72..000000000
--- a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherDeleteModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Orders;
-
-public record GiftVoucherDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherNotifyRecipient.cs b/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherNotifyRecipient.cs
deleted file mode 100644
index 0dd2e9e76..000000000
--- a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherNotifyRecipient.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Orders;
-
-public record GiftVoucherNotifyRecipient(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderDeleteModel.cs b/src/Web/Grand.Web.Admin/Models/Orders/OrderDeleteModel.cs
deleted file mode 100644
index 2f389cf67..000000000
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderDeleteModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Orders;
-
-public record OrderDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionSaveModel.cs b/src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionSaveModel.cs
deleted file mode 100644
index ffa5fe8aa..000000000
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionSaveModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Grand.Web.Admin.Models.Permissions;
-
-public record PermissionActionSaveModel(string SystemName, string CustomerGroupId, IList<string> SelectedActions);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs b/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs
index cd3d9e975..a3093b18d 100644
--- a/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs
+++ b/src/Web/Grand.Web.Admin/Startup/StartupApplication.cs
@@ -2,8 +2,8 @@ using elFinder.Net.AspNetCore.Extensions;
using elFinder.Net.Drivers.FileSystem.Extensions;
using Grand.Infrastructure;
using Grand.Web.Admin.Infrastructure;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Services;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Services;
using Grand.Web.Common.View;
namespace Grand.Web.Admin.Startup;
@@ -12,49 +12,6 @@ public class StartupApplication : IStartupApplication
{
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
- #region elFinder
-
- services.AddElFinderAspNetCore().AddFileSystemDriver();
-
- #endregion
-
- services.AddScoped<IAddressAttributeViewModelService, AddressAttributeViewModelService>();
- services.AddScoped<IAffiliateViewModelService, AffiliateViewModelService>();
- services.AddScoped<IBlogViewModelService, BlogViewModelService>();
- services.AddScoped<ICampaignViewModelService, CampaignViewModelService>();
- services.AddScoped<ICategoryViewModelService, CategoryViewModelService>();
- services.AddScoped<ICheckoutAttributeViewModelService, CheckoutAttributeViewModelService>();
- services.AddScoped<IContactAttributeViewModelService, ContactAttributeViewModelService>();
- services.AddScoped<IContactFormViewModelService, ContactFormViewModelService>();
- services.AddScoped<ICountryViewModelService, CountryViewModelService>();
- services.AddScoped<ICourseViewModelService, CourseViewModelService>();
- services.AddScoped<ICurrencyViewModelService, CurrencyViewModelService>();
- services.AddScoped<ICustomerAttributeViewModelService, CustomerAttributeViewModelService>();
- services.AddScoped<ICustomerViewModelService, CustomerViewModelService>();
- services.AddScoped<ICustomerReportViewModelService, CustomerReportViewModelService>();
- services.AddScoped<ICustomerGroupViewModelService, CustomerGroupViewModelService>();
- services.AddScoped<ICustomerTagViewModelService, CustomerTagViewModelService>();
- services.AddScoped<IDiscountViewModelService, DiscountViewModelService>();
- services.AddScoped<IDocumentViewModelService, DocumentViewModelService>();
- services.AddScoped<IEmailAccountViewModelService, EmailAccountViewModelService>();
- services.AddScoped<IGiftVoucherViewModelService, GiftVoucherViewModelService>();
- services.AddScoped<IKnowledgebaseViewModelService, KnowledgebaseViewModelService>();
- services.AddScoped<ILanguageViewModelService, LanguageViewModelService>();
- services.AddScoped<ICollectionViewModelService, CollectionViewModelService>();
- services.AddScoped<INewsViewModelService, NewsViewModelService>();
- services.AddScoped<IOrderViewModelService, OrderViewModelService>();
- services.AddScoped<IShipmentViewModelService, ShipmentViewModelService>();
- services.AddScoped<IProductReviewViewModelService, ProductReviewViewModelService>();
- services.AddScoped<IMerchandiseReturnViewModelService, MerchandiseReturnViewModelService>();
- services.AddScoped<IVendorViewModelService, VendorViewModelService>();
- services.AddScoped<IPageViewModelService, PageViewModelService>();
- services.AddScoped<IStoreViewModelService, StoreViewModelService>();
- services.AddScoped<IBrandViewModelService, BrandViewModelService>();
- services.AddScoped<IProductViewModelService, ProductViewModelService>();
- services.AddScoped<IPictureViewModelService, PictureViewModelService>();
- services.AddScoped<IElFinderViewModelService, ElFinderViewModelService>();
- services.AddScoped<IMenuViewModelService, MenuViewModelService>();
-
services.AddScoped<IAreaViewFactory, AdminAreaViewFactory>();
}
diff --git a/src/Web/Grand.Web.AdminShared/Controllers/BaseLoginController.cs b/src/Web/Grand.Web.AdminShared/Controllers/BaseLoginController.cs
new file mode 100644
index 000000000..7d39fd990
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Controllers/BaseLoginController.cs
@@ -0,0 +1,182 @@
+using Grand.Business.Core.Events.Customers;
+using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Customers;
+using Grand.Business.Core.Interfaces.Messages;
+using Grand.Domain.Common;
+using Grand.Domain.Customers;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.Common.Controllers;
+using MediatR;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.AdminShared.Controllers;
+
+public abstract class BaseLoginController : BaseController
+{
+ private readonly IGrandAuthenticationService _authenticationService;
+ private readonly CaptchaSettings _captchaSettings;
+ private readonly ICustomerManagerService _customerManagerService;
+ private readonly ICustomerService _customerService;
+ private readonly CustomerSettings _customerSettings;
+ private readonly IMediator _mediator;
+ private readonly IMessageProviderService _messageProviderService;
+ private readonly ITranslationService _translationService;
+ private readonly IContextAccessor _contextAccessor;
+
+ public BaseLoginController(
+ CustomerSettings customerSettings,
+ CaptchaSettings captchaSettings,
+ ITranslationService translationService,
+ ICustomerManagerService customerManagerService,
+ ICustomerService customerService,
+ IGrandAuthenticationService authenticationService,
+ IMessageProviderService messageProviderService,
+ IContextAccessor contextAccessor,
+ IMediator mediator)
+ {
+ _customerSettings = customerSettings;
+ _captchaSettings = captchaSettings;
+ _translationService = translationService;
+ _customerManagerService = customerManagerService;
+ _customerService = customerService;
+ _authenticationService = authenticationService;
+ _messageProviderService = messageProviderService;
+ _contextAccessor = contextAccessor;
+ _mediator = mediator;
+ }
+ protected virtual string GetCurrentArea()
+ {
+ return RouteData.Values["area"]?.ToString() ?? "Admin";
+ }
+
+ public IActionResult Index()
+ {
+ var model = new LoginModel {
+ UsernamesEnabled = _customerSettings.UsernamesEnabled,
+ DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage
+ };
+ return View(model);
+ }
+
+ [HttpPost]
+ [AutoValidateAntiforgeryToken]
+ public virtual async Task<IActionResult> Index(LoginModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var loginResult =
+ await _customerManagerService.LoginCustomer(
+ _customerSettings.UsernamesEnabled ? model.Username : model.Email, model.Password);
+ switch (loginResult)
+ {
+ case CustomerLoginResults.Successful:
+ {
+ var customer = _customerSettings.UsernamesEnabled
+ ? await _customerService.GetCustomerByUsername(model.Username)
+ : await _customerService.GetCustomerByEmail(model.Email);
+ //sign in
+ return await SignInAction(customer, model.RememberMe);
+ }
+ case CustomerLoginResults.RequiresTwoFactor:
+ {
+ var userName = _customerSettings.UsernamesEnabled ? model.Username : model.Email;
+ HttpContext.Session.SetString("RequiresTwoFactor", userName!);
+ return RedirectToRoute("TwoFactorAuthorization");
+ }
+ }
+ }
+
+ //If we got this far, something failed, redisplay form
+ model.UsernamesEnabled = _customerSettings.UsernamesEnabled;
+ model.DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage;
+
+ return View(model);
+ }
+
+ protected async Task<IActionResult> SignInAction(Customer customer, bool createPersistent)
+ {
+ //sign in new customer
+ await _authenticationService.SignIn(customer, createPersistent);
+
+ //raise event
+ await _mediator.Publish(new CustomerLoggedInEvent(customer));
+
+ return RedirectToRoute($"{GetCurrentArea()}Index");
+ }
+
+ public async Task<IActionResult> TwoFactorAuthorization(
+ [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
+ {
+ if (!_customerSettings.TwoFactorAuthenticationEnabled)
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ var username = HttpContext.Session.GetString("AdminRequiresTwoFactor");
+ if (string.IsNullOrEmpty(username))
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ var customer = _customerSettings.UsernamesEnabled
+ ? await _customerService.GetCustomerByUsername(username)
+ : await _customerService.GetCustomerByEmail(username);
+ if (customer == null)
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ if (!customer.GetUserFieldFromEntity<bool>(SystemCustomerFieldNames.TwoFactorEnabled))
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ if (_customerSettings.TwoFactorAuthenticationType != TwoFactorAuthenticationType.AppVerification)
+ {
+ await twoFactorAuthenticationService.GenerateCodeSetup("", customer, _contextAccessor.WorkContext.WorkingLanguage,
+ _customerSettings.TwoFactorAuthenticationType);
+ if (_customerSettings.TwoFactorAuthenticationType == TwoFactorAuthenticationType.EmailVerification)
+ await _messageProviderService.SendCustomerEmailTokenValidationMessage(customer,
+ _contextAccessor.StoreContext.CurrentStore, _contextAccessor.WorkContext.WorkingLanguage.Id);
+ }
+
+ return View();
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> TwoFactorAuthorization(string token,
+ [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
+ {
+ if (!_customerSettings.TwoFactorAuthenticationEnabled)
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ var username = HttpContext.Session.GetString("AdminRequiresTwoFactor");
+ if (string.IsNullOrEmpty(username))
+ return RedirectToRoute("HomePage");
+
+ var customer = _customerSettings.UsernamesEnabled
+ ? await _customerService.GetCustomerByUsername(username)
+ : await _customerService.GetCustomerByEmail(username);
+ if (customer == null)
+ return RedirectToRoute($"{GetCurrentArea()}Login");
+
+ if (string.IsNullOrEmpty(token))
+ {
+ ModelState.AddModelError("",
+ _translationService.GetResource("Account.TwoFactorAuth.SecurityCodeIsRequired"));
+ }
+ else
+ {
+ var secretKey = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.TwoFactorSecretKey);
+ if (await twoFactorAuthenticationService.AuthenticateTwoFactor(secretKey, token, customer,
+ _customerSettings.TwoFactorAuthenticationType))
+ {
+ //remove session
+ HttpContext.Session.Remove("AdminRequiresTwoFactor");
+
+ //sign in
+ return await SignInAction(customer, false);
+ }
+
+ ModelState.AddModelError("", _translationService.GetResource("Account.TwoFactorAuth.WrongSecurityCode"));
+ }
+
+ await _mediator.Publish(new CustomerLoginFailedEvent(customer));
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Extensions/AclMappingExtension.cs b/src/Web/Grand.Web.AdminShared/Extensions/AclMappingExtension.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Extensions/AclMappingExtension.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/AclMappingExtension.cs
index c8e6cf74a..5d63d431e 100644
--- a/src/Web/Grand.Web.Admin/Extensions/AclMappingExtension.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/AclMappingExtension.cs
@@ -1,7 +1,7 @@
using Grand.Domain;
using Grand.Domain.Stores;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
public static class AclMappingExtension
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/AttributeParserHelper.cs b/src/Web/Grand.Web.AdminShared/Extensions/AttributeParserHelper.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Extensions/AttributeParserHelper.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/AttributeParserHelper.cs
index 94065a692..ba5c84573 100644
--- a/src/Web/Grand.Web.Admin/Extensions/AttributeParserHelper.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/AttributeParserHelper.cs
@@ -1,9 +1,9 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
/// <summary>
/// Parser helper
diff --git a/src/Web/Grand.Web.Admin/Extensions/KnowledgebaseExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/KnowledgebaseExtensions.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Extensions/KnowledgebaseExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/KnowledgebaseExtensions.cs
index 03be1236f..1b2116915 100644
--- a/src/Web/Grand.Web.Admin/Extensions/KnowledgebaseExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/KnowledgebaseExtensions.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Knowledgebase;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
/// <summary>
/// Extensions
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/AddressAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressAttributeMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/AddressAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressAttributeMappingExtensions.cs
index a04edbcc1..507350f0f 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/AddressAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class AddressAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/AddressMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressMappingExtensions.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/AddressMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressMappingExtensions.cs
index 113194e4b..12290cb65 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/AddressMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/AddressMappingExtensions.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class AddressMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/BlogCategoryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogCategoryMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/BlogCategoryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogCategoryMappingExtensions.cs
index b235195e2..a976f24ca 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/BlogCategoryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogCategoryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class BlogCategoryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/BlogPostMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogPostMappingExtensions.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/BlogPostMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogPostMappingExtensions.cs
index 9106114ec..f6412284a 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/BlogPostMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BlogPostMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class BlogPostMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/BrandMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BrandMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/BrandMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/BrandMappingExtensions.cs
index af14de45e..02cf29cb5 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/BrandMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/BrandMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class BrandMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CampaignMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CampaignMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CampaignMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CampaignMappingExtensions.cs
index 781912fe0..ef57c1428 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CampaignMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CampaignMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CampaignMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CategoryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CategoryMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CategoryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CategoryMappingExtensions.cs
index 709c30f7b..c878fc3d7 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CategoryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CategoryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CategoryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs
index b1b841a7f..0202eb349 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CheckoutAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CheckoutAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CollectionMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CollectionMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CollectionMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CollectionMappingExtensions.cs
index b6cac6078..78398901c 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CollectionMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CollectionMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CollectionMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ContactAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactAttributeMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ContactAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactAttributeMappingExtensions.cs
index 943ccfdbe..a70534526 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ContactAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ContactAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ContactUsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactUsMappingExtensions.cs
similarity index 72%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ContactUsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactUsMappingExtensions.cs
index 1abb28210..7357d2972 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ContactUsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ContactUsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ContactUsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CountryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CountryMappingExtensions.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CountryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CountryMappingExtensions.cs
index 526120743..dbb792004 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CountryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CountryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CountryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLessonMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLessonMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLessonMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLessonMappingExtensions.cs
index e88056966..91994cab2 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLessonMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLessonMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CourseLessonMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLevelMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLevelMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLevelMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLevelMappingExtensions.cs
index 3ca281b8b..ed66fc27d 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseLevelMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseLevelMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CourseLevelMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CourseMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseMappingExtensions.cs
index 47e01a445..3133b227b 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CourseMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseSubjectMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseSubjectMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CourseSubjectMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseSubjectMappingExtensions.cs
index 975bda29a..18b1a91c5 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CourseSubjectMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CourseSubjectMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CourseSubjectMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CurrencyMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CurrencyMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CurrencyMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CurrencyMappingExtensions.cs
index c888165e2..b4cfddc52 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CurrencyMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CurrencyMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CurrencyMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerAttributeMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerAttributeMappingExtensions.cs
index 98d3616c2..7f8a0ced5 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CustomerAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerGroupMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerGroupMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerGroupMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerGroupMappingExtensions.cs
index 6a3021b5c..5d3c9003f 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerGroupMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerGroupMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CustomerGroupMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerTagMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerTagMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerTagMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerTagMappingExtensions.cs
index 7979e7060..2666866c4 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/CustomerTagMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/CustomerTagMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class CustomerTagMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/DeliveryDateMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DeliveryDateMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/DeliveryDateMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/DeliveryDateMappingExtensions.cs
index aa3523a4d..a604022a9 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/DeliveryDateMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DeliveryDateMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class DeliveryDateMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DiscountMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/DiscountMappingExtensions.cs
index a2fb7b0b0..1a2ff8b32 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/DiscountMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DiscountMappingExtensions.cs
@@ -1,18 +1,18 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Discounts;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class DiscountMappingExtensions
{
public static DiscountModel ToModel(this Discount entity, IDateTimeService dateTimeService)
{
var discount = entity.MapTo<Discount, DiscountModel>();
- discount.StartDate = entity.StartDateUtc.ConvertToUserTime(dateTimeService);
- discount.EndDate = entity.EndDateUtc.ConvertToUserTime(dateTimeService);
+ discount.StartDate = (DateTime)entity.StartDateUtc.ConvertToUserTime(dateTimeService);
+ discount.EndDate = (DateTime)entity.EndDateUtc.ConvertToUserTime(dateTimeService);
return discount;
}
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/DocumentMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DocumentMappingExtensions.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/DocumentMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/DocumentMappingExtensions.cs
index 84c88c656..ed2e65641 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/DocumentMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/DocumentMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Documents;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class DocumentMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/EmailAccountMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/EmailAccountMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/EmailAccountMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/EmailAccountMappingExtensions.cs
index 2c94b2bd8..926d39dba 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/EmailAccountMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/EmailAccountMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class EmailAccountMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/GiftVoucherMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/GiftVoucherMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/GiftVoucherMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/GiftVoucherMappingExtensions.cs
index 37665afbb..f606f4cc8 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/GiftVoucherMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/GiftVoucherMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class GiftVoucherMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs
similarity index 76%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs
index 7ef389450..55d7ba55a 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IExternalAuthenticationMethodMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Authentication;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.ExternalAuthentication;
+using Grand.Web.AdminShared.Models.ExternalAuthentication;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class IExternalAuthenticationMethodMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/IPaymentMethodMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IPaymentMethodMappingExtensions.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/IPaymentMethodMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/IPaymentMethodMappingExtensions.cs
index 81cb491ed..c72bb8b2a 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/IPaymentMethodMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IPaymentMethodMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Payments;
+using Grand.Web.AdminShared.Models.Payments;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class IPaymentMethodMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs
similarity index 79%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs
index b1b95d516..d3625b499 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IShippingRateComputationMethodMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class IShippingRateComputationMethodMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ITaxProviderMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ITaxProviderMappingExtensions.cs
similarity index 75%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ITaxProviderMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ITaxProviderMappingExtensions.cs
index 38f18da56..5344555da 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ITaxProviderMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ITaxProviderMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ITaxProviderMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/IWidgetPluginMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IWidgetPluginMappingExtensions.cs
similarity index 74%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/IWidgetPluginMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/IWidgetPluginMappingExtensions.cs
index 065bb49a7..ded46558b 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/IWidgetPluginMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/IWidgetPluginMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Cms;
+using Grand.Web.AdminShared.Models.Cms;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class IWidgetPluginMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs
index 2cb7d0238..b0cad43bc 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/KnowledgebaseCategoryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Knowledgebase;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Models.Knowledgebase;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class KnowledgebaseCategoryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/LanguageMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/LanguageMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/LanguageMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/LanguageMappingExtensions.cs
index f68d9f331..3e7e70168 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/LanguageMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/LanguageMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Localization;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class LanguageMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs
index 05ea49269..921ba2841 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/BrandLayoutMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Extensions.Mapping.Layouts;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Layouts;
public static class BrandLayoutMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs
index 85f170bc0..f75fbe196 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CategoryLayoutMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Extensions.Mapping.Layouts;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Layouts;
public static class CategoryLayoutMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs
index b2f343cdd..49a8a3343 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/CollectionLayoutMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Extensions.Mapping.Layouts;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Layouts;
public static class CollectionLayoutMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs
index 813273596..53183ea16 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/PageLayoutMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Pages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Extensions.Mapping.Layouts;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Layouts;
public static class PageLayoutMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs
index 80457515e..ff876ddf7 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Layouts/ProductLayoutMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Extensions.Mapping.Layouts;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Layouts;
public static class ProductLayoutMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureDimensionMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureDimensionMappingExtensions.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureDimensionMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureDimensionMappingExtensions.cs
index 4d8884f0a..4a08c62f0 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureDimensionMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureDimensionMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MeasureDimensionMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureUnitMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureUnitMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureUnitMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureUnitMappingExtensions.cs
index a5180de93..641f3b18b 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureUnitMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureUnitMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MeasureUnitMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureWeightMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureWeightMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureWeightMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureWeightMappingExtensions.cs
index d019331fc..448ffc58d 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MeasureWeightMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MeasureWeightMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MeasureWeightMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MenuMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MenuMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MenuMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MenuMappingExtensions.cs
index b080838dd..05b3bc5e8 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MenuMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MenuMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Admin;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Models.Menu;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MenuMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs
index 092413219..61064e1b3 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnActionMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MerchandiseReturnActionMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs
index 5352755fa..5928872eb 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MerchandiseReturnReasonMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MerchandiseReturnReasonMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/MessageTemplateMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MessageTemplateMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/MessageTemplateMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/MessageTemplateMappingExtensions.cs
index eabed3bb0..a3b3741ab 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/MessageTemplateMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/MessageTemplateMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class MessageTemplateMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsItemMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsItemMappingExtensions.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/NewsItemMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsItemMappingExtensions.cs
index 0df330f31..c1a684b1e 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsItemMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsItemMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.News;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Models.News;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class NewsItemMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs
index 664d5f236..e31d8d689 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsLetterSubscriptionMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class NewsLetterSubscriptionMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs
index 5df2b6860..75e991e98 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/NewsletterCategoryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class NewsletterCategoryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/OrderStatusMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/OrderStatusMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/OrderStatusMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/OrderStatusMappingExtensions.cs
index 6d8c0f8c6..c5d1849db 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/OrderStatusMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/OrderStatusMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class OrderStatusMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/PageMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PageMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/PageMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/PageMappingExtensions.cs
index ab5656f70..1eb472f79 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/PageMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PageMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Pages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Models.Pages;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class PageMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/PermissionMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PermissionMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/PermissionMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/PermissionMappingExtensions.cs
index 7205a7a95..1e145bb61 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/PermissionMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PermissionMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Permissions;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Permissions;
+using Grand.Web.AdminShared.Models.Permissions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class PermissionMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/PickupPointMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PickupPointMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/PickupPointMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/PickupPointMappingExtensions.cs
index 79d063ab2..9e1c97c60 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/PickupPointMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PickupPointMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class PickupPointMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/PluginDescriptorMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PluginDescriptorMappingExtensions.cs
similarity index 72%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/PluginDescriptorMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/PluginDescriptorMappingExtensions.cs
index e4e8c0cb1..be17a43e8 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/PluginDescriptorMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/PluginDescriptorMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.Mapper;
using Grand.Infrastructure.Plugins;
-using Grand.Web.Admin.Models.Plugins;
+using Grand.Web.AdminShared.Models.Plugins;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class PluginDescriptorMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs
index 3469b12e1..41fb2767e 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeCombinationMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductAttributeCombinationMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingExtensions.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingExtensions.cs
index b8a90ca00..355024ccb 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs
index e7aaca325..9ed07cbef 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductAttributeMappingMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductAttributeMappingMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductReviewMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductReviewMappingExtensions.cs
similarity index 73%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductReviewMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductReviewMappingExtensions.cs
index 28c29c157..1d57ff5c9 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductReviewMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductReviewMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductReviewMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductSpecificationMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductSpecificationMappingExtensions.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductSpecificationMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductSpecificationMappingExtensions.cs
index aebb16c86..f886d799c 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductSpecificationMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductSpecificationMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductSpecificationMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductsMappingExtensions.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductsMappingExtensions.cs
index 6e66fa6f7..89d8fb6ca 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ProductsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ProductsMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ProductsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/QueuedEmailMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/QueuedEmailMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/QueuedEmailMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/QueuedEmailMappingExtensions.cs
index 61726d968..d8fcc0af6 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/QueuedEmailMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/QueuedEmailMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class QueuedEmailMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/SalesEmployeeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/SalesEmployeeMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/SalesEmployeeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/SalesEmployeeMappingExtensions.cs
index c651d46c0..bd02f27d2 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/SalesEmployeeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/SalesEmployeeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class SalesEmployeeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ScheduleTaskMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ScheduleTaskMappingExtensions.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ScheduleTaskMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ScheduleTaskMappingExtensions.cs
index 83947075d..ec402bb69 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ScheduleTaskMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ScheduleTaskMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Tasks;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tasks;
+using Grand.Web.AdminShared.Models.Tasks;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ScheduleTaskMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs
index 6a136eb1f..06272de12 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AddressSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class AddressSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs
index 98bc4cbc0..8cf19b734 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/AdminSearchSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Admin;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class AdminSearchSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs
index 503a79bec..034c2a150 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/BlogSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class BlogSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs
index a3b5b6558..e654afa3e 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CatalogSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class CatalogSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs
index 9be1e6c8d..8e1cb0d57 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CommonSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class CommonSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs
index 0e4969d97..c9ac752c3 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/CustomerSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class CustomerSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs
index 199979336..98d07bbc6 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/KnowledgebaseMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Knowledgebase;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class KnowledgebaseSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs
index cb438525e..d97725354 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/LoyaltyPointsSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class LoyaltyPointsSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs
similarity index 79%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs
index c11a176fa..3c0045cec 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MediaSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Media;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class MediaSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs
index 81d838325..ddb59ac21 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/MenuItemSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class MenuItemSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs
index 2c6ddbca1..35ae3c781 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/NewsSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.News;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class NewsSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs
index 1a7f1a34a..cfcfe7b00 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/OrderSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class OrderSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs
index 4d0158d56..1183ec461 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PaymentSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Payments;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Payments;
+using Grand.Web.AdminShared.Models.Payments;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class PaymentSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs
index a4c8970cf..9fee7629f 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PdfSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class PdfSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs
index 23264f501..e0cabdcbb 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/PushSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.PushNotifications;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class PushSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs
similarity index 74%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs
index 0b30d1230..924b14266 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SecuritySettingsMappingExtensions.cs
@@ -1,8 +1,9 @@
-using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Domain.Common;
+using Grand.Infrastructure.Mapper;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.Security.Captcha;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class SecuritySettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs
index b817dd901..29c51ac8c 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/SeoSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Seo;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class SeoSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs
index 2288b9cb0..070a4470a 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShippingSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class ShippingSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs
index 4eb4ab7ff..b78fee12c 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/ShoppingCartSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class ShoppingCartSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs
index 713dc8a17..e3a8ba3ec 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/StoreInformationSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Stores;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class StoreInformationSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs
similarity index 79%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs
index 077e2e99d..dc46170c6 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/TaxSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class TaxSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs
index 96eedb7dd..a5a1f59f8 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/Settings/VendorSettingsMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Vendors;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Extensions.Mapping.Settings;
+namespace Grand.Web.AdminShared.Extensions.Mapping.Settings;
public static class VendorSettingsMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/ShippingMethodMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ShippingMethodMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/ShippingMethodMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/ShippingMethodMappingExtensions.cs
index e9ae40414..6d8ec8df9 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/ShippingMethodMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/ShippingMethodMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class ShippingMethodMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs
index cc95a693a..b9d82734e 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/SpecificationAttributeMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class SpecificationAttributeMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/StoreMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/StoreMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/StoreMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/StoreMappingExtensions.cs
index 52c18e6e5..3eeebce01 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/StoreMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/StoreMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Stores;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Models.Stores;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class StoreMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/TaxCategoryMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/TaxCategoryMappingExtensions.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/TaxCategoryMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/TaxCategoryMappingExtensions.cs
index a12cbd4d7..2d1426adb 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/TaxCategoryMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/TaxCategoryMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class TaxCategoryMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/TierPriceMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/TierPriceMappingExtensions.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/TierPriceMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/TierPriceMappingExtensions.cs
index 357d2598f..d5100f652 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/TierPriceMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/TierPriceMappingExtensions.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class TierPriceMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/UserApiMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/UserApiMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/UserApiMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/UserApiMappingExtensions.cs
index 0cf871489..6f2e896c1 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/UserApiMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/UserApiMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class UserApiMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/VendorMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/VendorMappingExtensions.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/VendorMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/VendorMappingExtensions.cs
index edd885c0b..b8ecaa542 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/VendorMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/VendorMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Vendors;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Models.Vendors;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class VendorMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/Mapping/WarehouseMappingExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/WarehouseMappingExtensions.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Extensions/Mapping/WarehouseMappingExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/Mapping/WarehouseMappingExtensions.cs
index f1ae6f2b8..10dc8d40a 100644
--- a/src/Web/Grand.Web.Admin/Extensions/Mapping/WarehouseMappingExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/Mapping/WarehouseMappingExtensions.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Extensions.Mapping;
+namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class WarehouseMappingExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/PluginExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/PluginExtensions.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Extensions/PluginExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/PluginExtensions.cs
index 131cb3e18..50fd0cb31 100644
--- a/src/Web/Grand.Web.Admin/Extensions/PluginExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/PluginExtensions.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Plugins;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
public static class PluginExtensions
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/UpdatePicture.cs b/src/Web/Grand.Web.AdminShared/Extensions/UpdatePicture.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Extensions/UpdatePicture.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/UpdatePicture.cs
index 88d02b0bc..fc61f6bc8 100644
--- a/src/Web/Grand.Web.Admin/Extensions/UpdatePicture.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/UpdatePicture.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Storage;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
public static class UpdatePicture
{
diff --git a/src/Web/Grand.Web.Admin/Extensions/WidgetExtensions.cs b/src/Web/Grand.Web.AdminShared/Extensions/WidgetExtensions.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Extensions/WidgetExtensions.cs
rename to src/Web/Grand.Web.AdminShared/Extensions/WidgetExtensions.cs
index 9f5eb0496..9b540516f 100644
--- a/src/Web/Grand.Web.Admin/Extensions/WidgetExtensions.cs
+++ b/src/Web/Grand.Web.AdminShared/Extensions/WidgetExtensions.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Domain.Cms;
-namespace Grand.Web.Admin.Extensions;
+namespace Grand.Web.AdminShared.Extensions;
public static class WidgetExtensions
{
diff --git a/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj b/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj
new file mode 100644
index 000000000..ecc940b4e
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Grand.Web.AdminShared.csproj
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\Business\Grand.Business.Core\Grand.Business.Core.csproj" />
+ <ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
+ <ProjectReference Include="..\Grand.Web.Common\Grand.Web.Common.csproj" />
+ </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="elFinder.Net.AspNetCore" />
+ <PackageReference Include="elFinder.Net.Core" />
+ <PackageReference Include="elFinder.Net.Drivers.FileSystem" />
+ <PackageReference Include="Microsoft.AspNetCore.Http" />
+ <PackageReference Include="SixLabors.ImageSharp" />
+ </ItemGroup>
+</Project>
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IAddressAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IAddressAttributeViewModelService.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Interfaces/IAddressAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IAddressAttributeViewModelService.cs
index 040a2537f..e586e68b9 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IAddressAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IAddressAttributeViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Common;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IAddressAttributeViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IAffiliateViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IAffiliateViewModelService.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Interfaces/IAffiliateViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IAffiliateViewModelService.cs
index d5076eace..218262fc2 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IAffiliateViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IAffiliateViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Affiliates;
-using Grand.Web.Admin.Models.Affiliates;
+using Grand.Web.AdminShared.Models.Affiliates;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IAffiliateViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IBlogViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IBlogViewModelService.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Interfaces/IBlogViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IBlogViewModelService.cs
index 72459fdbe..53af627d9 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IBlogViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IBlogViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Blogs;
-using Grand.Web.Admin.Models.Blogs;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Blogs;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IBlogViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IBrandViewModelService.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IBrandViewModelService.cs
index f6e4425bf..b1770df84 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IBrandViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IBrandViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Catalog;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IBrandViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICampaignViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICampaignViewModelService.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Interfaces/ICampaignViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICampaignViewModelService.cs
index d0125e18a..4805a8991 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICampaignViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICampaignViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Messages;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICampaignViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICategoryViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICategoryViewModelService.cs
index 06339be2a..7645b1cff 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICategoryViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICategoryViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Catalog;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICategoryViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICheckoutAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICheckoutAttributeViewModelService.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Interfaces/ICheckoutAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICheckoutAttributeViewModelService.cs
index 7be5fc229..fa71218a2 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICheckoutAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICheckoutAttributeViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICheckoutAttributeViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICollectionViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICollectionViewModelService.cs
index 338352b24..135677a43 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICollectionViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICollectionViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Catalog;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICollectionViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IContactAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IContactAttributeViewModelService.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Interfaces/IContactAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IContactAttributeViewModelService.cs
index 46b74b956..114bd3da3 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IContactAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IContactAttributeViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Messages;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IContactAttributeViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IContactFormViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IContactFormViewModelService.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Interfaces/IContactFormViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IContactFormViewModelService.cs
index 53a7cb575..c097c44ee 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IContactFormViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IContactFormViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Messages;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IContactFormViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICountryViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICountryViewModelService.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Interfaces/ICountryViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICountryViewModelService.cs
index e2a696af1..748c80b0f 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICountryViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICountryViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Directory;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICountryViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICourseViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICourseViewModelService.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Interfaces/ICourseViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICourseViewModelService.cs
index b1b62550a..369e19c28 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICourseViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICourseViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Courses;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICourseViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICurrencyViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICurrencyViewModelService.cs
similarity index 74%
rename from src/Web/Grand.Web.Admin/Interfaces/ICurrencyViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICurrencyViewModelService.cs
index e7303352f..035ca1d89 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICurrencyViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICurrencyViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Directory;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICurrencyViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerAttributeViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/ICustomerAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICustomerAttributeViewModelService.cs
index 5b5306b0b..b6d2dd99d 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerAttributeViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Customers;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICustomerAttributeViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerGroupViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerGroupViewModelService.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Interfaces/ICustomerGroupViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICustomerGroupViewModelService.cs
index 3a4cca3d7..08cfa3d95 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerGroupViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerGroupViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICustomerGroupViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerReportViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerReportViewModelService.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Interfaces/ICustomerReportViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICustomerReportViewModelService.cs
index 03d8872e3..9fc675faf 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerReportViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerReportViewModelService.cs
@@ -1,6 +1,6 @@
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICustomerReportViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerTagViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerTagViewModelService.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Interfaces/ICustomerTagViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICustomerTagViewModelService.cs
index 575c6af80..f90660cb8 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerTagViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerTagViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Customers;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICustomerTagViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerViewModelService.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ICustomerViewModelService.cs
index 27d02c79c..f49b7419f 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ICustomerViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ICustomerViewModelService.cs
@@ -1,13 +1,13 @@
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Models.Messages;
-using Grand.Web.Admin.Models.ShoppingCart;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Models.Messages;
+using Grand.Web.AdminShared.Models.ShoppingCart;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ICustomerViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IDiscountViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IDiscountViewModelService.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Interfaces/IDiscountViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IDiscountViewModelService.cs
index 1302f2e90..9bf29e65b 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IDiscountViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IDiscountViewModelService.cs
@@ -2,10 +2,10 @@
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Domain.Vendors;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Discounts;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IDiscountViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IDocumentViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IDocumentViewModelService.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Interfaces/IDocumentViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IDocumentViewModelService.cs
index 120c5cdc9..946db3ee6 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IDocumentViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IDocumentViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Documents;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IDocumentViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IElFinderViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IElFinderViewModelService.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Interfaces/IElFinderViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IElFinderViewModelService.cs
index 6f849d052..c5f904fdb 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IElFinderViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IElFinderViewModelService.cs
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IElFinderViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IEmailAccountViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IEmailAccountViewModelService.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Interfaces/IEmailAccountViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IEmailAccountViewModelService.cs
index 6a210299e..fb5df4b5f 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IEmailAccountViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IEmailAccountViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Messages;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IEmailAccountViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IGiftVoucherViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IGiftVoucherViewModelService.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Interfaces/IGiftVoucherViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IGiftVoucherViewModelService.cs
index 5f25c5ab1..8c6cfae0a 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IGiftVoucherViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IGiftVoucherViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IGiftVoucherViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IKnowledgebaseViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IKnowledgebaseViewModelService.cs
index 0bd57724d..9a5cdd6ba 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IKnowledgebaseViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IKnowledgebaseViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Knowledgebase;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Models.Knowledgebase;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IKnowledgebaseViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/ILanguageViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/ILanguageViewModelService.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Interfaces/ILanguageViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/ILanguageViewModelService.cs
index a1a586ea5..a53a2154e 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/ILanguageViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/ILanguageViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Localization;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface ILanguageViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IMenuViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IMenuViewModelService.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Interfaces/IMenuViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IMenuViewModelService.cs
index bd11a7698..1aa0ea9fb 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IMenuViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IMenuViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Admin;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Models.Menu;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IMenuViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IMerchandiseReturnViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IMerchandiseReturnViewModelService.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Interfaces/IMerchandiseReturnViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IMerchandiseReturnViewModelService.cs
index 617ca36cf..99a4dc58f 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IMerchandiseReturnViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IMerchandiseReturnViewModelService.cs
@@ -1,9 +1,9 @@
using Grand.Domain.Common;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IMerchandiseReturnViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/INewsViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/INewsViewModelService.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Interfaces/INewsViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/INewsViewModelService.cs
index 1b9c9b409..6d18b19c8 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/INewsViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/INewsViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.News;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Models.News;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface INewsViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IOrderViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IOrderViewModelService.cs
index 66a57eb47..ff078fc59 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IOrderViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IOrderViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Common;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IOrderViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IPageViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IPageViewModelService.cs
similarity index 77%
rename from src/Web/Grand.Web.Admin/Interfaces/IPageViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IPageViewModelService.cs
index 2ef6dbfeb..8e6a4cab5 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IPageViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IPageViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Pages;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Models.Pages;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IPageViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IPictureViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IPictureViewModelService.cs
similarity index 65%
rename from src/Web/Grand.Web.Admin/Interfaces/IPictureViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IPictureViewModelService.cs
index aeab0aa88..27efb6388 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IPictureViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IPictureViewModelService.cs
@@ -1,6 +1,6 @@
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IPictureViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IProductReviewViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IProductReviewViewModelService.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Interfaces/IProductReviewViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IProductReviewViewModelService.cs
index d2012d88d..cbb6085b0 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IProductReviewViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IProductReviewViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Catalog;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IProductReviewViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IProductViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IProductViewModelService.cs
index 6f2c4ea4d..36710c8a2 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IProductViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IProductViewModelService.cs
@@ -1,8 +1,8 @@
using Grand.Domain.Catalog;
using Grand.Domain.Media;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IProductViewModelService
{
@@ -19,9 +19,9 @@ public interface IProductViewModelService
Task PrepareAddProductAttributeCombinationModel(ProductAttributeCombinationModel model, Product product);
Task SaveProductWarehouseInventory(Product product, IList<ProductModel.ProductWarehouseInventoryModel> model);
- Task PrepareTierPriceModel(ProductModel.TierPriceModel model);
+ Task PrepareTierPriceModel(ProductModel.TierPriceModel model, string storeId = "");
Task PrepareProductAttributeValueModel(Product product, ProductModel.ProductAttributeValueModel model);
- Task<ProductListModel> PrepareProductListModel();
+ Task<ProductListModel> PrepareProductListModel(string storeId = "");
Task<(IEnumerable<ProductModel> productModels, int totalCount)> PrepareProductsModel(ProductListModel model,
int pageIndex, int pageSize);
@@ -31,7 +31,7 @@ public interface IProductViewModelService
Task<Product> UpdateProductModel(Product product, ProductModel model);
Task DeleteProduct(Product product);
Task DeleteSelected(IEnumerable<string> selectedIds);
- Task<ProductModel.AddRequiredProductModel> PrepareAddRequiredProductModel();
+ Task<ProductModel.AddRequiredProductModel> PrepareAddRequiredProductModel(string storeId = "");
Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(ProductModel.AddProductModel model,
int pageIndex, int pageSize);
@@ -59,13 +59,13 @@ public interface IProductViewModelService
Task DeleteRecommendedProduct(string productId, string recommendedProductId);
Task InsertAssociatedProductModel(ProductModel.AddAssociatedProductModel model);
Task DeleteAssociatedProduct(Product product);
- Task<ProductModel.AddRelatedProductModel> PrepareRelatedProductModel();
- Task<ProductModel.AddSimilarProductModel> PrepareSimilarProductModel();
- Task<ProductModel.AddBundleProductModel> PrepareBundleProductModel();
- Task<ProductModel.AddCrossSellProductModel> PrepareCrossSellProductModel();
- Task<ProductModel.AddRecommendedProductModel> PrepareRecommendedProductModel();
- Task<ProductModel.AddAssociatedProductModel> PrepareAssociatedProductModel();
- Task<BulkEditListModel> PrepareBulkEditListModel();
+ Task<ProductModel.AddRelatedProductModel> PrepareRelatedProductModel(string storeId = "");
+ Task<ProductModel.AddSimilarProductModel> PrepareSimilarProductModel(string storeId = "");
+ Task<ProductModel.AddBundleProductModel> PrepareBundleProductModel(string storeId = "");
+ Task<ProductModel.AddCrossSellProductModel> PrepareCrossSellProductModel(string storeId = "");
+ Task<ProductModel.AddRecommendedProductModel> PrepareRecommendedProductModel(string storeId = "");
+ Task<ProductModel.AddAssociatedProductModel> PrepareAssociatedProductModel(string storeId = "");
+ Task<BulkEditListModel> PrepareBulkEditListModel(string storeId = "");
Task<(IEnumerable<BulkEditProductModel> bulkEditProductModels, int totalCount)> PrepareBulkEditProductModel(
BulkEditListModel model, int pageIndex, int pageSize);
@@ -75,7 +75,7 @@ public interface IProductViewModelService
Task DeleteBulkEdit(IEnumerable<BulkEditProductModel> products);
//tierprices
- Task<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product);
+ Task<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product, string storeId = "");
Task<(IEnumerable<ProductModel.BidModel> bidModels, int totalCount)> PrepareBidMode(string productId, int pageIndex,
int pageSize);
@@ -117,7 +117,7 @@ public interface IProductViewModelService
Task UpdateProductAttributeValueModel(ProductAttributeValue pav, ProductModel.ProductAttributeValueModel model);
Task<ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel>
- PrepareAssociateProductToAttributeValueModel();
+ PrepareAssociateProductToAttributeValueModel(string storeId = "");
Task<IList<ProductModel.ProductAttributeCombinationModel>> PrepareProductAttributeCombinationModel(Product product);
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IShipmentViewModelService.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IShipmentViewModelService.cs
index a1629384b..712e44926 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IShipmentViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IShipmentViewModelService.cs
@@ -1,9 +1,9 @@
using Grand.Domain.Catalog;
using Grand.Domain.Orders;
using Grand.Domain.Shipping;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IShipmentViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IStoreViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IStoreViewModelService.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Interfaces/IStoreViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IStoreViewModelService.cs
index 4022e7ea7..f740b23af 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IStoreViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IStoreViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Stores;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Models.Stores;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IStoreViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Interfaces/IVendorViewModelService.cs b/src/Web/Grand.Web.AdminShared/Interfaces/IVendorViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Interfaces/IVendorViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Interfaces/IVendorViewModelService.cs
index dce22ad96..b991a1756 100644
--- a/src/Web/Grand.Web.Admin/Interfaces/IVendorViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Interfaces/IVendorViewModelService.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Vendors;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Models.Vendors;
-namespace Grand.Web.Admin.Interfaces;
+namespace Grand.Web.AdminShared.Interfaces;
public interface IVendorViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/AddressAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/AddressAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeProfile.cs
index 02cfa6f99..e218417f3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/AddressAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class AddressAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/AddressAttributeValueProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeValueProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/AddressAttributeValueProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeValueProfile.cs
index b021cf1b7..a73c7abc9 100644
--- a/src/Web/Grand.Web.Admin/Mapper/AddressAttributeValueProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/AddressAttributeValueProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class AddressAttributeValueProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/AddressProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/AddressProfile.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Mapper/AddressProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/AddressProfile.cs
index ec087ece1..eebd34e5d 100644
--- a/src/Web/Grand.Web.Admin/Mapper/AddressProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/AddressProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class AddressProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/AddressSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/AddressSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/AddressSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/AddressSettingsProfile.cs
index e7b2dea2f..acdd0ca87 100644
--- a/src/Web/Grand.Web.Admin/Mapper/AddressSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/AddressSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class AddressSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/AdminSearchSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/AdminSearchSettingsProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/AdminSearchSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/AdminSearchSettingsProfile.cs
index 6d8b898d4..57398b914 100644
--- a/src/Web/Grand.Web.Admin/Mapper/AdminSearchSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/AdminSearchSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Admin;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class AdminSearchSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/BlogCategoryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/BlogCategoryProfile.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Mapper/BlogCategoryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/BlogCategoryProfile.cs
index c7cc0f4f7..c70089311 100644
--- a/src/Web/Grand.Web.Admin/Mapper/BlogCategoryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/BlogCategoryProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class BlogCategoryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/BlogPostProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/BlogPostProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/BlogPostProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/BlogPostProfile.cs
index fb5b3fffc..9cda0e7f8 100644
--- a/src/Web/Grand.Web.Admin/Mapper/BlogPostProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/BlogPostProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class BlogPostProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/BlogSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/BlogSettingsProfile.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Mapper/BlogSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/BlogSettingsProfile.cs
index c80e2a973..825a0ad26 100644
--- a/src/Web/Grand.Web.Admin/Mapper/BlogSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/BlogSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Blogs;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class BlogSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/BrandLayoutProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/BrandLayoutProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/BrandLayoutProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/BrandLayoutProfile.cs
index f2987524d..51c26ad35 100644
--- a/src/Web/Grand.Web.Admin/Mapper/BrandLayoutProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/BrandLayoutProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class BrandLayoutProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/BrandProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/BrandProfile.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Mapper/BrandProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/BrandProfile.cs
index 46b46881a..8b1645c05 100644
--- a/src/Web/Grand.Web.Admin/Mapper/BrandProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/BrandProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class BrandProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CampaignProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CampaignProfile.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Mapper/CampaignProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CampaignProfile.cs
index 843d99c12..fcd0f4d53 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CampaignProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CampaignProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CampaignProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CaptchaSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CaptchaSettingsProfile.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Mapper/CaptchaSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CaptchaSettingsProfile.cs
index 949a211ce..7e0f38870 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CaptchaSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CaptchaSettingsProfile.cs
@@ -1,9 +1,10 @@
using AutoMapper;
+using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.Security.Captcha;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CaptchaSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CatalogSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CatalogSettingsProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/CatalogSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CatalogSettingsProfile.cs
index 2487f1203..6c3ba604e 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CatalogSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CatalogSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CatalogSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CategoryLayoutProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CategoryLayoutProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/CategoryLayoutProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CategoryLayoutProfile.cs
index e07b2832e..90db7a281 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CategoryLayoutProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CategoryLayoutProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CategoryLayoutProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CategoryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CategoryProfile.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Mapper/CategoryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CategoryProfile.cs
index f010c5bc0..fbc08e403 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CategoryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CategoryProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CategoryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CheckoutAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CheckoutAttributeProfile.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Mapper/CheckoutAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CheckoutAttributeProfile.cs
index d9f35e44b..fdcc68321 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CheckoutAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CheckoutAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CheckoutAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CollectionLayoutProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CollectionLayoutProfile.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Mapper/CollectionLayoutProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CollectionLayoutProfile.cs
index 43a287913..586792f4d 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CollectionLayoutProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CollectionLayoutProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CollectionLayoutProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CollectionProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CollectionProfile.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Mapper/CollectionProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CollectionProfile.cs
index e527e2d81..045c3e0c7 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CollectionProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CollectionProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CollectionProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CommonSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CommonSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/CommonSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CommonSettingsProfile.cs
index 2cfcd538a..a7ff344bb 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CommonSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CommonSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CommonSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ContactAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ContactAttributeProfile.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Mapper/ContactAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ContactAttributeProfile.cs
index ead12dc7a..19c3706ab 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ContactAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ContactAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ContactAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ContactUsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ContactUsProfile.cs
similarity index 79%
rename from src/Web/Grand.Web.Admin/Mapper/ContactUsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ContactUsProfile.cs
index c83017748..4e2b6f1d1 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ContactUsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ContactUsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ContactUsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CountryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CountryProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/CountryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CountryProfile.cs
index f53b8c0d0..c6b2f6dbe 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CountryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CountryProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CountryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CourseLessonProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CourseLessonProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/CourseLessonProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CourseLessonProfile.cs
index 8e2c5d169..1469385da 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CourseLessonProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CourseLessonProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CourseLessonProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CourseLevelProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CourseLevelProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/CourseLevelProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CourseLevelProfile.cs
index 36f9c9f5d..0fe9021cf 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CourseLevelProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CourseLevelProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CourseLevelProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CourseProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CourseProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/CourseProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CourseProfile.cs
index 0a29c9ff0..0b1f63ff2 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CourseProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CourseProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CourseProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CourseSubjectProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CourseSubjectProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/CourseSubjectProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CourseSubjectProfile.cs
index 95853b4b5..1ebec2ca8 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CourseSubjectProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CourseSubjectProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Courses;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CourseSubjectProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CurrencyProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CurrencyProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/CurrencyProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CurrencyProfile.cs
index 994a2b8f4..b13bd5d69 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CurrencyProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CurrencyProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CurrencyProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CustomerAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeProfile.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Mapper/CustomerAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeProfile.cs
index 417f20c93..b92aeeb4b 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CustomerAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CustomerAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CustomerAttributeValueProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeValueProfile.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Mapper/CustomerAttributeValueProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeValueProfile.cs
index 94b33aa3a..5a60600e1 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CustomerAttributeValueProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CustomerAttributeValueProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CustomerAttributeValueProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CustomerGroupProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CustomerGroupProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/CustomerGroupProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CustomerGroupProfile.cs
index d3881ac23..8fe3911bc 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CustomerGroupProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CustomerGroupProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CustomerGroupProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CustomerSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CustomerSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/CustomerSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CustomerSettingsProfile.cs
index 93719444e..38b442cef 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CustomerSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CustomerSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CustomerSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/CustomerTagProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/CustomerTagProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/CustomerTagProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/CustomerTagProfile.cs
index 768083a10..71a7d552e 100644
--- a/src/Web/Grand.Web.Admin/Mapper/CustomerTagProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/CustomerTagProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class CustomerTagProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/DeliveryDateProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/DeliveryDateProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/DeliveryDateProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/DeliveryDateProfile.cs
index ab9fba202..6a3c0336a 100644
--- a/src/Web/Grand.Web.Admin/Mapper/DeliveryDateProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/DeliveryDateProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class DeliveryDateProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/DiscountProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/DiscountProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/DiscountProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/DiscountProfile.cs
index e14522665..667b904c3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/DiscountProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/DiscountProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Discounts;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class DiscountProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/DocumentProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/DocumentProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/DocumentProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/DocumentProfile.cs
index 5557bcf44..087e3faf1 100644
--- a/src/Web/Grand.Web.Admin/Mapper/DocumentProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/DocumentProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Documents;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class DocumentProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/DocumentTypeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/DocumentTypeProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/DocumentTypeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/DocumentTypeProfile.cs
index 639c0f17c..430a20eab 100644
--- a/src/Web/Grand.Web.Admin/Mapper/DocumentTypeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/DocumentTypeProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Documents;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class DocumentTypeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/EmailAccountProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/EmailAccountProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/EmailAccountProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/EmailAccountProfile.cs
index 5b4185a0e..45f8b51ee 100644
--- a/src/Web/Grand.Web.Admin/Mapper/EmailAccountProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/EmailAccountProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class EmailAccountProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ExternalAuthenticationMethodProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ExternalAuthenticationMethodProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/ExternalAuthenticationMethodProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ExternalAuthenticationMethodProfile.cs
index fc32744f1..e57592a8c 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ExternalAuthenticationMethodProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ExternalAuthenticationMethodProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Business.Core.Interfaces.Authentication;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.ExternalAuthentication;
+using Grand.Web.AdminShared.Models.ExternalAuthentication;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ExternalAuthenticationMethodProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/GiftVoucherProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/GiftVoucherProfile.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Mapper/GiftVoucherProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/GiftVoucherProfile.cs
index d789fa8a5..071d983d5 100644
--- a/src/Web/Grand.Web.Admin/Mapper/GiftVoucherProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/GiftVoucherProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class GiftVoucherProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/KnowledgebaseCategoryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseCategoryProfile.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Mapper/KnowledgebaseCategoryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseCategoryProfile.cs
index a6bbe85c0..b4f11d62b 100644
--- a/src/Web/Grand.Web.Admin/Mapper/KnowledgebaseCategoryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseCategoryProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Knowledgebase;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Models.Knowledgebase;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class KnowledgebaseCategoryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/KnowledgebaseSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseSettingsProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/KnowledgebaseSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseSettingsProfile.cs
index d67652d07..aa0915b58 100644
--- a/src/Web/Grand.Web.Admin/Mapper/KnowledgebaseSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/KnowledgebaseSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Knowledgebase;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class KnowledgebaseSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/LanguageProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/LanguageProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/LanguageProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/LanguageProfile.cs
index 0cf25c19d..a3b64c08e 100644
--- a/src/Web/Grand.Web.Admin/Mapper/LanguageProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/LanguageProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Localization;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class LanguageProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/LoyaltyPointsSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/LoyaltyPointsSettingsProfile.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Mapper/LoyaltyPointsSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/LoyaltyPointsSettingsProfile.cs
index ea435d560..c67f8d3d5 100644
--- a/src/Web/Grand.Web.Admin/Mapper/LoyaltyPointsSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/LoyaltyPointsSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class LoyaltyPointsSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MeasureDimensionProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MeasureDimensionProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/MeasureDimensionProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MeasureDimensionProfile.cs
index 651ce59d0..d6ab12f3f 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MeasureDimensionProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MeasureDimensionProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MeasureDimensionProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MeasureUnitProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MeasureUnitProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/MeasureUnitProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MeasureUnitProfile.cs
index 3f42ed9c2..aa2484b93 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MeasureUnitProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MeasureUnitProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MeasureUnitProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MeasureWeightProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MeasureWeightProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/MeasureWeightProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MeasureWeightProfile.cs
index aad24c9b3..83625d1d0 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MeasureWeightProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MeasureWeightProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MeasureWeightProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MediaSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MediaSettingsProfile.cs
index d4d6c8a88..7514f3a85 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MediaSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Media;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MediaSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MenuItemSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MenuItemSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/MenuItemSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MenuItemSettingsProfile.cs
index 553697dab..e7f5152d2 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MenuItemSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MenuItemSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MenuItemSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MenuProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MenuProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/MenuProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MenuProfile.cs
index b8591c3e2..8f572433c 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MenuProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MenuProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Admin;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Models.Menu;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MenuProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnActionProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnActionProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnActionProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnActionProfile.cs
index 51a5ef33f..96fa13afb 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnActionProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnActionProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MerchandiseReturnActionProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnReasonProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnReasonProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnReasonProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnReasonProfile.cs
index 2357218ba..dd1bfe4a0 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MerchandiseReturnReasonProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MerchandiseReturnReasonProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MerchandiseReturnReasonProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/MessageTemplateProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/MessageTemplateProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/MessageTemplateProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/MessageTemplateProfile.cs
index 9d1042f92..2e4aa16ba 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MessageTemplateProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/MessageTemplateProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class MessageTemplateProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/NewsItemProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/NewsItemProfile.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Mapper/NewsItemProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/NewsItemProfile.cs
index 606eee142..29ec30a2f 100644
--- a/src/Web/Grand.Web.Admin/Mapper/NewsItemProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/NewsItemProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.News;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Models.News;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class NewsItemProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/NewsLetterSubscriptionProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/NewsLetterSubscriptionProfile.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Mapper/NewsLetterSubscriptionProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/NewsLetterSubscriptionProfile.cs
index e589e92d9..e22d84a16 100644
--- a/src/Web/Grand.Web.Admin/Mapper/NewsLetterSubscriptionProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/NewsLetterSubscriptionProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class NewsLetterSubscriptionProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/NewsSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/NewsSettingsProfile.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Mapper/NewsSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/NewsSettingsProfile.cs
index d5aa80efe..752a50e88 100644
--- a/src/Web/Grand.Web.Admin/Mapper/NewsSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/NewsSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.News;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class NewsSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/NewsletterCategoryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/NewsletterCategoryProfile.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Mapper/NewsletterCategoryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/NewsletterCategoryProfile.cs
index f11514664..bfbfb5bf2 100644
--- a/src/Web/Grand.Web.Admin/Mapper/NewsletterCategoryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/NewsletterCategoryProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class NewsletterCategoryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/OrderSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/OrderSettingsProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/OrderSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/OrderSettingsProfile.cs
index 34086481c..1fb9bc5d7 100644
--- a/src/Web/Grand.Web.Admin/Mapper/OrderSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/OrderSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class OrderSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/OrderStatusProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/OrderStatusProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/OrderStatusProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/OrderStatusProfile.cs
index 29464310d..90a975d9e 100644
--- a/src/Web/Grand.Web.Admin/Mapper/OrderStatusProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/OrderStatusProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class OrderStatusProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PageLayoutProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PageLayoutProfile.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Mapper/PageLayoutProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PageLayoutProfile.cs
index deb2394a3..adb92683a 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PageLayoutProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PageLayoutProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Pages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PageLayoutProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PageProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PageProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/PageProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PageProfile.cs
index d4be1e604..17b75dc40 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PageProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PageProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Pages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Models.Pages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PageProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PaymentMethodProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PaymentMethodProfile.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Mapper/PaymentMethodProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PaymentMethodProfile.cs
index edeeffca4..bc3bf03f6 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PaymentMethodProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PaymentMethodProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Payments;
+using Grand.Web.AdminShared.Models.Payments;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PaymentMethodProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PaymentSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PaymentSettingsProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/PaymentSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PaymentSettingsProfile.cs
index d3c0df42a..f05f6b894 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PaymentSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PaymentSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Payments;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Payments;
+using Grand.Web.AdminShared.Models.Payments;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PaymentSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PdfSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PdfSettingsProfile.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Mapper/PdfSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PdfSettingsProfile.cs
index 388f5b327..d731cb9c1 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PdfSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PdfSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Common;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PdfSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PermissionProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PermissionProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/PermissionProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PermissionProfile.cs
index 5513496e3..de20d0df8 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PermissionProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PermissionProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Permissions;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Permissions;
+using Grand.Web.AdminShared.Models.Permissions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PermissionProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PickupPointProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PickupPointProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/PickupPointProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PickupPointProfile.cs
index bd6573770..3eec8ccc2 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PickupPointProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PickupPointProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PickupPointProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PluginDescriptorProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PluginDescriptorProfile.cs
similarity index 77%
rename from src/Web/Grand.Web.Admin/Mapper/PluginDescriptorProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PluginDescriptorProfile.cs
index 3f97c8709..66811a366 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PluginDescriptorProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PluginDescriptorProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Infrastructure.Mapper;
using Grand.Infrastructure.Plugins;
-using Grand.Web.Admin.Models.Plugins;
+using Grand.Web.AdminShared.Models.Plugins;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PluginDescriptorProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PredefinedProductAttributeValueProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PredefinedProductAttributeValueProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/PredefinedProductAttributeValueProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PredefinedProductAttributeValueProfile.cs
index ca414c9fa..081f9a2e4 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PredefinedProductAttributeValueProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PredefinedProductAttributeValueProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PredefinedProductAttributeValueProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeCombinationProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeCombinationProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/ProductAttributeCombinationProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeCombinationProfile.cs
index be24e43c7..33e0bf9e3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeCombinationProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeCombinationProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductAttributeCombinationProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeMappingProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeMappingProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/ProductAttributeMappingProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeMappingProfile.cs
index ffd87cf09..d8f749e5d 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeMappingProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeMappingProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductAttributeMappingProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeProfile.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Mapper/ProductAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeProfile.cs
index e553dbfdb..89173d25d 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductProfile.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Mapper/ProductProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductProfile.cs
index 9decadab8..1dc5dd187 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductReviewProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductReviewProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/ProductReviewProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductReviewProfile.cs
index bd8d20c31..bf40836f5 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductReviewProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductReviewProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductReviewProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductSpecificationProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductSpecificationProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/ProductSpecificationProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductSpecificationProfile.cs
index 89edd0b53..1e8481921 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductSpecificationProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductSpecificationProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductSpecificationProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ProductlayoutProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ProductlayoutProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/ProductlayoutProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ProductlayoutProfile.cs
index 05f4ab572..18f5cb52b 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ProductlayoutProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ProductlayoutProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ProductLayoutProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/PushNotificationsSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/PushNotificationsSettingsProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/PushNotificationsSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/PushNotificationsSettingsProfile.cs
index f0c539d1a..8e40e3e4f 100644
--- a/src/Web/Grand.Web.Admin/Mapper/PushNotificationsSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/PushNotificationsSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.PushNotifications;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class PushNotificationsSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/QueuedEmailProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/QueuedEmailProfile.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Mapper/QueuedEmailProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/QueuedEmailProfile.cs
index 6996069d3..314922d22 100644
--- a/src/Web/Grand.Web.Admin/Mapper/QueuedEmailProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/QueuedEmailProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Messages;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class QueuedEmailProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/SalesEmployeeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/SalesEmployeeProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/SalesEmployeeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/SalesEmployeeProfile.cs
index 55147e446..a1fb60bb5 100644
--- a/src/Web/Grand.Web.Admin/Mapper/SalesEmployeeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/SalesEmployeeProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class SalesEmployeeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ScheduleTaskProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ScheduleTaskProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/ScheduleTaskProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ScheduleTaskProfile.cs
index cc296e8b4..7e993f22c 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ScheduleTaskProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ScheduleTaskProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Tasks;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tasks;
+using Grand.Web.AdminShared.Models.Tasks;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ScheduleTaskProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/SeoSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/SeoSettingsProfile.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Mapper/SeoSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/SeoSettingsProfile.cs
index 344139faa..566d8959b 100644
--- a/src/Web/Grand.Web.Admin/Mapper/SeoSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/SeoSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Seo;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class SeoSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ShippingMethodProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ShippingMethodProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/ShippingMethodProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ShippingMethodProfile.cs
index 6f520f005..68f29a7c3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ShippingMethodProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ShippingMethodProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ShippingMethodProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ShippingRateComputationMethodProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ShippingRateComputationMethodProfile.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Mapper/ShippingRateComputationMethodProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ShippingRateComputationMethodProfile.cs
index 9e8905c89..a42d39f71 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ShippingRateComputationMethodProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ShippingRateComputationMethodProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ShippingRateComputationMethodProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ShippingSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ShippingSettingsProfile.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Mapper/ShippingSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ShippingSettingsProfile.cs
index 4b7e19549..15720c7cd 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ShippingSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ShippingSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ShippingSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/ShoppingCartSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/ShoppingCartSettingsProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/ShoppingCartSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/ShoppingCartSettingsProfile.cs
index bf66eb8a7..4ad05d7c5 100644
--- a/src/Web/Grand.Web.Admin/Mapper/ShoppingCartSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/ShoppingCartSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class ShoppingCartSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/SpecificationAttributeProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/SpecificationAttributeProfile.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Mapper/SpecificationAttributeProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/SpecificationAttributeProfile.cs
index 2b474af55..29935859b 100644
--- a/src/Web/Grand.Web.Admin/Mapper/SpecificationAttributeProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/SpecificationAttributeProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class SpecificationAttributeProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/StateProvinceProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/StateProvinceProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/StateProvinceProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/StateProvinceProfile.cs
index e5426fd83..bccd3dbc3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/StateProvinceProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/StateProvinceProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Directory;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class StateProvinceProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/StoreInformationSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/StoreInformationSettingsProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/StoreInformationSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/StoreInformationSettingsProfile.cs
index fbe593f6f..c56bf211e 100644
--- a/src/Web/Grand.Web.Admin/Mapper/StoreInformationSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/StoreInformationSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Stores;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class StoreInformationSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/StoreProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/StoreProfile.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Mapper/StoreProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/StoreProfile.cs
index 32a56bd67..bf91508d3 100644
--- a/src/Web/Grand.Web.Admin/Mapper/StoreProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/StoreProfile.cs
@@ -1,10 +1,10 @@
using AutoMapper;
using Grand.Domain.Stores;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Models.Stores;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class StoreProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/TaxCategoryProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/TaxCategoryProfile.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Mapper/TaxCategoryProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/TaxCategoryProfile.cs
index b01ef3ee0..8c63c6aea 100644
--- a/src/Web/Grand.Web.Admin/Mapper/TaxCategoryProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/TaxCategoryProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class TaxCategoryProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/TaxProviderProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/TaxProviderProfile.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Mapper/TaxProviderProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/TaxProviderProfile.cs
index f404877bd..237b505d2 100644
--- a/src/Web/Grand.Web.Admin/Mapper/TaxProviderProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/TaxProviderProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class TaxProviderProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/TaxSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/TaxSettingsProfile.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Mapper/TaxSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/TaxSettingsProfile.cs
index 68a2f42b3..691199386 100644
--- a/src/Web/Grand.Web.Admin/Mapper/TaxSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/TaxSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Tax;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class TaxSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/TierPriceProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/TierPriceProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/TierPriceProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/TierPriceProfile.cs
index 5d739f021..122c992e7 100644
--- a/src/Web/Grand.Web.Admin/Mapper/TierPriceProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/TierPriceProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class TierPriceProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/UserApiProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/UserApiProfile.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Mapper/UserApiProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/UserApiProfile.cs
index 2776c1927..0c50983d1 100644
--- a/src/Web/Grand.Web.Admin/Mapper/UserApiProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/UserApiProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Customers;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class UserApiProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/VendorProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/VendorProfile.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Mapper/VendorProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/VendorProfile.cs
index ca02b1ed8..e6cb42a9a 100644
--- a/src/Web/Grand.Web.Admin/Mapper/VendorProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/VendorProfile.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Extensions;
using Grand.Domain.Vendors;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Models.Vendors;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class VendorProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/VendorSettingsProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/VendorSettingsProfile.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Mapper/VendorSettingsProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/VendorSettingsProfile.cs
index 0d76ed59a..6771cc61a 100644
--- a/src/Web/Grand.Web.Admin/Mapper/VendorSettingsProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/VendorSettingsProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Vendors;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class VendorSettingsProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/WarehouseProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/WarehouseProfile.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Mapper/WarehouseProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/WarehouseProfile.cs
index e9bc7e7ea..25480d39f 100644
--- a/src/Web/Grand.Web.Admin/Mapper/WarehouseProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/WarehouseProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class WarehouseProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.Admin/Mapper/WidgetPluginProfile.cs b/src/Web/Grand.Web.AdminShared/Mapper/WidgetPluginProfile.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Mapper/WidgetPluginProfile.cs
rename to src/Web/Grand.Web.AdminShared/Mapper/WidgetPluginProfile.cs
index 90df8b72a..0e0483be0 100644
--- a/src/Web/Grand.Web.Admin/Mapper/WidgetPluginProfile.cs
+++ b/src/Web/Grand.Web.AdminShared/Mapper/WidgetPluginProfile.cs
@@ -1,9 +1,9 @@
using AutoMapper;
using Grand.Business.Core.Interfaces.Cms;
using Grand.Infrastructure.Mapper;
-using Grand.Web.Admin.Models.Cms;
+using Grand.Web.AdminShared.Models.Cms;
-namespace Grand.Web.Admin.Mapper;
+namespace Grand.Web.AdminShared.Mapper;
public class WidgetPluginProfile : Profile, IAutoMapperProfile
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateDeleteModel.cs b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateDeleteModel.cs
new file mode 100644
index 000000000..aa26fd740
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateDeleteModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Affiliates;
+
+public record AffiliateDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateListModel.cs
index b4aef45be..7fbc19bc9 100644
--- a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Affiliates;
+namespace Grand.Web.AdminShared.Models.Affiliates;
public class AffiliateListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateModel.cs
index bf76629a0..b0da2916b 100644
--- a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliateModel.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Affiliates;
+namespace Grand.Web.AdminShared.Models.Affiliates;
public class AffiliateModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliatedOrderListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliatedOrderListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Affiliates/AffiliatedOrderListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliatedOrderListModel.cs
index 73c3353eb..bfd2117c5 100644
--- a/src/Web/Grand.Web.Admin/Models/Affiliates/AffiliatedOrderListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Affiliates/AffiliatedOrderListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Affiliates;
+namespace Grand.Web.AdminShared.Models.Affiliates;
public class AffiliatedOrderListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryModel.cs
index bfeb828d4..1ed359c55 100644
--- a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Blogs;
+namespace Grand.Web.AdminShared.Models.Blogs;
public class BlogCategoryModel : BaseEntityModel, ILocalizedModel<BlogCategoryLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryPost.cs b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryPost.cs
similarity index 78%
rename from src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryPost.cs
rename to src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryPost.cs
index 82c1b32e1..705e472a8 100644
--- a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCategoryPost.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCategoryPost.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Blogs;
+namespace Grand.Web.AdminShared.Models.Blogs;
public class BlogCategoryPost : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCommentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCommentModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Blogs/BlogCommentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCommentModel.cs
index 82874a98d..40cdccc17 100644
--- a/src/Web/Grand.Web.Admin/Models/Blogs/BlogCommentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogCommentModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Blogs;
+namespace Grand.Web.AdminShared.Models.Blogs;
public class BlogCommentModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Blogs/BlogPostModel.cs b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogPostModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Blogs/BlogPostModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Blogs/BlogPostModel.cs
index dce552339..f416d7700 100644
--- a/src/Web/Grand.Web.Admin/Models/Blogs/BlogPostModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogPostModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Blogs;
+namespace Grand.Web.AdminShared.Models.Blogs;
public class BlogPostModel : BaseEntityModel, ILocalizedModel<BlogLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Blogs/BlogProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogProductModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Blogs/BlogProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Blogs/BlogProductModel.cs
index 742f03e41..2ec5faed7 100644
--- a/src/Web/Grand.Web.Admin/Models/Blogs/BlogProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Blogs/BlogProductModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Blogs;
+namespace Grand.Web.AdminShared.Models.Blogs;
public class BlogProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BrandListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/BrandListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Catalog/BrandListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/BrandListModel.cs
index 3f723ea7b..80211205c 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/BrandListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/BrandListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class BrandListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/BrandModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/BrandModel.cs
index e238e46a4..87bca6298 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/BrandModel.cs
@@ -1,22 +1,19 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using Grand.Web.Common.Validators;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class BrandModel : BaseEntityModel, ILocalizedModel<BrandLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
public BrandModel()
{
if (PageSize < 1) PageSize = 5;
- Locales = new List<BrandLocalizedModel>();
- AvailableBrandLayouts = new List<SelectListItem>();
- AvailableSortOptions = new List<SelectListItem>();
}
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.Name")]
@@ -33,7 +30,7 @@ public class BrandModel : BaseEntityModel, ILocalizedModel<BrandLocalizedModel>,
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.BrandLayout")]
public string BrandLayoutId { get; set; }
- public IList<SelectListItem> AvailableBrandLayouts { get; set; }
+ public IList<SelectListItem> AvailableBrandLayouts { get; set; } = [];
[NoScripts]
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.MetaKeywords")]
@@ -75,7 +72,7 @@ public class BrandModel : BaseEntityModel, ILocalizedModel<BrandLocalizedModel>,
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.DefaultSort")]
public int DefaultSort { get; set; }
- public IList<SelectListItem> AvailableSortOptions { get; set; }
+ public IList<SelectListItem> AvailableSortOptions { get; set; } = [];
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.Published")]
public bool Published { get; set; }
@@ -87,20 +84,20 @@ public class BrandModel : BaseEntityModel, ILocalizedModel<BrandLocalizedModel>,
public string ExternalId { get; set; }
//discounts
- public List<DiscountModel> AvailableDiscounts { get; set; }
- public string[] SelectedDiscountIds { get; set; }
+ public List<DiscountModel> AvailableDiscounts { get; set; } = [];
+ public string[] SelectedDiscountIds { get; set; } = [];
//ACL
[UIHint("CustomerGroups")]
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.LimitedToGroups")]
- public string[] CustomerGroups { get; set; }
+ public string[] CustomerGroups { get; set; } = [];
- public IList<BrandLocalizedModel> Locales { get; set; }
+ public IList<BrandLocalizedModel> Locales { get; set; } = [];
//Store acl
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.LimitedToStores")]
[UIHint("Stores")]
- public string[] Stores { get; set; }
+ public string[] Stores { get; set; } = [];
}
public class BrandLocalizedModel : ILocalizedModelLocal, ISlugModelLocal
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BulkEditListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditListModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Catalog/BulkEditListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditListModel.cs
index fd920c102..151d2f326 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/BulkEditListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class BulkEditListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BulkEditProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditProductModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Catalog/BulkEditProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditProductModel.cs
index 68ff008cd..06bd37358 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/BulkEditProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/BulkEditProductModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class BulkEditProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Catalog/CategoryListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryListModel.cs
index 010ab0e6a..cd59c2f63 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class CategoryListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryModel.cs
index bdb38aaa0..51faf9e70 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/CategoryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/CategoryModel.cs
@@ -1,13 +1,13 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using Grand.Web.Common.Validators;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class CategoryModel : BaseEntityModel, ILocalizedModel<CategoryLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Catalog/CollectionListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionListModel.cs
index c499223bd..61dc39e53 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class CollectionListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionModel.cs
index ac2b9529e..bfee5ed70 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/CollectionModel.cs
@@ -1,13 +1,13 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using Grand.Web.Common.Validators;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class CollectionModel : BaseEntityModel, ILocalizedModel<CollectionLocalizedModel>, IGroupLinkModel,
IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CopyProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/CopyProductModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Catalog/CopyProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/CopyProductModel.cs
index 3e1274f8d..6323d6e25 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/CopyProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/CopyProductModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class CopyProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/LowStockProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/LowStockProductModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Catalog/LowStockProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/LowStockProductModel.cs
index 10d0cbed8..2bfacd09f 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/LowStockProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/LowStockProductModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class LowStockProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeCombinationModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeCombinationModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeCombinationModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeCombinationModel.cs
index 109c0c9ad..12d09fd80 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeCombinationModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeCombinationModel.cs
@@ -6,7 +6,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductAttributeCombinationModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeConditionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeConditionModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeConditionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeConditionModel.cs
index c574b26f9..a284567ad 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeConditionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeConditionModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Binders;
using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductAttributeConditionModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeModel.cs
index fe313bc85..b27fb0d90 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductAttributeModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductAttributeModel : BaseEntityModel, ILocalizedModel<ProductAttributeLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductListModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductListModel.cs
index 1e6b98bf2..354b858c0 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductModel.cs
index 34ad110b2..4efd46107 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductModel.cs
@@ -1,14 +1,14 @@
using Grand.Domain.Catalog;
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using Grand.Web.Common.Validators;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductModel : BaseEntityModel, ILocalizedModel<ProductLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
@@ -408,6 +408,8 @@ public class ProductModel : BaseEntityModel, ILocalizedModel<ProductLocalizedMod
[UIHint("Stores")]
public string[] Stores { get; set; }
+ public string StoreId { get; set; }
+
#region Nested classes
public class AddProductModel : BaseModel
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewListModel.cs
index 44840f6e8..661d52b7a 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductReviewListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewModel.cs
index 9c70a7596..712245273 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductReviewModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductReviewModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductReviewModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductSpecificationAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductSpecificationAttributeModel.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductSpecificationAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductSpecificationAttributeModel.cs
index db3e35698..f27119d0c 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductSpecificationAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductSpecificationAttributeModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductSpecificationAttributeModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/ProductTagModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductTagModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Catalog/ProductTagModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/ProductTagModel.cs
index fbe42429f..ad0240597 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/ProductTagModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/ProductTagModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class ProductTagModel : BaseEntityModel, ILocalizedModel<ProductTagLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeModel.cs
index f2709640c..dac60d468 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class SpecificationAttributeModel : BaseEntityModel, ILocalizedModel<SpecificationAttributeLocalizedModel>,
IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeOptionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeOptionModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeOptionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeOptionModel.cs
index 56d43dffa..7424453d3 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/SpecificationAttributeOptionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Catalog/SpecificationAttributeOptionModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Catalog;
+namespace Grand.Web.AdminShared.Models.Catalog;
public class SpecificationAttributeOptionModel : BaseEntityModel,
ILocalizedModel<SpecificationAttributeOptionLocalizedModel>
diff --git a/src/Web/Grand.Web.Admin/Models/Cms/AdminWidgetModel.cs b/src/Web/Grand.Web.AdminShared/Models/Cms/AdminWidgetModel.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/Cms/AdminWidgetModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Cms/AdminWidgetModel.cs
index 2cd2ee4e1..eeb8639b2 100644
--- a/src/Web/Grand.Web.Admin/Models/Cms/AdminWidgetModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Cms/AdminWidgetModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Cms;
+namespace Grand.Web.AdminShared.Models.Cms;
public class AdminWidgetModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Cms/WidgetModel.cs b/src/Web/Grand.Web.AdminShared/Models/Cms/WidgetModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Cms/WidgetModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Cms/WidgetModel.cs
index f5cae2ad5..3a5b493f2 100644
--- a/src/Web/Grand.Web.Admin/Models/Cms/WidgetModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Cms/WidgetModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Cms;
+namespace Grand.Web.AdminShared.Models.Cms;
public class WidgetModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/AddressAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Common/AddressAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeModel.cs
index 558cd1562..5e420e8f0 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/AddressAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class AddressAttributeModel : BaseEntityModel, ILocalizedModel<AddressAttributeLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/AddressAttributeValueModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeValueModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Common/AddressAttributeValueModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeValueModel.cs
index afc852d9d..016991848 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/AddressAttributeValueModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/AddressAttributeValueModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class AddressAttributeValueModel : BaseEntityModel, ILocalizedModel<AddressAttributeValueLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/AddressModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/AddressModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Common/AddressModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/AddressModel.cs
index 001c9386e..e211ddec8 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/AddressModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/AddressModel.cs
@@ -7,7 +7,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class AddressModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/Editor.cs b/src/Web/Grand.Web.AdminShared/Models/Common/Editor.cs
similarity index 55%
rename from src/Web/Grand.Web.Admin/Models/Common/Editor.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/Editor.cs
index b33b138ca..a6a4cad68 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/Editor.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/Editor.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class Editor
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/EntityType.cs b/src/Web/Grand.Web.AdminShared/Models/Common/EntityType.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/Common/EntityType.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/EntityType.cs
index d805c2556..156b82988 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/EntityType.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/EntityType.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public enum EntityType
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/LanguageSelectorModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/LanguageSelectorModel.cs
similarity index 71%
rename from src/Web/Grand.Web.Admin/Models/Common/LanguageSelectorModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/LanguageSelectorModel.cs
index 2e4461db8..41bda31bf 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/LanguageSelectorModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/LanguageSelectorModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class LanguageSelectorModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/LoginModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/LoginModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Common/LoginModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/LoginModel.cs
index 787e85ea1..f96f6695f 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/LoginModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/LoginModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class LoginModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/MaintenanceModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/MaintenanceModel.cs
index 75d5092fa..1f68717ba 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/MaintenanceModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/MaintenanceModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class MaintenanceModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/PictureModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/PictureModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Common/PictureModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/PictureModel.cs
index 4a7930cdc..1ebf86973 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/PictureModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/PictureModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class PictureModel : BaseEntityModel, ILocalizedModel<PictureModel.PictureLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/ReviewModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/ReviewModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Common/ReviewModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/ReviewModel.cs
index 6dfc3cbfe..9e90aeade 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/ReviewModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/ReviewModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class ReviewModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/SearchTermReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/SearchTermReportLineModel.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Models/Common/SearchTermReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/SearchTermReportLineModel.cs
index cc0e8bea5..8d45d3771 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/SearchTermReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/SearchTermReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class SearchTermReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/SystemInfoModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/SystemInfoModel.cs
index 4c93b74d3..56fae291a 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/SystemInfoModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class SystemInfoModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/UrlEntityListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Common/UrlEntityListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityListModel.cs
index 7670759ac..5c0a3c17c 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/UrlEntityListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class UrlEntityListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/UrlEntityModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Common/UrlEntityModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityModel.cs
index 1608845ef..e3ef7a538 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/UrlEntityModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/UrlEntityModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class UrlEntityModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Common/UserFieldModel.cs b/src/Web/Grand.Web.AdminShared/Models/Common/UserFieldModel.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/Common/UserFieldModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Common/UserFieldModel.cs
index 9e141cc86..923b80117 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/UserFieldModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Common/UserFieldModel.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Common;
+namespace Grand.Web.AdminShared.Models.Common;
public class UserFieldModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Country/CountriesListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Country/CountriesListModel.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/Country/CountriesListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Country/CountriesListModel.cs
index 419e969db..e2138a866 100644
--- a/src/Web/Grand.Web.Admin/Models/Country/CountriesListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Country/CountriesListModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Country;
+namespace Grand.Web.AdminShared.Models.Country;
public class CountriesListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Courses/CourseLessonModel.cs b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseLessonModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Courses/CourseLessonModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Courses/CourseLessonModel.cs
index aa31690e3..83db54b40 100644
--- a/src/Web/Grand.Web.Admin/Models/Courses/CourseLessonModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseLessonModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Courses;
+namespace Grand.Web.AdminShared.Models.Courses;
public class CourseLessonModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Courses/CourseLevelModel.cs b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseLevelModel.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Models/Courses/CourseLevelModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Courses/CourseLevelModel.cs
index 9e8263885..eacd60588 100644
--- a/src/Web/Grand.Web.Admin/Models/Courses/CourseLevelModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseLevelModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Courses;
+namespace Grand.Web.AdminShared.Models.Courses;
public class CourseLevelModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Courses/CourseModel.cs b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Courses/CourseModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Courses/CourseModel.cs
index 6389ed81c..cae21ea1d 100644
--- a/src/Web/Grand.Web.Admin/Models/Courses/CourseModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Courses;
+namespace Grand.Web.AdminShared.Models.Courses;
public class CourseModel : BaseEntityModel, ILocalizedModel<CourseLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Courses/CourseSubjectModel.cs b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseSubjectModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Courses/CourseSubjectModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Courses/CourseSubjectModel.cs
index 4e4216294..0477a9156 100644
--- a/src/Web/Grand.Web.Admin/Models/Courses/CourseSubjectModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Courses/CourseSubjectModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Courses;
+namespace Grand.Web.AdminShared.Models.Courses;
public class CourseSubjectModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/BestCustomerReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomerReportLineModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Customers/BestCustomerReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomerReportLineModel.cs
index 6b21fcef5..60a84f3f1 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/BestCustomerReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomerReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class BestCustomerReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/BestCustomersReportModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomersReportModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Customers/BestCustomersReportModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomersReportModel.cs
index e9d928566..4c2f79c9e 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/BestCustomersReportModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/BestCustomersReportModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class BestCustomersReportModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAddressModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAddressModel.cs
similarity index 65%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerAddressModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAddressModel.cs
index 3ff373445..dcf76fec3 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAddressModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAddressModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerAddressModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeModel.cs
index 4d76ebf2b..2b920b5d1 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerAttributeModel : BaseEntityModel, ILocalizedModel<CustomerAttributeLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeValueModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeValueModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeValueModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeValueModel.cs
index f5cec7407..5ec1032a0 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerAttributeValueModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerAttributeValueModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerAttributeValueModel : BaseEntityModel, ILocalizedModel<CustomerAttributeValueLocalizedModel>
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupAclUpdateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupAclUpdateModel.cs
new file mode 100644
index 000000000..6190bfdc2
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupAclUpdateModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Customers;
+
+public record CustomerGroupAclUpdateModel(string CustomerGroupId, string Id, bool Access);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupDeleteModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupDeleteModel.cs
new file mode 100644
index 000000000..ff1487c86
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupDeleteModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Customers;
+
+public record CustomerGroupDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupModel.cs
index 96a7a200d..86d716dbc 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerGroupModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupPermissionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupPermissionModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupPermissionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupPermissionModel.cs
index f7e2d89ff..dd97e2c35 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupPermissionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupPermissionModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerGroupPermissionModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupProductModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupProductModel.cs
index d7323cce8..1824e258b 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerGroupProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerGroupProductModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerGroupProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerListModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerListModel.cs
index eb7fbc1d5..bf9459bc8 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerModel.cs
index 173d63c73..e1f3a7d37 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerModel.cs
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerReportsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReportsModel.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerReportsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReportsModel.cs
index 840388304..faee8b7d6 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerReportsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReportsModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerReportsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerReviewModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReviewModel.cs
similarity index 56%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerReviewModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReviewModel.cs
index 27c857bca..b469484bf 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerReviewModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerReviewModel.cs
@@ -1,6 +1,6 @@
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerReviewModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerTagModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagModel.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerTagModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagModel.cs
index 2f8f14954..6fc5cb1fe 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerTagModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerTagModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/CustomerTagProductModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagProductModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Customers/CustomerTagProductModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagProductModel.cs
index 4b3e9274a..0bba467ce 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/CustomerTagProductModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/CustomerTagProductModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class CustomerTagProductModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/OnlineCustomerModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/OnlineCustomerModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Customers/OnlineCustomerModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/OnlineCustomerModel.cs
index 16a4d178b..8a74b048f 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/OnlineCustomerModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/OnlineCustomerModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class OnlineCustomerModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/RegisteredCustomerReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/RegisteredCustomerReportLineModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Customers/RegisteredCustomerReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/RegisteredCustomerReportLineModel.cs
index 3e1513e8a..4f77d55d4 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/RegisteredCustomerReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/RegisteredCustomerReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class RegisteredCustomerReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/SalesEmployeeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/SalesEmployeeModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Customers/SalesEmployeeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/SalesEmployeeModel.cs
index 40408b8ce..f07b48207 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/SalesEmployeeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/SalesEmployeeModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class SalesEmployeeModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/UserApiCreateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/UserApiCreateModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Customers/UserApiCreateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/UserApiCreateModel.cs
index 38b7dab76..528f57449 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/UserApiCreateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/UserApiCreateModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class UserApiCreateModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Customers/UserApiModel.cs b/src/Web/Grand.Web.AdminShared/Models/Customers/UserApiModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Customers/UserApiModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Customers/UserApiModel.cs
index b203d20ae..d6bf33e23 100644
--- a/src/Web/Grand.Web.Admin/Models/Customers/UserApiModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Customers/UserApiModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Customers;
+namespace Grand.Web.AdminShared.Models.Customers;
public class UserApiModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/CountryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/CountryModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Directory/CountryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/CountryModel.cs
index 02a40cf5d..6fff18183 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/CountryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/CountryModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class CountryModel : BaseEntityModel, ILocalizedModel<CountryLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/CurrencyModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/CurrencyModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Directory/CurrencyModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/CurrencyModel.cs
index 7bbba0073..0e0a9703f 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/CurrencyModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/CurrencyModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class CurrencyModel : BaseEntityModel, ILocalizedModel<CurrencyLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Directory/ExchangeRateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/ExchangeRateModel.cs
new file mode 100644
index 000000000..e119dc1dc
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/ExchangeRateModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Directory;
+
+public record ExchangeRateModel(string ExchangeRateProvider, bool AutoUpdateEnabled);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/MeasureDimensionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureDimensionModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Directory/MeasureDimensionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/MeasureDimensionModel.cs
index 38fe49a8a..2c2d83ea0 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/MeasureDimensionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureDimensionModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class MeasureDimensionModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/MeasureUnitModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureUnitModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Directory/MeasureUnitModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/MeasureUnitModel.cs
index 6bbd5a55c..65a199324 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/MeasureUnitModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureUnitModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class MeasureUnitModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/MeasureWeightModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureWeightModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Directory/MeasureWeightModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/MeasureWeightModel.cs
index 389a0c468..cdc37ec92 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/MeasureWeightModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/MeasureWeightModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class MeasureWeightModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/RobotsTxtModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/RobotsTxtModel.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Models/Directory/RobotsTxtModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/RobotsTxtModel.cs
index 479b4cae0..80aa03f9a 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/RobotsTxtModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/RobotsTxtModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class RobotsTxtModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Directory/StateProvinceModel.cs b/src/Web/Grand.Web.AdminShared/Models/Directory/StateProvinceModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Directory/StateProvinceModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Directory/StateProvinceModel.cs
index c4a79f94a..685b91cd6 100644
--- a/src/Web/Grand.Web.Admin/Models/Directory/StateProvinceModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Directory/StateProvinceModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Directory;
+namespace Grand.Web.AdminShared.Models.Directory;
public class StateProvinceModel : BaseEntityModel, ILocalizedModel<StateProvinceLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Discounts/DiscountListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountListModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Discounts/DiscountListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountListModel.cs
index a3fbcc0b7..71cd550b6 100644
--- a/src/Web/Grand.Web.Admin/Models/Discounts/DiscountListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Discounts;
+namespace Grand.Web.AdminShared.Models.Discounts;
public class DiscountListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Discounts/DiscountModel.cs b/src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Discounts/DiscountModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountModel.cs
index 57377a6dd..d981715ae 100644
--- a/src/Web/Grand.Web.Admin/Models/Discounts/DiscountModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Discounts/DiscountModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Discounts;
+namespace Grand.Web.AdminShared.Models.Discounts;
public class DiscountModel : BaseEntityModel, IStoreLinkModel
{
@@ -43,15 +43,15 @@ public class DiscountModel : BaseEntityModel, IStoreLinkModel
[GrandResourceDisplayName("admin.marketing.Discounts.Fields.MaximumDiscountAmount")]
[UIHint("DoubleNullable")]
- public double? MaximumDiscountAmount { get; set; }
+ public double MaximumDiscountAmount { get; set; }
[GrandResourceDisplayName("admin.marketing.Discounts.Fields.StartDate")]
[UIHint("DateTimeNullable")]
- public DateTime? StartDate { get; set; }
+ public DateTime StartDate { get; set; }
[GrandResourceDisplayName("admin.marketing.Discounts.Fields.EndDate")]
[UIHint("DateTimeNullable")]
- public DateTime? EndDate { get; set; }
+ public DateTime EndDate { get; set; }
[GrandResourceDisplayName("admin.marketing.Discounts.Fields.RequiresCouponCode")]
public bool RequiresCouponCode { get; set; }
@@ -70,7 +70,7 @@ public class DiscountModel : BaseEntityModel, IStoreLinkModel
[GrandResourceDisplayName("admin.marketing.Discounts.Fields.MaximumDiscountedQuantity")]
[UIHint("Int32Nullable")]
- public int? MaximumDiscountedQuantity { get; set; }
+ public int MaximumDiscountedQuantity { get; set; }
[GrandResourceDisplayName("admin.marketing.Discounts.Requirements.DiscountRequirementType")]
public string AddDiscountRequirement { get; set; }
diff --git a/src/Web/Grand.Web.Admin/Models/Documents/DocumentListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentListModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Documents/DocumentListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Documents/DocumentListModel.cs
index 212374b51..b628e0aa0 100644
--- a/src/Web/Grand.Web.Admin/Models/Documents/DocumentListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentListModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Documents;
+namespace Grand.Web.AdminShared.Models.Documents;
public class DocumentListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Documents/DocumentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Documents/DocumentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Documents/DocumentModel.cs
index 2a6f3d1c2..fe49ed56c 100644
--- a/src/Web/Grand.Web.Admin/Models/Documents/DocumentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Documents;
+namespace Grand.Web.AdminShared.Models.Documents;
public class DocumentModel : BaseEntityModel, IGroupLinkModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Documents/DocumentTypeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentTypeModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Documents/DocumentTypeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Documents/DocumentTypeModel.cs
index 5953bf9ff..4e09735fa 100644
--- a/src/Web/Grand.Web.Admin/Models/Documents/DocumentTypeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Documents/DocumentTypeModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Documents;
+namespace Grand.Web.AdminShared.Models.Documents;
public class DocumentTypeModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Documents/SimpleDocumentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Documents/SimpleDocumentModel.cs
similarity index 74%
rename from src/Web/Grand.Web.Admin/Models/Documents/SimpleDocumentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Documents/SimpleDocumentModel.cs
index cf509ae97..8232719c5 100644
--- a/src/Web/Grand.Web.Admin/Models/Documents/SimpleDocumentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Documents/SimpleDocumentModel.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Documents;
+namespace Grand.Web.AdminShared.Models.Documents;
public class SimpleDocumentModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/ExternalAuthentication/AuthenticationMethodModel.cs b/src/Web/Grand.Web.AdminShared/Models/ExternalAuthentication/AuthenticationMethodModel.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Models/ExternalAuthentication/AuthenticationMethodModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/ExternalAuthentication/AuthenticationMethodModel.cs
index 528b17d61..a63d38967 100644
--- a/src/Web/Grand.Web.Admin/Models/ExternalAuthentication/AuthenticationMethodModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/ExternalAuthentication/AuthenticationMethodModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.ExternalAuthentication;
+namespace Grand.Web.AdminShared.Models.ExternalAuthentication;
public class AuthenticationMethodModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Home/DashboardModel.cs b/src/Web/Grand.Web.AdminShared/Models/Home/DashboardModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Home/DashboardModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Home/DashboardModel.cs
index 53bdfc378..a8b15945e 100644
--- a/src/Web/Grand.Web.Admin/Models/Home/DashboardModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Home/DashboardModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Home;
+namespace Grand.Web.AdminShared.Models.Home;
public class DashboardModel : BaseModel;
diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs
index 86e7a280b..8d33c3b88 100644
--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleGridModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Knowledgebase;
+namespace Grand.Web.AdminShared.Models.Knowledgebase;
public class KnowledgebaseArticleGridModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleModel.cs
index 64b3cf627..b03db2ec7 100644
--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseArticleModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseArticleModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Knowledgebase;
+namespace Grand.Web.AdminShared.Models.Knowledgebase;
public class KnowledgebaseArticleModel : BaseEntityModel, ILocalizedModel<KnowledgebaseArticleLocalizedModel>,
IGroupLinkModel, IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseCategoryModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseCategoryModel.cs
index 6ae44b772..11c3223bb 100644
--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseCategoryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseCategoryModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Knowledgebase;
+namespace Grand.Web.AdminShared.Models.Knowledgebase;
public class KnowledgebaseCategoryModel : BaseEntityModel, ILocalizedModel<KnowledgebaseCategoryLocalizedModel>,
IGroupLinkModel, IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs
index 430f2204a..216cd6353 100644
--- a/src/Web/Grand.Web.Admin/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Knowledgebase/KnowledgebaseRelatedArticleGridModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Knowledgebase;
+namespace Grand.Web.AdminShared.Models.Knowledgebase;
public class KnowledgebaseRelatedArticleGridModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Layouts/BrandLayoutModel.cs b/src/Web/Grand.Web.AdminShared/Models/Layouts/BrandLayoutModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Layouts/BrandLayoutModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Layouts/BrandLayoutModel.cs
index e8d525a5e..49d4997b1 100644
--- a/src/Web/Grand.Web.Admin/Models/Layouts/BrandLayoutModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Layouts/BrandLayoutModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Layouts;
+namespace Grand.Web.AdminShared.Models.Layouts;
public class BrandLayoutModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Layouts/CategoryLayoutModel.cs b/src/Web/Grand.Web.AdminShared/Models/Layouts/CategoryLayoutModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Layouts/CategoryLayoutModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Layouts/CategoryLayoutModel.cs
index 0e3d47a51..fc14ff9a6 100644
--- a/src/Web/Grand.Web.Admin/Models/Layouts/CategoryLayoutModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Layouts/CategoryLayoutModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Layouts;
+namespace Grand.Web.AdminShared.Models.Layouts;
public class CategoryLayoutModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Layouts/CollectionLayoutModel.cs b/src/Web/Grand.Web.AdminShared/Models/Layouts/CollectionLayoutModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Layouts/CollectionLayoutModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Layouts/CollectionLayoutModel.cs
index 5d41f2c58..b6866195f 100644
--- a/src/Web/Grand.Web.Admin/Models/Layouts/CollectionLayoutModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Layouts/CollectionLayoutModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Layouts;
+namespace Grand.Web.AdminShared.Models.Layouts;
public class CollectionLayoutModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Layouts/PageLayoutModel.cs b/src/Web/Grand.Web.AdminShared/Models/Layouts/PageLayoutModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Layouts/PageLayoutModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Layouts/PageLayoutModel.cs
index 795ad2f9d..e0e6b3e7a 100644
--- a/src/Web/Grand.Web.Admin/Models/Layouts/PageLayoutModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Layouts/PageLayoutModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Layouts;
+namespace Grand.Web.AdminShared.Models.Layouts;
public class PageLayoutModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Layouts/ProductLayoutModel.cs b/src/Web/Grand.Web.AdminShared/Models/Layouts/ProductLayoutModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Layouts/ProductLayoutModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Layouts/ProductLayoutModel.cs
index 662d84d6d..31ffb8317 100644
--- a/src/Web/Grand.Web.Admin/Models/Layouts/ProductLayoutModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Layouts/ProductLayoutModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Layouts;
+namespace Grand.Web.AdminShared.Models.Layouts;
public class ProductLayoutModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Localization/LanguageModel.cs b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Localization/LanguageModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Localization/LanguageModel.cs
index f5c515be7..ea7985bc8 100644
--- a/src/Web/Grand.Web.Admin/Models/Localization/LanguageModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Localization;
+namespace Grand.Web.AdminShared.Models.Localization;
public class LanguageModel : BaseEntityModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceFilterModel.cs b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceFilterModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceFilterModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceFilterModel.cs
index 31490f0b7..1a9a1381d 100644
--- a/src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceFilterModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceFilterModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Localization;
+namespace Grand.Web.AdminShared.Models.Localization;
public class LanguageResourceFilterModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceModel.cs b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceModel.cs
index 2a4173017..1da009db1 100644
--- a/src/Web/Grand.Web.Admin/Models/Localization/LanguageResourceModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Localization/LanguageResourceModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Localization;
+namespace Grand.Web.AdminShared.Models.Localization;
public class LanguageResourceModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Menu/MenuListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Menu/MenuListModel.cs
similarity index 78%
rename from src/Web/Grand.Web.Admin/Models/Menu/MenuListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Menu/MenuListModel.cs
index 839fa7e75..0dbf84706 100644
--- a/src/Web/Grand.Web.Admin/Models/Menu/MenuListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Menu/MenuListModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Menu;
+namespace Grand.Web.AdminShared.Models.Menu;
public class MenuListModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Menu/MenuModel.cs b/src/Web/Grand.Web.AdminShared/Models/Menu/MenuModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Menu/MenuModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Menu/MenuModel.cs
index 8775ab9ba..fe80c7077 100644
--- a/src/Web/Grand.Web.Admin/Models/Menu/MenuModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Menu/MenuModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Menu;
+namespace Grand.Web.AdminShared.Models.Menu;
public class MenuModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/CampaignModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/CampaignModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Messages/CampaignModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/CampaignModel.cs
index 53f1900d8..0b6595ad3 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/CampaignModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/CampaignModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class CampaignModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeModel.cs
index 28d3b3c5a..7d01a8dea 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeModel.cs
@@ -6,7 +6,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class ContactAttributeModel : BaseEntityModel, ILocalizedModel<ContactAttributeLocalizedModel>, IGroupLinkModel,
IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeValueModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeValueModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeValueModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeValueModel.cs
index 4fd01255a..6c918604e 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/ContactAttributeValueModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactAttributeValueModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class ContactAttributeValueModel : BaseEntityModel, ILocalizedModel<ContactAttributeValueLocalizedModel>
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormDeleteModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormDeleteModel.cs
new file mode 100644
index 000000000..304389c44
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormDeleteModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Messages;
+
+public record ContactFormDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormListModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Messages/ContactFormListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormListModel.cs
index 04c6b75c3..ad55acc7b 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class ContactFormListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Messages/ContactFormModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormModel.cs
index c751dc579..e8be5c515 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/ContactFormModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/ContactFormModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class ContactFormModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/EmailAccountModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/EmailAccountModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Messages/EmailAccountModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/EmailAccountModel.cs
index 898abcfe2..c0730a9a5 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/EmailAccountModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/EmailAccountModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class EmailAccountModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateListModel.cs
index 6e7ebfe2e..7f2540e66 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class MessageTemplateListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateModel.cs
index b9adea802..ec0377220 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/MessageTemplateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/MessageTemplateModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class MessageTemplateModel : BaseEntityModel, ILocalizedModel<MessageTemplateLocalizedModel>, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionListModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionListModel.cs
index 4ed697b16..be3c7d9fb 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class NewsLetterSubscriptionListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionModel.cs
index 7708cba7e..7572e559f 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/NewsLetterSubscriptionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsLetterSubscriptionModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class NewsLetterSubscriptionModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/NewsletterCategoryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsletterCategoryModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Messages/NewsletterCategoryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/NewsletterCategoryModel.cs
index 98464c9c5..e58ef258e 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/NewsletterCategoryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/NewsletterCategoryModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class NewsletterCategoryModel : BaseEntityModel, ILocalizedModel<NewsletterCategoryLocalizedModel>,
IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailListModel.cs
index 9c6b70c17..c1eadf937 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class QueuedEmailListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailModel.cs b/src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailModel.cs
index 9aa5744dc..a89319930 100644
--- a/src/Web/Grand.Web.Admin/Models/Messages/QueuedEmailModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Messages/QueuedEmailModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Messages;
+namespace Grand.Web.AdminShared.Models.Messages;
public class QueuedEmailModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/News/NewsCommentModel.cs b/src/Web/Grand.Web.AdminShared/Models/News/NewsCommentModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/News/NewsCommentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/News/NewsCommentModel.cs
index 7828a07c2..9ac083ec5 100644
--- a/src/Web/Grand.Web.Admin/Models/News/NewsCommentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/News/NewsCommentModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.News;
+namespace Grand.Web.AdminShared.Models.News;
public class NewsCommentModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/News/NewsItemListModel.cs b/src/Web/Grand.Web.AdminShared/Models/News/NewsItemListModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/News/NewsItemListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/News/NewsItemListModel.cs
index 4c32309f0..14e25b1c6 100644
--- a/src/Web/Grand.Web.Admin/Models/News/NewsItemListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/News/NewsItemListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.News;
+namespace Grand.Web.AdminShared.Models.News;
public class NewsItemListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/News/NewsItemModel.cs b/src/Web/Grand.Web.AdminShared/Models/News/NewsItemModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/News/NewsItemModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/News/NewsItemModel.cs
index e6fdb15e9..825fffe46 100644
--- a/src/Web/Grand.Web.Admin/Models/News/NewsItemModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/News/NewsItemModel.cs
@@ -4,7 +4,7 @@ using Grand.Web.Common.Link;
using Grand.Web.Common.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.News;
+namespace Grand.Web.AdminShared.Models.News;
public class NewsItemModel : BaseEntityModel, ILocalizedModel<NewsLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/AddProductToOrderModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/AddProductToOrderModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Orders/AddProductToOrderModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/AddProductToOrderModel.cs
index 96509e305..b9ddc936b 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/AddProductToOrderModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/AddProductToOrderModel.cs
@@ -2,7 +2,7 @@
using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public record AddProductToOrderModel(
string OrderId,
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/AddShipmentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/AddShipmentModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Orders/AddShipmentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/AddShipmentModel.cs
index ad3706ff2..458930107 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/AddShipmentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/AddShipmentModel.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class AddShipmentModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportLineModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportLineModel.cs
index 37d445b51..10eee5438 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class BestsellersReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportModel.cs
index 0ec9951ec..c66de93fe 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/BestsellersReportModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/BestsellersReportModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class BestsellersReportModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeModel.cs
index ff07ea842..ecb39bb3c 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeModel.cs
@@ -6,7 +6,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class CheckoutAttributeModel : BaseEntityModel, ILocalizedModel<CheckoutAttributeLocalizedModel>,
IGroupLinkModel, IStoreLinkModel
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeValueModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeValueModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeValueModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeValueModel.cs
index 82195bd31..f85c8c793 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/CheckoutAttributeValueModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/CheckoutAttributeValueModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class CheckoutAttributeValueModel : BaseEntityModel, ILocalizedModel<CheckoutAttributeValueLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/CountryReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportLineModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Orders/CountryReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportLineModel.cs
index a4dad7ace..c28e37fee 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/CountryReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class CountryReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/CountryReportModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Orders/CountryReportModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportModel.cs
index b8ffda166..a5427ff19 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/CountryReportModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/CountryReportModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class CountryReportModel : BaseModel
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherDeleteModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherDeleteModel.cs
new file mode 100644
index 000000000..48e8eb507
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherDeleteModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Orders;
+
+public record GiftVoucherDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherListModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherListModel.cs
index 9645ed579..3976a14b1 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class GiftVoucherListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherModel.cs
index d39fb1714..66487cbaf 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/GiftVoucherModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class GiftVoucherModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherNotifyRecipient.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherNotifyRecipient.cs
new file mode 100644
index 000000000..06f581692
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/GiftVoucherNotifyRecipient.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Orders;
+
+public record GiftVoucherNotifyRecipient(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnListModel.cs
index 50149b10f..c0a94f0c5 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class MerchandiseReturnListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnModel.cs
index 6e24af5ed..52045a631 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/MerchandiseReturnModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/MerchandiseReturnModel.cs
@@ -1,9 +1,9 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class MerchandiseReturnModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportLineModel.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportLineModel.cs
index a1be097c5..a2131cc73 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class NeverSoldReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportModel.cs
index 2faa0eccd..d53c46cae 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/NeverSoldReportModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/NeverSoldReportModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class NeverSoldReportModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderAddressModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderAddressModel.cs
similarity index 70%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderAddressModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderAddressModel.cs
index 1ffde66e3..67e22ff4d 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderAddressModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderAddressModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderAddressModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderAverageReportLineSummaryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderAverageReportLineSummaryModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderAverageReportLineSummaryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderAverageReportLineSummaryModel.cs
index 4b540c66d..acb8a2c8b 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderAverageReportLineSummaryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderAverageReportLineSummaryModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderAverageReportLineSummaryModel : BaseModel
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Orders/OrderDeleteModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderDeleteModel.cs
new file mode 100644
index 000000000..ca465cecf
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderDeleteModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Orders;
+
+public record OrderDeleteModel(string Id);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderIncompleteReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderIncompleteReportLineModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderIncompleteReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderIncompleteReportLineModel.cs
index f6515eab6..71bdb8fe4 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderIncompleteReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderIncompleteReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderIncompleteReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderItemsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderItemsModel.cs
similarity index 67%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderItemsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderItemsModel.cs
index 5a9cb3df7..faffdd1f2 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderItemsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderItemsModel.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public record OrderItemsModel(IList<OrderItemModel> Items, string OrderItemId);
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderListModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderListModel.cs
index a2d764257..7a380c833 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderModel.cs
index e59fd0edf..f64743d3c 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderModel.cs
@@ -3,11 +3,11 @@ using Grand.Domain.Payments;
using Grand.Domain.Tax;
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderPeriodReportLineModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderPeriodReportLineModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderPeriodReportLineModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderPeriodReportLineModel.cs
index 0e7867799..2fcb209ad 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderPeriodReportLineModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderPeriodReportLineModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderPeriodReportLineModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderStatusModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderStatusModel.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderStatusModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderStatusModel.cs
index 08336b421..5c45d1b68 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderStatusModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderStatusModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderStatusModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/OrderTagModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderTagModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Orders/OrderTagModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/OrderTagModel.cs
index f7b97dce1..22580e2ab 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/OrderTagModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/OrderTagModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class OrderTagModel : BaseEntityModel, ILocalizedModel<OrderTagLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionListModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionListModel.cs
index 02ee2b8e1..3d27a0e9a 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class PaymentTransactionListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionModel.cs
index e6d7cffc0..b0b91dc00 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/PaymentTransactionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/PaymentTransactionModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class PaymentTransactionModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/ShipmentListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentListModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Orders/ShipmentListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentListModel.cs
index da3679e87..b03788467 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/ShipmentListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentListModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class ShipmentListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Orders/ShipmentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Orders/ShipmentModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentModel.cs
index 5afa457ac..603192e95 100644
--- a/src/Web/Grand.Web.Admin/Models/Orders/ShipmentModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Orders;
+namespace Grand.Web.AdminShared.Models.Orders;
public class ShipmentModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Pages/PageListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Pages/PageListModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Pages/PageListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Pages/PageListModel.cs
index 7ce2762b1..682cd5766 100644
--- a/src/Web/Grand.Web.Admin/Models/Pages/PageListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Pages/PageListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Pages;
+namespace Grand.Web.AdminShared.Models.Pages;
public class PageListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Pages/PageModel.cs b/src/Web/Grand.Web.AdminShared/Models/Pages/PageModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Pages/PageModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Pages/PageModel.cs
index 28378a86a..a2cec7839 100644
--- a/src/Web/Grand.Web.Admin/Models/Pages/PageModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Pages/PageModel.cs
@@ -5,7 +5,7 @@ using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Pages;
+namespace Grand.Web.AdminShared.Models.Pages;
public class PageModel : BaseEntityModel, ILocalizedModel<PageLocalizedModel>, IGroupLinkModel, IStoreLinkModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodModel.cs b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodModel.cs
index cb606b62e..5fde2f0f9 100644
--- a/src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Payments;
+namespace Grand.Web.AdminShared.Models.Payments;
public class PaymentMethodModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodRestrictionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodRestrictionModel.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodRestrictionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodRestrictionModel.cs
index 0c1f03592..5c4625530 100644
--- a/src/Web/Grand.Web.Admin/Models/Payments/PaymentMethodRestrictionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentMethodRestrictionModel.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Directory;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Directory;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Models.Payments;
+namespace Grand.Web.AdminShared.Models.Payments;
public class PaymentMethodRestrictionModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Payments/PaymentSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentSettingsModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Payments/PaymentSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Payments/PaymentSettingsModel.cs
index 7c6e16a9c..d8e67392b 100644
--- a/src/Web/Grand.Web.Admin/Models/Payments/PaymentSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Payments/PaymentSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Payments;
+namespace Grand.Web.AdminShared.Models.Payments;
public class PaymentSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionModel.cs
index e8c8bcf4c..19cc94719 100644
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionActionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Permissions;
+namespace Grand.Web.AdminShared.Models.Permissions;
public class PermissionActionModel : BaseModel
{
diff --git a/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionSaveModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionSaveModel.cs
new file mode 100644
index 000000000..a4f785c21
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionActionSaveModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.AdminShared.Models.Permissions;
+
+public record PermissionActionSaveModel(string SystemName, string CustomerGroupId, IList<string> SelectedActions);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionCreateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionCreateModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Permissions/PermissionCreateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionCreateModel.cs
index a2d07de71..60bfefa1a 100644
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionCreateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionCreateModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Permissions;
+namespace Grand.Web.AdminShared.Models.Permissions;
public class PermissionCreateModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionMappingModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionMappingModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Permissions/PermissionMappingModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionMappingModel.cs
index a28fedfe2..4a360f817 100644
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionMappingModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionMappingModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Permissions;
+namespace Grand.Web.AdminShared.Models.Permissions;
public class PermissionMappingModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionRecordModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionRecordModel.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Models/Permissions/PermissionRecordModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionRecordModel.cs
index a5ddba81b..df9d2b171 100644
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionRecordModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionRecordModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Permissions;
+namespace Grand.Web.AdminShared.Models.Permissions;
public class PermissionRecordModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionUpdateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionUpdateModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Permissions/PermissionUpdateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionUpdateModel.cs
index 7b6402777..0e7d00276 100644
--- a/src/Web/Grand.Web.Admin/Models/Permissions/PermissionUpdateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Permissions/PermissionUpdateModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Permissions;
+namespace Grand.Web.AdminShared.Models.Permissions;
public class PermissionUpdateModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Plugins/MiscPluginModel.cs b/src/Web/Grand.Web.AdminShared/Models/Plugins/MiscPluginModel.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Models/Plugins/MiscPluginModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Plugins/MiscPluginModel.cs
index 7a051c725..e5f34f3da 100644
--- a/src/Web/Grand.Web.Admin/Models/Plugins/MiscPluginModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Plugins/MiscPluginModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Plugins;
+namespace Grand.Web.AdminShared.Models.Plugins;
public class MiscPluginModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Plugins/PluginListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Plugins/PluginListModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Plugins/PluginListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Plugins/PluginListModel.cs
index a3cb3db93..150403af2 100644
--- a/src/Web/Grand.Web.Admin/Models/Plugins/PluginListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Plugins/PluginListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Plugins;
+namespace Grand.Web.AdminShared.Models.Plugins;
public class PluginListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Plugins/PluginModel.cs b/src/Web/Grand.Web.AdminShared/Models/Plugins/PluginModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Plugins/PluginModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Plugins/PluginModel.cs
index 26a9cad18..7d4aa0ead 100644
--- a/src/Web/Grand.Web.Admin/Models/Plugins/PluginModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Plugins/PluginModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Plugins;
+namespace Grand.Web.AdminShared.Models.Plugins;
public class PluginModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/PushNotifications/MessagesModel.cs b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/MessagesModel.cs
similarity index 72%
rename from src/Web/Grand.Web.Admin/Models/PushNotifications/MessagesModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/PushNotifications/MessagesModel.cs
index 5fb35f360..92db07de7 100644
--- a/src/Web/Grand.Web.Admin/Models/PushNotifications/MessagesModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/MessagesModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.PushNotifications;
+namespace Grand.Web.AdminShared.Models.PushNotifications;
public class MessagesModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushMessageGridModel.cs b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushMessageGridModel.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Models/PushNotifications/PushMessageGridModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushMessageGridModel.cs
index 988b03275..801b95872 100644
--- a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushMessageGridModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushMessageGridModel.cs
@@ -1,6 +1,6 @@
using Grand.Domain;
-namespace Grand.Web.Admin.Models.PushNotifications;
+namespace Grand.Web.AdminShared.Models.PushNotifications;
public class PushMessageGridModel : BaseEntity
{
diff --git a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushModel.cs b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/PushNotifications/PushModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushModel.cs
index eab84f382..f8b30c31e 100644
--- a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.PushNotifications;
+namespace Grand.Web.AdminShared.Models.PushNotifications;
public class PushModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushRegistrationGridModel.cs b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushRegistrationGridModel.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Models/PushNotifications/PushRegistrationGridModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushRegistrationGridModel.cs
index 10fe6d695..4ffdc4c87 100644
--- a/src/Web/Grand.Web.Admin/Models/PushNotifications/PushRegistrationGridModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/PushRegistrationGridModel.cs
@@ -1,6 +1,6 @@
using Grand.Domain;
-namespace Grand.Web.Admin.Models.PushNotifications;
+namespace Grand.Web.AdminShared.Models.PushNotifications;
public class PushRegistrationGridModel : BaseEntity
{
diff --git a/src/Web/Grand.Web.Admin/Models/PushNotifications/ReceiversModel.cs b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/ReceiversModel.cs
similarity index 72%
rename from src/Web/Grand.Web.Admin/Models/PushNotifications/ReceiversModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/PushNotifications/ReceiversModel.cs
index 43aef5fb0..38cd3e112 100644
--- a/src/Web/Grand.Web.Admin/Models/PushNotifications/ReceiversModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/PushNotifications/ReceiversModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.PushNotifications;
+namespace Grand.Web.AdminShared.Models.PushNotifications;
public class ReceiversModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/AdminSearchSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/AdminSearchSettingsModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Settings/AdminSearchSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/AdminSearchSettingsModel.cs
index f4cc06eb1..e3fba782c 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/AdminSearchSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/AdminSearchSettingsModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.ModelBinding;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class AdminSearchSettingsModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/CatalogSettingsModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/CatalogSettingsModel.cs
index c1d3f2a68..34ed5ddbe 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/CatalogSettingsModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class CatalogSettingsModel : BaseModel
{
@@ -241,8 +241,12 @@ public class CatalogSettingsModel : BaseModel
public IList<SelectListItem> DefaultViewModes { get; set; }
- [GrandResourceDisplayName("Admin.Settings.Catalog.DefaultCollectionPageSize")]
- public int DefaultCollectionPageSize { get; set; }
+ [GrandResourceDisplayName("Admin.Settings.Catalog.DefaultPageSizeOptions")]
+ public string DefaultPageSizeOptions { get; set; }
+
+ [GrandResourceDisplayName("Admin.Settings.Catalog.DefaultPageSize")]
+ public int DefaultPageSize { get; set; }
+
[GrandResourceDisplayName("Admin.Settings.Catalog.MaxCatalogPageSize")]
public int MaxCatalogPageSize { get; set; }
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/ContentSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/ContentSettingsModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Settings/ContentSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/ContentSettingsModel.cs
index 8f7c4d4ea..c3a0f18af 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/ContentSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/ContentSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class ContentSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/CustomerSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/CustomerSettingsModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Settings/CustomerSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/CustomerSettingsModel.cs
index bc8544ca5..31ee58194 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/CustomerSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/CustomerSettingsModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class CustomerSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/FoundMenuItem.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/FoundMenuItem.cs
similarity index 80%
rename from src/Web/Grand.Web.Admin/Models/Settings/FoundMenuItem.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/FoundMenuItem.cs
index 609c6688c..a5a587276 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/FoundMenuItem.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/FoundMenuItem.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class FoundMenuItem
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/GeneralCommonSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/GeneralCommonSettingsModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Settings/GeneralCommonSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/GeneralCommonSettingsModel.cs
index fffb72f50..2267e6d5f 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/GeneralCommonSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/GeneralCommonSettingsModel.cs
@@ -1,10 +1,11 @@
-using Grand.Infrastructure.ModelBinding;
+using Grand.Domain.Common;
+using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
using Grand.Web.Common.Security.Captcha;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class GeneralCommonSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/MediaSettingsModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/MediaSettingsModel.cs
index 04b0165cc..91b655fb9 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/MediaSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class MediaSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnActionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnActionModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnActionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnActionModel.cs
index 17a2c80dd..4a22dc1dc 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnActionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnActionModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class MerchandiseReturnActionModel : BaseEntityModel, ILocalizedModel<MerchandiseReturnActionLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnReasonModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnReasonModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnReasonModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnReasonModel.cs
index 283fe7ff7..f375060d8 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/MerchandiseReturnReasonModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/MerchandiseReturnReasonModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class MerchandiseReturnReasonModel : BaseEntityModel, ILocalizedModel<MerchandiseReturnReasonLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/PushNotificationsSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/PushNotificationsSettingsModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Settings/PushNotificationsSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/PushNotificationsSettingsModel.cs
index 1b1d4e721..ea9fe025b 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/PushNotificationsSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/PushNotificationsSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class PushNotificationsSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/SalesSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/SalesSettingsModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Settings/SalesSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/SalesSettingsModel.cs
index 61516eb7b..dcb1a6ecb 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/SalesSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/SalesSettingsModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class SalesSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/SettingModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/SettingModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Settings/SettingModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/SettingModel.cs
index dd30e0e65..dee1eedb3 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/SettingModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/SettingModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class SettingModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/SortOptionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/SortOptionModel.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Models/Settings/SortOptionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/SortOptionModel.cs
index 2544ef506..0ff4a8cbe 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/SortOptionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/SortOptionModel.cs
@@ -1,6 +1,6 @@
using Grand.Infrastructure.ModelBinding;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class SortOptionModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/StoreScopeModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/StoreScopeModel.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Models/Settings/StoreScopeModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/StoreScopeModel.cs
index b77772f98..991d0f620 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/StoreScopeModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/StoreScopeModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class StoreScopeModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/SystemSettingsModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/SystemSettingsModel.cs
index ec2d6588c..15cca65fb 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/SystemSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class SystemSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/VendorSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Settings/VendorSettingsModel.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Models/Settings/VendorSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Settings/VendorSettingsModel.cs
index ff8a75520..01f7cac72 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/VendorSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Settings/VendorSettingsModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Settings;
+namespace Grand.Web.AdminShared.Models.Settings;
public class VendorSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/DeliveryDateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/DeliveryDateModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Shipping/DeliveryDateModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/DeliveryDateModel.cs
index f57bbfdd8..d20b4bd60 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/DeliveryDateModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/DeliveryDateModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class DeliveryDateModel : BaseEntityModel, ILocalizedModel<DeliveryDateLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/PickupPointModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Shipping/PickupPointModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs
index 557892b62..5e1000417 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/PickupPointModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs
@@ -1,9 +1,9 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class PickupPointModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodModel.cs
index 82f6c5a7e..48151cb96 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class ShippingMethodModel : BaseEntityModel, ILocalizedModel<ShippingMethodLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodRestrictionModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodRestrictionModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodRestrictionModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodRestrictionModel.cs
index ef94d073b..c29147db0 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingMethodRestrictionModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodRestrictionModel.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
using Grand.Web.Common.Models;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class ShippingMethodRestrictionModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingRateComputationMethodModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingRateComputationMethodModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/Shipping/ShippingRateComputationMethodModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingRateComputationMethodModel.cs
index 5f114e8e5..988487253 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingRateComputationMethodModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingRateComputationMethodModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class ShippingRateComputationMethodModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingSettingsModel.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Models/Shipping/ShippingSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingSettingsModel.cs
index 2a24ecad6..18bf49dbe 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/ShippingSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingSettingsModel.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class ShippingSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Shipping/WarehouseModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Models/Shipping/WarehouseModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs
index 37e27f422..153ca8bd8 100644
--- a/src/Web/Grand.Web.Admin/Models/Shipping/WarehouseModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs
@@ -1,8 +1,8 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Models.Shipping;
+namespace Grand.Web.AdminShared.Models.Shipping;
public class WarehouseModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartItemModel.cs b/src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartItemModel.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartItemModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartItemModel.cs
index 39e99dfa8..716dc0c9e 100644
--- a/src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartItemModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartItemModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.ShoppingCart;
+namespace Grand.Web.AdminShared.Models.ShoppingCart;
public class ShoppingCartItemModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartModel.cs b/src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartModel.cs
index 62bb64c34..63aa95caf 100644
--- a/src/Web/Grand.Web.Admin/Models/ShoppingCart/ShoppingCartModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/ShoppingCart/ShoppingCartModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.ShoppingCart;
+namespace Grand.Web.AdminShared.Models.ShoppingCart;
public class ShoppingCartModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Stores/StoreModel.cs b/src/Web/Grand.Web.AdminShared/Models/Stores/StoreModel.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Models/Stores/StoreModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Stores/StoreModel.cs
index cdbd69a47..aac794658 100644
--- a/src/Web/Grand.Web.Admin/Models/Stores/StoreModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Stores/StoreModel.cs
@@ -3,7 +3,7 @@ using Grand.Infrastructure.Models;
using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Stores;
+namespace Grand.Web.AdminShared.Models.Stores;
public class StoreModel : BaseEntityModel, ILocalizedModel<StoreLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Tasks/ScheduleTaskModel.cs b/src/Web/Grand.Web.AdminShared/Models/Tasks/ScheduleTaskModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Tasks/ScheduleTaskModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Tasks/ScheduleTaskModel.cs
index b4c44c4e4..828ea5550 100644
--- a/src/Web/Grand.Web.Admin/Models/Tasks/ScheduleTaskModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Tasks/ScheduleTaskModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Tasks;
+namespace Grand.Web.AdminShared.Models.Tasks;
public class ScheduleTaskModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Tax/TaxCategoryModel.cs b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxCategoryModel.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Models/Tax/TaxCategoryModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Tax/TaxCategoryModel.cs
index dce3eec1f..86c135413 100644
--- a/src/Web/Grand.Web.Admin/Models/Tax/TaxCategoryModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxCategoryModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Tax;
+namespace Grand.Web.AdminShared.Models.Tax;
public class TaxCategoryModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Tax/TaxProviderModel.cs b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxProviderModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Tax/TaxProviderModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Tax/TaxProviderModel.cs
index efd20f1de..ba6b69bea 100644
--- a/src/Web/Grand.Web.Admin/Models/Tax/TaxProviderModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxProviderModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Tax;
+namespace Grand.Web.AdminShared.Models.Tax;
public class TaxProviderModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Tax/TaxSettingsModel.cs b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxSettingsModel.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Models/Tax/TaxSettingsModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Tax/TaxSettingsModel.cs
index 68e3dcae9..fbc485be2 100644
--- a/src/Web/Grand.Web.Admin/Models/Tax/TaxSettingsModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Tax/TaxSettingsModel.cs
@@ -1,9 +1,9 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Models.Tax;
+namespace Grand.Web.AdminShared.Models.Tax;
public class TaxSettingsModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Vendors/VendorListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorListModel.cs
similarity index 82%
rename from src/Web/Grand.Web.Admin/Models/Vendors/VendorListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Vendors/VendorListModel.cs
index dae343af5..de1b9ef7b 100644
--- a/src/Web/Grand.Web.Admin/Models/Vendors/VendorListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorListModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Vendors;
+namespace Grand.Web.AdminShared.Models.Vendors;
public class VendorListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Vendors/VendorModel.cs b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Vendors/VendorModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Vendors/VendorModel.cs
index 3e97637b9..54cec5586 100644
--- a/src/Web/Grand.Web.Admin/Models/Vendors/VendorModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorModel.cs
@@ -1,12 +1,12 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Vendors;
+namespace Grand.Web.AdminShared.Models.Vendors;
public class VendorModel : BaseEntityModel, ILocalizedModel<VendorLocalizedModel>
{
diff --git a/src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewListModel.cs b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewListModel.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewListModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewListModel.cs
index 1b7480b41..e582599d5 100644
--- a/src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewListModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewListModel.cs
@@ -2,7 +2,7 @@
using Grand.Infrastructure.Models;
using System.ComponentModel.DataAnnotations;
-namespace Grand.Web.Admin.Models.Vendors;
+namespace Grand.Web.AdminShared.Models.Vendors;
public class VendorReviewListModel : BaseModel
{
diff --git a/src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewModel.cs b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewModel.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewModel.cs
rename to src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewModel.cs
index 4f7bcede4..891d85b5d 100644
--- a/src/Web/Grand.Web.Admin/Models/Vendors/VendorReviewModel.cs
+++ b/src/Web/Grand.Web.AdminShared/Models/Vendors/VendorReviewModel.cs
@@ -1,7 +1,7 @@
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-namespace Grand.Web.Admin.Models.Vendors;
+namespace Grand.Web.AdminShared.Models.Vendors;
public class VendorReviewModel : BaseEntityModel
{
diff --git a/src/Web/Grand.Web.Admin/Services/AddressAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/AddressAttributeViewModelService.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Services/AddressAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/AddressAttributeViewModelService.cs
index be8dfde8e..6c8f1a6a1 100644
--- a/src/Web/Grand.Web.Admin/Services/AddressAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/AddressAttributeViewModelService.cs
@@ -1,11 +1,11 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Domain.Common;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Localization;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class AddressAttributeViewModelService(
IAddressAttributeService addressAttributeService,
diff --git a/src/Web/Grand.Web.Admin/Services/AffiliateViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/AffiliateViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/AffiliateViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/AffiliateViewModelService.cs
index e8031f407..1b066fbe5 100644
--- a/src/Web/Grand.Web.Admin/Services/AffiliateViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/AffiliateViewModelService.cs
@@ -11,13 +11,13 @@ using Grand.Domain.Seo;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Affiliates;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Affiliates;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class AffiliateViewModelService : IAffiliateViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/BlogViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/BlogViewModelService.cs
index 8bef2a537..e59b6644d 100644
--- a/src/Web/Grand.Web.Admin/Services/BlogViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/BlogViewModelService.cs
@@ -10,16 +10,16 @@ using Grand.Domain.Blogs;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Blogs;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Blogs;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class BlogViewModelService : IBlogViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/BrandViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/BrandViewModelService.cs
index 8f56835d4..de37904a1 100644
--- a/src/Web/Grand.Web.Admin/Services/BrandViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/BrandViewModelService.cs
@@ -6,14 +6,14 @@ using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class BrandViewModelService : IBrandViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CampaignViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CampaignViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/CampaignViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CampaignViewModelService.cs
index 1f0f68131..4ac1b6ed2 100644
--- a/src/Web/Grand.Web.Admin/Services/CampaignViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CampaignViewModelService.cs
@@ -6,12 +6,12 @@ using Grand.Business.Core.Interfaces.Marketing.Customers;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Messages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CampaignViewModelService : ICampaignViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CategoryViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CategoryViewModelService.cs
index 35f551e8c..9ff867537 100644
--- a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CategoryViewModelService.cs
@@ -8,15 +8,15 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CategoryViewModelService : ICategoryViewModelService
{
@@ -104,8 +104,8 @@ public class CategoryViewModelService : ICategoryViewModelService
await PrepareDiscountModel(model, null, true, storeId);
//default values
- model.PageSize = _catalogSettings.DefaultCategoryPageSize;
- model.PageSizeOptions = _catalogSettings.DefaultCategoryPageSizeOptions;
+ model.PageSize = _catalogSettings.DefaultPageSize;
+ model.PageSizeOptions = _catalogSettings.DefaultPageSizeOptions;
model.Published = true;
model.IncludeInMenu = true;
model.AllowCustomersToSelectPageSize = true;
@@ -301,13 +301,11 @@ public class CategoryViewModelService : ICategoryViewModelService
});
}
- protected virtual async Task PrepareDiscountModel(CategoryModel model, Category category, bool excludeProperties,
- string storeId)
+ protected virtual async Task PrepareDiscountModel(CategoryModel model, Category category, bool excludeProperties, string storeId)
{
ArgumentNullException.ThrowIfNull(model);
- model.AvailableDiscounts = (await _discountService
- .GetDiscountsQuery(DiscountType.AssignedToCategories, storeId))
+ model.AvailableDiscounts = (await _discountService.GetDiscountsQuery(DiscountType.AssignedToCategories, storeId))
.Select(d => d.ToModel())
.ToList();
diff --git a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CheckoutAttributeViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CheckoutAttributeViewModelService.cs
index 1ac4dc0a2..8871673e2 100644
--- a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CheckoutAttributeViewModelService.cs
@@ -7,13 +7,13 @@ using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Directory;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CheckoutAttributeViewModelService(
ICheckoutAttributeService checkoutAttributeService,
diff --git a/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CollectionViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CollectionViewModelService.cs
index 01b48bdec..530b5d63d 100644
--- a/src/Web/Grand.Web.Admin/Services/CollectionViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CollectionViewModelService.cs
@@ -9,15 +9,15 @@ using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CollectionViewModelService : ICollectionViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ContactAttributeViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ContactAttributeViewModelService.cs
index 575263c0e..fbdea8e25 100644
--- a/src/Web/Grand.Web.Admin/Services/ContactAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ContactAttributeViewModelService.cs
@@ -3,13 +3,13 @@ using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Messages;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ContactAttributeViewModelService(
IContactAttributeService contactAttributeService,
diff --git a/src/Web/Grand.Web.Admin/Services/ContactFormViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ContactFormViewModelService.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Services/ContactFormViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ContactFormViewModelService.cs
index fabc47e61..f0a23c3d7 100644
--- a/src/Web/Grand.Web.Admin/Services/ContactFormViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ContactFormViewModelService.cs
@@ -4,12 +4,12 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Messages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ContactFormViewModelService : IContactFormViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CountryViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CountryViewModelService.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Services/CountryViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CountryViewModelService.cs
index 1932c76f1..e0aa95e6e 100644
--- a/src/Web/Grand.Web.Admin/Services/CountryViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CountryViewModelService.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Directory;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CountryViewModelService : ICountryViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CourseViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CourseViewModelService.cs
index a74bd69bf..5a3a4bf15 100644
--- a/src/Web/Grand.Web.Admin/Services/CourseViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CourseViewModelService.cs
@@ -7,16 +7,16 @@ using Grand.Business.Core.Interfaces.Marketing.Courses;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Catalog;
using Grand.Domain.Courses;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Courses;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CourseViewModelService(
ICourseService courseService,
diff --git a/src/Web/Grand.Web.Admin/Services/CurrencyViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CurrencyViewModelService.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Services/CurrencyViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CurrencyViewModelService.cs
index a8f1bee09..ba8938610 100644
--- a/src/Web/Grand.Web.Admin/Services/CurrencyViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CurrencyViewModelService.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Directory;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CurrencyViewModelService : ICurrencyViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CustomerAttributeViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CustomerAttributeViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/CustomerAttributeViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CustomerAttributeViewModelService.cs
index 04814349f..ccabbed9b 100644
--- a/src/Web/Grand.Web.Admin/Services/CustomerAttributeViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CustomerAttributeViewModelService.cs
@@ -1,11 +1,11 @@
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Customers;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Localization;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CustomerAttributeViewModelService : ICustomerAttributeViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CustomerGroupViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CustomerGroupViewModelService.cs
index 0a5de861c..9e72049d1 100644
--- a/src/Web/Grand.Web.Admin/Services/CustomerGroupViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CustomerGroupViewModelService.cs
@@ -5,15 +5,15 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CustomerGroupViewModelService : ICustomerGroupViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CustomerReportViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CustomerReportViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/CustomerReportViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CustomerReportViewModelService.cs
index 46533a151..a20517609 100644
--- a/src/Web/Grand.Web.Admin/Services/CustomerReportViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CustomerReportViewModelService.cs
@@ -6,12 +6,12 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Domain.Payments;
using Grand.Domain.Shipping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CustomerReportViewModelService : ICustomerReportViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CustomerTagViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CustomerTagViewModelService.cs
index f272740d4..7ae52d31e 100644
--- a/src/Web/Grand.Web.Admin/Services/CustomerTagViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CustomerTagViewModelService.cs
@@ -5,15 +5,15 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.Customers;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CustomerTagViewModelService : ICustomerTagViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/CustomerViewModelService.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/CustomerViewModelService.cs
index 30e33e54b..7a9f4243d 100644
--- a/src/Web/Grand.Web.Admin/Services/CustomerViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/CustomerViewModelService.cs
@@ -23,20 +23,23 @@ using Grand.Domain.Orders;
using Grand.Domain.Tax;
using Grand.Infrastructure;
using Grand.SharedKernel;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Models.Messages;
-using Grand.Web.Admin.Models.ShoppingCart;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Models.Messages;
+using Grand.Web.AdminShared.Models.ShoppingCart;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Models;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Rendering;
+using Microsoft.Extensions.DependencyInjection;
using System.Net;
+using System.Text;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class CustomerViewModelService : ICustomerViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/DiscountViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/DiscountViewModelService.cs
index 1da2cfbfa..8873e089c 100644
--- a/src/Web/Grand.Web.Admin/Services/DiscountViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/DiscountViewModelService.cs
@@ -14,16 +14,16 @@ using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Discounts;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using MediatR;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class DiscountViewModelService : IDiscountViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/DocumentViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/DocumentViewModelService.cs
index 0581e5783..afd39f1f0 100644
--- a/src/Web/Grand.Web.Admin/Services/DocumentViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/DocumentViewModelService.cs
@@ -10,12 +10,12 @@ using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Common;
using Grand.Domain.Documents;
using Grand.Domain.Payments;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Documents;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class DocumentViewModelService : IDocumentViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ElFinderViewModelService.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ElFinderViewModelService.cs
index 66e235e4a..c8d674277 100644
--- a/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ElFinderViewModelService.cs
@@ -4,10 +4,14 @@ using elFinder.Net.Core;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Media;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Interfaces;
+using Grand.Web.AdminShared.Interfaces;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Routing;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ElFinderViewModelService : IElFinderViewModelService
{
@@ -57,7 +61,7 @@ public class ElFinderViewModelService : IElFinderViewModelService
}
_fullPathToUpload = uploaded.PhysicalPath;
- var configuration = httpContextAccessor.HttpContext.RequestServices.GetRequiredService<IConfiguration>();
+ var configuration = httpContextAccessor.HttpContext!.RequestServices.GetRequiredService<IConfiguration>();
_urlpathUploded = (string.IsNullOrEmpty(configuration[CommonPath.DirectoryParam]) ? "/" : $"/{configuration[CommonPath.DirectoryParam]}/")
+ uploaded.Path.Replace("\\", "/") + "/";
diff --git a/src/Web/Grand.Web.Admin/Services/EmailAccountViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/EmailAccountViewModelService.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Services/EmailAccountViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/EmailAccountViewModelService.cs
index 8ba0e040f..e228ad2c5 100644
--- a/src/Web/Grand.Web.Admin/Services/EmailAccountViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/EmailAccountViewModelService.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Messages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class EmailAccountViewModelService : IEmailAccountViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/GiftVoucherViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/GiftVoucherViewModelService.cs
index 882270da5..9f33c1b07 100644
--- a/src/Web/Grand.Web.Admin/Services/GiftVoucherViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/GiftVoucherViewModelService.cs
@@ -8,12 +8,12 @@ using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Localization;
using Grand.Domain.Orders;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class GiftVoucherViewModelService : IGiftVoucherViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/KnowledgebaseViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/KnowledgebaseViewModelService.cs
index 714407609..89ed5967c 100644
--- a/src/Web/Grand.Web.Admin/Services/KnowledgebaseViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/KnowledgebaseViewModelService.cs
@@ -1,13 +1,13 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Seo;
using Grand.Domain.Knowledgebase;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Knowledgebase;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class KnowledgebaseViewModelService : IKnowledgebaseViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/LanguageViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/LanguageViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/LanguageViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/LanguageViewModelService.cs
index d33675bec..6f78e1c2f 100644
--- a/src/Web/Grand.Web.Admin/Services/LanguageViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/LanguageViewModelService.cs
@@ -1,12 +1,13 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Localization;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Localization;
+using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class LanguageViewModelService : ILanguageViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/MenuViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/MenuViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/MenuViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/MenuViewModelService.cs
index edbab21b4..b2202c089 100644
--- a/src/Web/Grand.Web.Admin/Services/MenuViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/MenuViewModelService.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.System.Admin;
using Grand.Domain.Admin;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Menu;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class MenuViewModelService : IMenuViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/MerchandiseReturnViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/MerchandiseReturnViewModelService.cs
index f69b77450..e73f88b2a 100644
--- a/src/Web/Grand.Web.Admin/Services/MerchandiseReturnViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/MerchandiseReturnViewModelService.cs
@@ -11,14 +11,14 @@ using Grand.Domain.Common;
using Grand.Domain.Directory;
using Grand.Domain.Localization;
using Grand.Domain.Orders;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class MerchandiseReturnViewModelService(
IOrderService orderService,
diff --git a/src/Web/Grand.Web.Admin/Services/NewsViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/NewsViewModelService.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Services/NewsViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/NewsViewModelService.cs
index 2f5a1e33e..a58b1d3df 100644
--- a/src/Web/Grand.Web.Admin/Services/NewsViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/NewsViewModelService.cs
@@ -6,13 +6,13 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.News;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.News;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class NewsViewModelService : INewsViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/OrderViewModelService.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/OrderViewModelService.cs
index af779b3bf..8fe41185b 100644
--- a/src/Web/Grand.Web.Admin/Services/OrderViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/OrderViewModelService.cs
@@ -25,16 +25,16 @@ using Grand.Domain.Payments;
using Grand.Domain.Shipping;
using Grand.Domain.Tax;
using Grand.Infrastructure;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Localization;
using MediatR;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Net;
using ProductExtensions = Grand.Domain.Catalog.ProductExtensions;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class OrderViewModelService : IOrderViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/PageViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/PageViewModelService.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Services/PageViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/PageViewModelService.cs
index a9389b90b..84cefb678 100644
--- a/src/Web/Grand.Web.Admin/Services/PageViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/PageViewModelService.cs
@@ -4,12 +4,12 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Seo;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Domain.Pages;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Pages;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class PageViewModelService : IPageViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/PictureViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/PictureViewModelService.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Services/PictureViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/PictureViewModelService.cs
index 2a45e1a6b..fbaadbacc 100644
--- a/src/Web/Grand.Web.Admin/Services/PictureViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/PictureViewModelService.cs
@@ -1,11 +1,11 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Extensions;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class PictureViewModelService : IPictureViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/ProductReviewViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ProductReviewViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/ProductReviewViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ProductReviewViewModelService.cs
index 66df6470a..2bf7ebb80 100644
--- a/src/Web/Grand.Web.Admin/Services/ProductReviewViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ProductReviewViewModelService.cs
@@ -7,14 +7,14 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Catalog;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
using MediatR;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ProductReviewViewModelService : IProductReviewViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ProductViewModelService.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ProductViewModelService.cs
index 0e995f31e..900dd132d 100644
--- a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ProductViewModelService.cs
@@ -23,17 +23,17 @@ using Grand.Domain.Seo;
using Grand.Domain.Tax;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Localization;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Net;
+using System.Text;
using ProductExtensions = Grand.Domain.Catalog.ProductExtensions;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ProductViewModelService(
IProductService productService,
@@ -140,21 +140,17 @@ public class ProductViewModelService(
(await currencyService.GetCurrencyById(currencySettings.PrimaryStoreCurrencyId))?.CurrencyCode;
}
- public virtual async Task PrepareTierPriceModel(ProductModel.TierPriceModel model)
+ public virtual async Task PrepareTierPriceModel(ProductModel.TierPriceModel model, string storeId = "")
{
- var storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
if (string.IsNullOrEmpty(storeId))
- model.AvailableStores.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ model.AvailableStores.Add(new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
foreach (var store in (await storeService.GetAllStores()).Where(x =>
x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
model.AvailableStores.Add(new SelectListItem { Text = store.Shortcut, Value = store.Id });
//customer groups
- model.AvailableCustomerGroups.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ model.AvailableCustomerGroups.Add(new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
foreach (var role in await groupService.GetAllCustomerGroups(showHidden: true))
model.AvailableCustomerGroups.Add(new SelectListItem { Text = role.Name, Value = role.Id });
@@ -374,11 +370,13 @@ public class ProductViewModelService(
//tax categories
var taxCategories = await taxCategoryService.GetAllTaxCategories();
model.AvailableTaxCategories.Add(new SelectListItem {
- Text = translationService.GetResource("Admin.Configuration.Tax.Settings.TaxCategories.None"), Value = ""
+ Text = translationService.GetResource("Admin.Configuration.Tax.Settings.TaxCategories.None"),
+ Value = ""
});
foreach (var tc in taxCategories)
model.AvailableTaxCategories.Add(new SelectListItem {
- Text = tc.Name, Value = tc.Id,
+ Text = tc.Name,
+ Value = tc.Id,
Selected = product != null && !setPredefinedValues && tc.Id == product.TaxCategoryId
});
@@ -386,12 +384,14 @@ public class ProductViewModelService(
var measureWeights = await measureService.GetAllMeasureWeights();
foreach (var mw in measureWeights)
model.AvailableBasepriceUnits.Add(new SelectListItem {
- Text = mw.Name, Value = mw.Id,
+ Text = mw.Name,
+ Value = mw.Id,
Selected = product != null && !setPredefinedValues && mw.Id == product.BasepriceUnitId
});
foreach (var mw in measureWeights)
model.AvailableBasepriceBaseUnits.Add(new SelectListItem {
- Text = mw.Name, Value = mw.Id,
+ Text = mw.Name,
+ Value = mw.Id,
Selected = product != null && !setPredefinedValues && mw.Id == product.BasepriceBaseUnitId
});
@@ -399,12 +399,10 @@ public class ProductViewModelService(
var units = await measureService.GetAllMeasureUnits();
model.AvailableUnits.Add(new SelectListItem { Text = "---", Value = "" });
foreach (var un in units)
- model.AvailableUnits.Add(new SelectListItem
- { Text = un.Name, Value = un.Id, Selected = product != null && un.Id == product.UnitId });
+ model.AvailableUnits.Add(new SelectListItem { Text = un.Name, Value = un.Id, Selected = product != null && un.Id == product.UnitId });
//discounts
- model.AvailableDiscounts = (await discountService
- .GetDiscountsQuery(DiscountType.AssignedToSkus, contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ model.AvailableDiscounts = (await discountService.GetDiscountsQuery(DiscountType.AssignedToSkus, model.StoreId))
.Select(d => d.ToModel(dateTimeService))
.ToList();
if (!excludeProperties && product != null) model.SelectedDiscountIds = product.AppliedDiscounts.ToArray();
@@ -522,21 +520,17 @@ public class ProductViewModelService(
}
}
- public virtual async Task<ProductListModel> PrepareProductListModel()
+ public virtual async Task<ProductListModel> PrepareProductListModel(string storeId = "")
{
var model = new ProductListModel();
- var storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//stores
- model.AvailableStores.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ model.AvailableStores.Add(new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
foreach (var s in (await storeService.GetAllStores()).Where(x =>
x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
//warehouses
- model.AvailableWarehouses.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ model.AvailableWarehouses.Add(new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
foreach (var wh in await warehouseService.GetAllWarehouses())
model.AvailableWarehouses.Add(new SelectListItem { Text = wh.Name, Value = wh.Id });
@@ -551,8 +545,7 @@ public class ProductViewModelService(
//2 - unpublished only
//3 - Show on homepage
//4 - mark as new
- model.AvailablePublishedOptions.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Catalog.Products.List.SearchPublished.All"), Value = " " });
+ model.AvailablePublishedOptions.Add(new SelectListItem { Text = translationService.GetResource("Admin.Catalog.Products.List.SearchPublished.All"), Value = " " });
model.AvailablePublishedOptions.Add(new SelectListItem {
Text = translationService.GetResource("Admin.Catalog.Products.List.SearchPublished.PublishedOnly"),
Value = "1"
@@ -566,7 +559,8 @@ public class ProductViewModelService(
Value = "3"
});
model.AvailablePublishedOptions.Add(new SelectListItem {
- Text = translationService.GetResource("Admin.Catalog.Products.List.SearchPublished.MarkAsNew"), Value = "4"
+ Text = translationService.GetResource("Admin.Catalog.Products.List.SearchPublished.MarkAsNew"),
+ Value = "4"
});
return model;
@@ -575,9 +569,6 @@ public class ProductViewModelService(
public virtual async Task<(IEnumerable<ProductModel> productModels, int totalCount)> PrepareProductsModel(
ProductListModel model, int pageIndex, int pageSize)
{
- //limit for store manager
- if (!string.IsNullOrEmpty(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- model.SearchStoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var categoryIds = new List<string>();
if (!string.IsNullOrEmpty(model.SearchCategoryId))
@@ -650,9 +641,6 @@ public class ProductViewModelService(
public virtual async Task<IList<Product>> PrepareProducts(ProductListModel model)
{
- //limit for store manager
- model.SearchStoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var categoryIds = new List<string>();
if (!string.IsNullOrEmpty(model.SearchCategoryId))
categoryIds.Add(model.SearchCategoryId);
@@ -693,53 +681,42 @@ public class ProductViewModelService(
public virtual async Task<Product> InsertProductModel(ProductModel model)
{
- //a staff should have access only to his products
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
//product
var product = model.ToEntity(dateTimeService);
-
+
//discounts
- var allDiscounts =
- await discountService.GetDiscountsQuery(DiscountType.AssignedToSkus,
- contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
- foreach (var discount in allDiscounts)
+ var allDiscounts = await discountService.GetDiscountsQuery(DiscountType.AssignedToSkus, model.StoreId);
+ foreach (Discount discount in allDiscounts)
if (model.SelectedDiscountIds != null && model.SelectedDiscountIds.Contains(discount.Id))
{
product.AppliedDiscounts.Add(discount.Id);
}
-
+
product.Locales = await seNameService.TranslationSeNameProperties(model.Locales, product, x => x.Name);
product.SeName = await seNameService.ValidateSeName(product, model.SeName, product.Name, true);
-
+
await productService.InsertProduct(product);
//search engine name
await seNameService.SaveSeName(product);
-
+
//tags
await SaveProductTags(product, ParseProductTags(model.ProductTags));
-
+
//warehouses
await SaveProductWarehouseInventory(product, model.ProductWarehouseInventoryModels);
-
-
-
+
+
+
await productService.UpdateProduct(product);
-
+
return product;
}
public virtual async Task<Product> UpdateProductModel(Product product, ProductModel model)
{
- //a staff should have access only to his products
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- model.Stores = [contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
-
var prevStockQuantity = stockQuantityService.GetTotalStockQuantity(product, total: true);
- var prevMultiWarehouseStock = product.ProductWarehouseInventory.Select(i => new ProductWarehouseInventory
- { WarehouseId = i.WarehouseId, StockQuantity = i.StockQuantity, ReservedQuantity = i.ReservedQuantity })
+ var prevMultiWarehouseStock = product.ProductWarehouseInventory.Select(i => new ProductWarehouseInventory { WarehouseId = i.WarehouseId, StockQuantity = i.StockQuantity, ReservedQuantity = i.ReservedQuantity })
.ToList();
var prevDownloadId = product.DownloadId;
@@ -751,9 +728,8 @@ public class ProductViewModelService(
product.Locales = await seNameService.TranslationSeNameProperties(model.Locales, product, x => x.Name);
product.SeName = await seNameService.ValidateSeName(product, model.SeName, product.Name, true);
//discounts
- var allDiscounts =
- await discountService.GetDiscountsQuery(DiscountType.AssignedToSkus,
- contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ var allDiscounts = await discountService.GetDiscountsQuery(DiscountType.AssignedToSkus, model.StoreId);
+
foreach (var discount in allDiscounts)
if (model.SelectedDiscountIds != null && model.SelectedDiscountIds.Contains(discount.Id))
{
@@ -771,7 +747,7 @@ public class ProductViewModelService(
product.AppliedDiscounts.Remove(discount.Id);
}
}
-
+
await productService.UpdateProduct(product);
//search engine name
@@ -831,27 +807,19 @@ public class ProductViewModelService(
products.AddRange(await productService.GetProductsByIds(selectedIds.ToArray(), true));
for (var i = 0; i < products.Count; i++)
{
- var product = products[i];
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- if (!(product.LimitedToStores && product.Stores.Contains(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
- product.Stores.Count == 1))
- continue;
- await DeleteProduct(product);
+ await DeleteProduct(products[i]);
}
}
- public virtual async Task<ProductModel.AddRequiredProductModel> PrepareAddRequiredProductModel()
+ public virtual async Task<ProductModel.AddRequiredProductModel> PrepareAddRequiredProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddRequiredProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddRequiredProductModel>(storeId);
return model;
}
public virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(
ProductModel.AddProductModel model, int pageIndex, int pageSize)
{
- //limit for store manager
- model.SearchStoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var products = await productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId,
model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId,
model.SearchProductName, pageIndex, pageSize);
@@ -1191,65 +1159,61 @@ public class ProductViewModelService(
await productService.UpdateAssociatedProduct(product);
}
- public virtual async Task<ProductModel.AddRelatedProductModel> PrepareRelatedProductModel()
+ public virtual async Task<ProductModel.AddRelatedProductModel> PrepareRelatedProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddRelatedProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddRelatedProductModel>(storeId);
return model;
}
- public virtual async Task<ProductModel.AddSimilarProductModel> PrepareSimilarProductModel()
+ public virtual async Task<ProductModel.AddSimilarProductModel> PrepareSimilarProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddSimilarProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddSimilarProductModel>(storeId);
return model;
}
- public virtual async Task<ProductModel.AddBundleProductModel> PrepareBundleProductModel()
+ public virtual async Task<ProductModel.AddBundleProductModel> PrepareBundleProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddBundleProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddBundleProductModel>(storeId);
return model;
}
- public virtual async Task<ProductModel.AddCrossSellProductModel> PrepareCrossSellProductModel()
+ public virtual async Task<ProductModel.AddCrossSellProductModel> PrepareCrossSellProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddCrossSellProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddCrossSellProductModel>(storeId);
return model;
}
- public virtual async Task<ProductModel.AddRecommendedProductModel> PrepareRecommendedProductModel()
+ public virtual async Task<ProductModel.AddRecommendedProductModel> PrepareRecommendedProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddRecommendedProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddRecommendedProductModel>(storeId);
return model;
}
- public virtual async Task<ProductModel.AddAssociatedProductModel> PrepareAssociatedProductModel()
+ public virtual async Task<ProductModel.AddAssociatedProductModel> PrepareAssociatedProductModel(string storeId = "")
{
- var model = await PrepareAddProductModel<ProductModel.AddAssociatedProductModel>();
+ var model = await PrepareAddProductModel<ProductModel.AddAssociatedProductModel>(storeId);
return model;
}
- public virtual async Task<BulkEditListModel> PrepareBulkEditListModel()
+ public virtual async Task<BulkEditListModel> PrepareBulkEditListModel(string storeId = "")
{
var model = new BulkEditListModel();
- string storeId;
-
//product types
model.AvailableProductTypes = enumTranslationService.ToSelectList(ProductType.SimpleProduct, false).ToList();
model.AvailableProductTypes.Insert(0,
new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = "0" });
// avaible stores
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
+ if (!string.IsNullOrEmpty(storeId))
{
- storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
var store = (await storeService.GetAllStores()).FirstOrDefault(x => x.Id == storeId);
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 = "" });
+ 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 });
@@ -1261,10 +1225,6 @@ public class ProductViewModelService(
public virtual async Task<(IEnumerable<BulkEditProductModel> bulkEditProductModels, int totalCount)>
PrepareBulkEditProductModel(BulkEditListModel model, int pageIndex, int pageSize)
{
- var storeId = model.SearchStoreId;
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var searchCategoryIds = new List<string>();
if (!string.IsNullOrEmpty(model.SearchCategoryId))
searchCategoryIds.Add(model.SearchCategoryId);
@@ -1272,7 +1232,7 @@ public class ProductViewModelService(
var products = (await productService.SearchProducts(categoryIds: searchCategoryIds,
brandId: model.SearchBrandId,
collectionId: model.SearchCollectionId,
- storeId: storeId,
+ storeId: model.SearchStoreId,
productType: model.SearchProductTypeId > 0 ? (ProductType?)model.SearchProductTypeId : null,
keywords: model.SearchProductName,
pageIndex: pageIndex - 1,
@@ -1304,11 +1264,6 @@ public class ProductViewModelService(
var product = await productService.GetProductById(pModel.Id, true);
if (product != null)
{
- //a staff can have access only to his products
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- if (!product.AccessToEntityByStore(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- continue;
-
var prevStockQuantity = stockQuantityService.GetTotalStockQuantity(product, total: true);
product.Sku = pModel.Sku;
@@ -1340,19 +1295,13 @@ public class ProductViewModelService(
var product = await productService.GetProductById(pModel.Id, true);
if (product != null)
{
- if (await groupService.IsStaff(contextAccessor.WorkContext.CurrentCustomer))
- if (!product.AccessToEntityByStore(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
- continue;
-
await productService.DeleteProduct(product);
}
}
}
- public virtual async Task<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product)
+ public virtual async Task<IList<ProductModel.TierPriceModel>> PrepareTierPriceModel(Product product, string storeId = "")
{
- var storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
var items = new List<ProductModel.TierPriceModel>();
foreach (var x in product.TierPrices
.Where(x => x.StoreId == storeId || string.IsNullOrWhiteSpace(storeId) ||
@@ -1555,8 +1504,7 @@ public class ProductViewModelService(
{
var name = predefinedValue.GetTranslation(x => x.Name, lang.Id, false);
if (!string.IsNullOrEmpty(name))
- pav.Locales.Add(new TranslationEntity
- { LanguageId = lang.Id, LocaleKey = "Name", LocaleValue = name });
+ pav.Locales.Add(new TranslationEntity { LanguageId = lang.Id, LocaleKey = "Name", LocaleValue = name });
}
productAttributeMapping.ProductAttributeValues.Add(pav);
@@ -1667,22 +1615,22 @@ public class ProductViewModelService(
case AttributeControlType.Checkboxes:
case AttributeControlType.ColorSquares:
case AttributeControlType.ImageSquares:
- {
- if (productAttributeMapping.ConditionAttribute.Any())
{
- //clear default selection
- foreach (var item in attributeModel.Values)
- item.IsPreSelected = false;
-
- //select new values
- var selectedValues =
- product.ParseProductAttributeValues(productAttributeMapping.ConditionAttribute);
- foreach (var attributeValue in selectedValues)
- foreach (var item in attributeModel.Values)
- if (attributeValue.Id == item.Id)
- item.IsPreSelected = true;
+ if (productAttributeMapping.ConditionAttribute.Any())
+ {
+ //clear default selection
+ foreach (var item in attributeModel.Values)
+ item.IsPreSelected = false;
+
+ //select new values
+ var selectedValues =
+ product.ParseProductAttributeValues(productAttributeMapping.ConditionAttribute);
+ foreach (var attributeValue in selectedValues)
+ foreach (var item in attributeModel.Values)
+ if (attributeValue.Id == item.Id)
+ item.IsPreSelected = true;
+ }
}
- }
break;
case AttributeControlType.ReadonlyCheckboxes:
case AttributeControlType.TextBox:
@@ -1717,41 +1665,41 @@ public class ProductViewModelService(
case AttributeControlType.RadioList:
case AttributeControlType.ColorSquares:
case AttributeControlType.ImageSquares:
- {
- var ctrlAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
- if (!string.IsNullOrEmpty(ctrlAttributes))
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, ctrlAttributes).ToList();
- else
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, "").ToList();
- }
+ {
+ var ctrlAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
+ if (!string.IsNullOrEmpty(ctrlAttributes))
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, ctrlAttributes).ToList();
+ else
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, "").ToList();
+ }
break;
case AttributeControlType.Checkboxes:
- {
- var cblAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
- if (!string.IsNullOrEmpty(cblAttributes))
{
- var anyValueSelected = false;
- foreach (var item in cblAttributes.Split([','],
- StringSplitOptions.RemoveEmptyEntries))
- if (!string.IsNullOrEmpty(item))
- {
+ var cblAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
+ if (!string.IsNullOrEmpty(cblAttributes))
+ {
+ var anyValueSelected = false;
+ foreach (var item in cblAttributes.Split([','],
+ StringSplitOptions.RemoveEmptyEntries))
+ if (!string.IsNullOrEmpty(item))
+ {
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, item).ToList();
+ anyValueSelected = true;
+ }
+
+ if (!anyValueSelected)
customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, item).ToList();
- anyValueSelected = true;
- }
-
- if (!anyValueSelected)
+ attribute, "").ToList();
+ }
+ else
+ {
customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
attribute, "").ToList();
+ }
}
- else
- {
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, "").ToList();
- }
- }
break;
case AttributeControlType.ReadonlyCheckboxes:
case AttributeControlType.TextBox:
@@ -1924,12 +1872,9 @@ public class ProductViewModelService(
model.ProductAttributeMappingId);
}
- public virtual async Task<ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel>
- PrepareAssociateProductToAttributeValueModel()
+ public virtual async Task<ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel> PrepareAssociateProductToAttributeValueModel(string storeId = "")
{
- var model =
- await PrepareAddProductModel<
- ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel>();
+ var model = await PrepareAddProductModel<ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel>(storeId);
return model;
}
@@ -2075,35 +2020,35 @@ public class ProductViewModelService(
case AttributeControlType.RadioList:
case AttributeControlType.ColorSquares:
case AttributeControlType.ImageSquares:
- {
- var ctrlAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
- if (!string.IsNullOrEmpty(ctrlAttributes))
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, ctrlAttributes).ToList();
- }
+ {
+ var ctrlAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
+ if (!string.IsNullOrEmpty(ctrlAttributes))
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, ctrlAttributes).ToList();
+ }
break;
case AttributeControlType.Checkboxes:
- {
- var cblAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
- if (!string.IsNullOrEmpty(cblAttributes))
- foreach (var item in cblAttributes.Split([','],
- StringSplitOptions.RemoveEmptyEntries))
- if (!string.IsNullOrEmpty(item))
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, item).ToList();
- }
+ {
+ var cblAttributes = model.SelectedAttributes.FirstOrDefault(x => x.Key == attribute.Id)?.Value;
+ if (!string.IsNullOrEmpty(cblAttributes))
+ foreach (var item in cblAttributes.Split([','],
+ StringSplitOptions.RemoveEmptyEntries))
+ if (!string.IsNullOrEmpty(item))
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, item).ToList();
+ }
break;
case AttributeControlType.ReadonlyCheckboxes:
- {
- //load read-only (already server-side selected) values
- var attributeValues = attribute.ProductAttributeValues;
- foreach (var selectedAttributeId in attributeValues
- .Where(v => v.IsPreSelected)
- .Select(v => v.Id)
- .ToList())
- customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
- attribute, selectedAttributeId).ToList();
- }
+ {
+ //load read-only (already server-side selected) values
+ var attributeValues = attribute.ProductAttributeValues;
+ foreach (var selectedAttributeId in attributeValues
+ .Where(v => v.IsPreSelected)
+ .Select(v => v.Id)
+ .ToList())
+ customAttributes = ProductExtensions.AddProductAttribute(customAttributes,
+ attribute, selectedAttributeId).ToList();
+ }
break;
}
@@ -2388,7 +2333,7 @@ public class ProductViewModelService(
if (product.ProductPictures.Any(x => x.PictureId == picture.Id))
return;
-
+
var productPicture = new ProductPicture {
PictureId = picture.Id,
DisplayOrder = displayOrder
@@ -2606,22 +2551,18 @@ public class ProductViewModelService(
}
}
- protected virtual async Task<T> PrepareAddProductModel<T>() where T : ProductModel.AddProductModel, new()
+ protected virtual async Task<T> PrepareAddProductModel<T>(string storeId = "") where T : ProductModel.AddProductModel, new()
{
var model = new T();
- var storeId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
-
//stores
- model.AvailableStores.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ model.AvailableStores.Add(new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
foreach (var s in (await storeService.GetAllStores()).Where(x =>
x.Id == storeId || string.IsNullOrWhiteSpace(storeId)))
model.AvailableStores.Add(new SelectListItem { Text = s.Shortcut, Value = s.Id });
//vendors
- model.AvailableVendors.Add(new SelectListItem
- { Text = translationService.GetResource("Admin.Common.All"), Value = " " });
+ 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 });
diff --git a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/ShipmentViewModelService.cs
similarity index 99%
rename from src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/ShipmentViewModelService.cs
index 0daf41d1f..88ecfc278 100644
--- a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/ShipmentViewModelService.cs
@@ -11,11 +11,11 @@ using Grand.Domain.Directory;
using Grand.Domain.Orders;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class ShipmentViewModelService : IShipmentViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/StoreViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/StoreViewModelService.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Services/StoreViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/StoreViewModelService.cs
index d002b63f6..f906fea07 100644
--- a/src/Web/Grand.Web.Admin/Services/StoreViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/StoreViewModelService.cs
@@ -4,12 +4,12 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Domain.Stores;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Stores;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class StoreViewModelService : IStoreViewModelService
{
diff --git a/src/Web/Grand.Web.Admin/Services/VendorViewModelService.cs b/src/Web/Grand.Web.AdminShared/Services/VendorViewModelService.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Services/VendorViewModelService.cs
rename to src/Web/Grand.Web.AdminShared/Services/VendorViewModelService.cs
index 37490c56a..9795a9425 100644
--- a/src/Web/Grand.Web.Admin/Services/VendorViewModelService.cs
+++ b/src/Web/Grand.Web.AdminShared/Services/VendorViewModelService.cs
@@ -10,15 +10,15 @@ using Grand.Domain.Directory;
using Grand.Domain.Discounts;
using Grand.Domain.Vendors;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Extensions.Mapping;
-using Grand.Web.Admin.Interfaces;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Vendors;
using MediatR;
using Microsoft.AspNetCore.Mvc.Rendering;
-namespace Grand.Web.Admin.Services;
+namespace Grand.Web.AdminShared.Services;
public class VendorViewModelService(
IDiscountService discountService,
diff --git a/src/Web/Grand.Web.AdminShared/Startup/StartupApplication.cs b/src/Web/Grand.Web.AdminShared/Startup/StartupApplication.cs
new file mode 100644
index 000000000..38ec7c761
--- /dev/null
+++ b/src/Web/Grand.Web.AdminShared/Startup/StartupApplication.cs
@@ -0,0 +1,69 @@
+using elFinder.Net.AspNetCore.Extensions;
+using elFinder.Net.Drivers.FileSystem.Extensions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Services;
+using Grand.Web.Common.View;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Grand.Web.AdminShared.Startup;
+
+public class StartupApplication : IStartupApplication
+{
+ public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
+ {
+ #region elFinder
+
+ services.AddElFinderAspNetCore().AddFileSystemDriver();
+
+ #endregion
+
+ services.AddScoped<IAddressAttributeViewModelService, AddressAttributeViewModelService>();
+ services.AddScoped<IAffiliateViewModelService, AffiliateViewModelService>();
+ services.AddScoped<IBlogViewModelService, BlogViewModelService>();
+ services.AddScoped<ICampaignViewModelService, CampaignViewModelService>();
+ services.AddScoped<ICategoryViewModelService, CategoryViewModelService>();
+ services.AddScoped<ICheckoutAttributeViewModelService, CheckoutAttributeViewModelService>();
+ services.AddScoped<IContactAttributeViewModelService, ContactAttributeViewModelService>();
+ services.AddScoped<IContactFormViewModelService, ContactFormViewModelService>();
+ services.AddScoped<ICountryViewModelService, CountryViewModelService>();
+ services.AddScoped<ICourseViewModelService, CourseViewModelService>();
+ services.AddScoped<ICurrencyViewModelService, CurrencyViewModelService>();
+ services.AddScoped<ICustomerAttributeViewModelService, CustomerAttributeViewModelService>();
+ services.AddScoped<ICustomerViewModelService, CustomerViewModelService>();
+ services.AddScoped<ICustomerReportViewModelService, CustomerReportViewModelService>();
+ services.AddScoped<ICustomerGroupViewModelService, CustomerGroupViewModelService>();
+ services.AddScoped<ICustomerTagViewModelService, CustomerTagViewModelService>();
+ services.AddScoped<IDiscountViewModelService, DiscountViewModelService>();
+ services.AddScoped<IDocumentViewModelService, DocumentViewModelService>();
+ services.AddScoped<IEmailAccountViewModelService, EmailAccountViewModelService>();
+ services.AddScoped<IGiftVoucherViewModelService, GiftVoucherViewModelService>();
+ services.AddScoped<IKnowledgebaseViewModelService, KnowledgebaseViewModelService>();
+ services.AddScoped<ILanguageViewModelService, LanguageViewModelService>();
+ services.AddScoped<ICollectionViewModelService, CollectionViewModelService>();
+ services.AddScoped<INewsViewModelService, NewsViewModelService>();
+ services.AddScoped<IOrderViewModelService, OrderViewModelService>();
+ services.AddScoped<IShipmentViewModelService, ShipmentViewModelService>();
+ services.AddScoped<IProductReviewViewModelService, ProductReviewViewModelService>();
+ services.AddScoped<IMerchandiseReturnViewModelService, MerchandiseReturnViewModelService>();
+ services.AddScoped<IVendorViewModelService, VendorViewModelService>();
+ services.AddScoped<IPageViewModelService, PageViewModelService>();
+ services.AddScoped<IStoreViewModelService, StoreViewModelService>();
+ services.AddScoped<IBrandViewModelService, BrandViewModelService>();
+ services.AddScoped<IProductViewModelService, ProductViewModelService>();
+ services.AddScoped<IPictureViewModelService, PictureViewModelService>();
+ services.AddScoped<IElFinderViewModelService, ElFinderViewModelService>();
+ services.AddScoped<IMenuViewModelService, MenuViewModelService>();
+
+ }
+
+ public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
+ {
+ }
+
+ public int Priority => 101;
+ public bool BeforeConfigure => false;
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateDeleteValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateDeleteValidator.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateDeleteValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateDeleteValidator.cs
index 42eeb50b2..29c283b29 100644
--- a/src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateDeleteValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateDeleteValidator.cs
@@ -4,10 +4,10 @@ using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Queries.Checkout.Orders;
using Grand.Business.Core.Queries.Customers;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Affiliates;
+using Grand.Web.AdminShared.Models.Affiliates;
using MediatR;
-namespace Grand.Web.Admin.Validators.Affiliate;
+namespace Grand.Web.AdminShared.Validators.Affiliate;
public class AffiliateDeleteValidator : BaseGrandValidator<AffiliateDeleteModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateValidator.cs
similarity index 83%
rename from src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateValidator.cs
index abddee22f..ff8a36224 100644
--- a/src/Web/Grand.Web.Admin/Validators/Affiliate/AffiliateValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Affiliate/AffiliateValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Affiliates;
+using Grand.Web.AdminShared.Models.Affiliates;
-namespace Grand.Web.Admin.Validators.Affiliate;
+namespace Grand.Web.AdminShared.Validators.Affiliate;
public class AffiliateValidator : BaseGrandValidator<AffiliateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Blogs/BlogCategoryValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogCategoryValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Blogs/BlogCategoryValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogCategoryValidator.cs
index fb57e94f3..4fa210767 100644
--- a/src/Web/Grand.Web.Admin/Validators/Blogs/BlogCategoryValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogCategoryValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
-namespace Grand.Web.Admin.Validators.Blogs;
+namespace Grand.Web.AdminShared.Validators.Blogs;
public class BlogCategoryValidator : BaseGrandValidator<BlogCategoryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Blogs/BlogPostValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogPostValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Blogs/BlogPostValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogPostValidator.cs
index 99824acaa..95e39909d 100644
--- a/src/Web/Grand.Web.Admin/Validators/Blogs/BlogPostValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Blogs/BlogPostValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Blogs;
+using Grand.Web.AdminShared.Models.Blogs;
-namespace Grand.Web.Admin.Validators.Blogs;
+namespace Grand.Web.AdminShared.Validators.Blogs;
public class BlogPostValidator : BaseGrandValidator<BlogPostModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddAssociatedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddAssociatedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddAssociatedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddAssociatedProductModelValidator.cs
index 75eaed0d4..c166e2814 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddAssociatedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddAssociatedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddAssociatedProductModelValidator : BaseStoreAccessValidator<ProductModel.AddAssociatedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddBundleProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddBundleProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddBundleProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddBundleProductModelValidator.cs
index b38560ad5..d2b870f8d 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddBundleProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddBundleProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddBundleProductModelValidator : BaseStoreAccessValidator<ProductModel.AddBundleProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCategoryProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCategoryProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddCategoryProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCategoryProductModelValidator.cs
index 4b32d8775..54857e60a 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCategoryProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCategoryProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddCategoryProductModelValidator : BaseStoreAccessValidator<CategoryModel.AddCategoryProductModel, Category>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCollectionProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCollectionProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddCollectionProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCollectionProductModelValidator.cs
index b8c21a574..049cdda4f 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCollectionProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCollectionProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddCollectionProductModelValidator : BaseStoreAccessValidator<CollectionModel.AddCollectionProductModel, Collection>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCrossSellProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCrossSellProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddCrossSellProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCrossSellProductModelValidator.cs
index cb27b00ff..2e0496b0a 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddCrossSellProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddCrossSellProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddCrossSellProductModelValidator : BaseStoreAccessValidator<ProductModel.AddCrossSellProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddProductPriceModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductPriceModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddProductPriceModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductPriceModelValidator.cs
index a4b31eeb1..1c27688bf 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddProductPriceModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductPriceModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddProductPriceModelValidator : BaseStoreAccessValidator<ProductModel.ProductPriceModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs
index 9055ac318..f4bf7497e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddProductSpecificationAttributeModelValidator.cs
@@ -4,9 +4,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddProductSpecificationAttributeModelValidator : BaseStoreAccessValidator<ProductModel.AddProductSpecificationAttributeModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddRecomendedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRecomendedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddRecomendedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRecomendedProductModelValidator.cs
index bd1f3e942..80359c23e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddRecomendedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRecomendedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddRecomendedProductModelValidator : BaseStoreAccessValidator<ProductModel.AddRecommendedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddRelatedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRelatedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddRelatedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRelatedProductModelValidator.cs
index 01c53103b..43e55d37a 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddRelatedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddRelatedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddRelatedProductModelValidator : BaseStoreAccessValidator<ProductModel.AddRelatedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AddSimilarProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddSimilarProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AddSimilarProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AddSimilarProductModelValidator.cs
index 77ba13457..8d67306eb 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AddSimilarProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AddSimilarProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AddSimilarProductModelValidator : BaseStoreAccessValidator<ProductModel.AddSimilarProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/AssociatedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AssociatedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/AssociatedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/AssociatedProductModelValidator.cs
index a859f35cb..9a5a3d8fb 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/AssociatedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/AssociatedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class AssociatedProductModelValidator : BaseStoreAccessValidator<ProductModel.AssociatedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/BaseStoreAccessValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BaseStoreAccessValidator.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/BaseStoreAccessValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/BaseStoreAccessValidator.cs
index 4235a98c7..81c615fe0 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/BaseStoreAccessValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BaseStoreAccessValidator.cs
@@ -4,9 +4,9 @@ using Grand.Infrastructure;
using FluentValidation;
using Grand.Domain;
using Grand.Domain.Stores;
-using Grand.Web.Admin.Extensions;
+using Grand.Web.AdminShared.Extensions;
-namespace Grand.Web.Admin.Validators.Catalog
+namespace Grand.Web.AdminShared.Validators.Catalog
{
public abstract class BaseStoreAccessValidator<TModel, TEntity> : BaseGrandValidator<TModel> where TEntity : BaseEntity, IStoreLinkEntity where TModel : class
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/BrandValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BrandValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/BrandValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/BrandValidator.cs
index b5c4e8ee4..0676ea9f9 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/BrandValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BrandValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class BrandValidator : BaseGrandValidator<BrandModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/BundleProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BundleProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/BundleProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/BundleProductModelValidator.cs
index 5b09bd9bd..865800fb9 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/BundleProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/BundleProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class BundleProductModelValidator : BaseStoreAccessValidator<ProductModel.BundleProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/CategoryProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/CategoryProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryProductModelValidator.cs
index 87b515222..4c11fb118 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/CategoryProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class CategoryProductModelValidator : BaseStoreAccessValidator<CategoryModel.CategoryProductModel, Category>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/CategoryValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/CategoryValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryValidator.cs
index 8ad3eb5b3..a940c27df 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/CategoryValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CategoryValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class CategoryValidator : BaseGrandValidator<CategoryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/CollectionProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/CollectionProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionProductModelValidator.cs
index 48e18385b..c900d147e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/CollectionProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class CollectionProductModelValidator : BaseStoreAccessValidator<CollectionModel.CollectionProductModel, Collection>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/CollectionValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/CollectionValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionValidator.cs
index d365d5c0f..f34d0fa22 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/CollectionValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CollectionValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class CollectionValidator : BaseGrandValidator<CollectionModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/CrossSellProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CrossSellProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/CrossSellProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/CrossSellProductModelValidator.cs
index ccd0526a9..a82ec5d00 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/CrossSellProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/CrossSellProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class CrossSellProductModelValidator : BaseStoreAccessValidator<ProductModel.CrossSellProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs
index 0b4f1b7cc..9143e532c 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/PredefinedProductAttributeValueModelValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class PredefinedProductAttributeValueModelValidator : BaseGrandValidator<PredefinedProductAttributeValueModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeMappingModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeMappingModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeMappingModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeMappingModelValidator.cs
index 0c7a440ae..3d4d352ca 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeMappingModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeMappingModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductAttributeMappingModelValidator : BaseStoreAccessValidator<ProductModel.ProductAttributeMappingModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValidator.cs
index 6afd8eda5..6c55cfac4 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductAttributeValidator : BaseGrandValidator<ProductAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValueModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValueModelValidator.cs
similarity index 96%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValueModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValueModelValidator.cs
index c5661441a..b2f1e10aa 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductAttributeValueModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductAttributeValueModelValidator.cs
@@ -4,9 +4,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductAttributeValueModelValidator : BaseStoreAccessValidator<ProductModel.ProductAttributeValueModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductCategoryModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCategoryModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductCategoryModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCategoryModelValidator.cs
index 718b73402..eafbc4420 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductCategoryModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCategoryModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductCategoryModelValidator : BaseStoreAccessValidator<ProductModel.ProductCategoryModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductCollectionModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCollectionModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductCollectionModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCollectionModelValidator.cs
index 5fe838c39..55d8494a8 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductCollectionModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductCollectionModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductCollectionModelValidator : BaseStoreAccessValidator<ProductModel.ProductCollectionModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductPictureModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductPictureModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductPictureModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductPictureModelValidator.cs
index c31775908..db88ddd6e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductPictureModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductPictureModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductPictureModelValidator : BaseStoreAccessValidator<ProductModel.ProductPictureModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductReviewValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductReviewValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductReviewValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductReviewValidator.cs
index b16360dac..952d892d1 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductReviewValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductReviewValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductReviewValidator : BaseGrandValidator<ProductReviewModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs
index a38eb3eed..688383744 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductSpecificationAttributeModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductSpecificationAttributeModelValidator : BaseStoreAccessValidator<ProductSpecificationAttributeModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductTagValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductTagValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductTagValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductTagValidator.cs
index 1bb881a8e..2cc763cd1 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductTagValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductTagValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductTagValidator : BaseGrandValidator<ProductTagModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/ProductValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductValidator.cs
index b9287b4b6..817287732 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/ProductValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/ProductValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class ProductValidator : BaseGrandValidator<ProductModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/RecomendedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/RecomendedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/RecomendedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/RecomendedProductModelValidator.cs
index 7fb87c2ba..f9390f068 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/RecomendedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/RecomendedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class RecomendedProductModelValidator : BaseStoreAccessValidator<ProductModel.RecommendedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/RelatedProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/RelatedProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/RelatedProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/RelatedProductModelValidator.cs
index 0f160bd41..19bad7cb9 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/RelatedProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/RelatedProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class RelatedProductModelValidator : BaseStoreAccessValidator<ProductModel.RelatedProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/SimilarProductModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SimilarProductModelValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/SimilarProductModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/SimilarProductModelValidator.cs
index 4af8124b5..176587bd2 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/SimilarProductModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SimilarProductModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class SimilarProductModelValidator : BaseStoreAccessValidator<ProductModel.SimilarProductModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeOptionValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeOptionValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeOptionValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeOptionValidator.cs
index 6b4595920..a4a671252 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeOptionValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeOptionValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class SpecificationAttributeOptionValidator : BaseGrandValidator<SpecificationAttributeOptionModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeValidator.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeValidator.cs
index 6e854b3cf..8e14b468d 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/SpecificationAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/SpecificationAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class SpecificationAttributeValidator : BaseGrandValidator<SpecificationAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Catalog/TierPriceModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Catalog/TierPriceModelValidator.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Validators/Catalog/TierPriceModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Catalog/TierPriceModelValidator.cs
index a7c38ad07..28603cbc3 100644
--- a/src/Web/Grand.Web.Admin/Validators/Catalog/TierPriceModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Catalog/TierPriceModelValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Catalog;
+using Grand.Web.AdminShared.Models.Catalog;
-namespace Grand.Web.Admin.Validators.Catalog;
+namespace Grand.Web.AdminShared.Validators.Catalog;
public class TierPriceModelValidator : BaseStoreAccessValidator<ProductModel.TierPriceModel, Product>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValidator.cs
index 97ab7f9b1..eec8ede20 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class AddressAttributeValidator : BaseGrandValidator<AddressAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValueValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValueValidator.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValueValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValueValidator.cs
index dca6c50f8..a77f05da0 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/AddressAttributeValueValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressAttributeValueValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class AddressAttributeValueValidator : BaseGrandValidator<AddressAttributeValueModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/AddressValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressValidator.cs
similarity index 97%
rename from src/Web/Grand.Web.Admin/Validators/Common/AddressValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/AddressValidator.cs
index 57b523f59..a22b11f2b 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/AddressValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/AddressValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class AddressValidator : BaseGrandValidator<AddressModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/CommonValid.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/CommonValid.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Common/CommonValid.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/CommonValid.cs
index 9c91f6d38..3036e49d6 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/CommonValid.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/CommonValid.cs
@@ -1,4 +1,4 @@
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public static class CommonValid
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/LoginValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/LoginValidator.cs
similarity index 69%
rename from src/Web/Grand.Web.Admin/Validators/Common/LoginValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/LoginValidator.cs
index 0a5ad8497..79456f741 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/LoginValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/LoginValidator.cs
@@ -4,15 +4,18 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
+using Grand.Web.AdminShared.Models.Common;
using Grand.Web.Common.Validators;
using MediatR;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class LoginValidator : BaseGrandValidator<LoginModel>
{
@@ -21,7 +24,7 @@ public class LoginValidator : BaseGrandValidator<LoginModel>
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
ICustomerService customerService, IGroupService groupService, IEncryptionService encryptionService,
ITranslationService translationService, CustomerSettings customerSettings, CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator)
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator)
: base(validators)
{
if (!customerSettings.UsernamesEnabled)
@@ -40,7 +43,7 @@ public class LoginValidator : BaseGrandValidator<LoginModel>
RuleFor(x => x.Password).NotEmpty()
.WithMessage(translationService.GetResource("Account.Login.Fields.Password.Required"));
- RuleFor(x => x).CustomAsync(async (x, context, _) =>
+ _ = RuleFor(x => x).CustomAsync(async (x, context, _) =>
{
var customer = customerSettings.UsernamesEnabled
? await customerService.GetCustomerByUsername(x.Username)
@@ -67,26 +70,26 @@ public class LoginValidator : BaseGrandValidator<LoginModel>
context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials.LockedOut"));
break;
case not null:
- {
- var pwd = customer.PasswordFormatId switch {
- PasswordFormat.Clear => x.Password,
- PasswordFormat.Encrypted =>
- encryptionService.EncryptText(x.Password, customer.PasswordSalt),
- PasswordFormat.Hashed => encryptionService.CreatePasswordHash(x.Password,
- customer.PasswordSalt,
- customerSettings.HashedPasswordFormat),
- _ => throw new Exception("PasswordFormat not supported")
- };
- var isValid = pwd == customer.Password;
- if (!isValid)
{
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials"));
- await contextAccessor.HttpContext!.RequestServices.GetRequiredService<IMediator>()
- .Publish(new CustomerLoginFailedEvent(customer), _);
- }
+ var pwd = customer.PasswordFormatId switch {
+ PasswordFormat.Clear => x.Password,
+ PasswordFormat.Encrypted =>
+ encryptionService.EncryptText(x.Password, customer.PasswordSalt),
+ PasswordFormat.Hashed => encryptionService.CreatePasswordHash(x.Password,
+ customer.PasswordSalt,
+ customerSettings.HashedPasswordFormat),
+ _ => throw new Exception("Password format not supported")
+ };
+ var isValid = pwd == customer.Password;
+ if (!isValid)
+ {
+ context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials"));
+ await contextAccessor.HttpContext!.RequestServices.GetRequiredService<IMediator>()
+ .Publish(new CustomerLoginFailedEvent(customer), _);
+ }
- break;
- }
+ break;
+ }
}
});
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/MenuValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/MenuValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Common/MenuValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/MenuValidator.cs
index 352539c31..b10070c3d 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/MenuValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/MenuValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Menu;
+using Grand.Web.AdminShared.Models.Menu;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class MenuValidator : BaseGrandValidator<MenuModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/ReviewValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/ReviewValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Common/ReviewValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/ReviewValidator.cs
index 3e8ea3586..518c87e5c 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/ReviewValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/ReviewValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class ReviewValidator : BaseGrandValidator<ReviewModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Common/UserFieldValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Common/UserFieldValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Common/UserFieldValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Common/UserFieldValidator.cs
index 64d2fd955..026935450 100644
--- a/src/Web/Grand.Web.Admin/Validators/Common/UserFieldValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Common/UserFieldValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Common;
+using Grand.Web.AdminShared.Models.Common;
-namespace Grand.Web.Admin.Validators.Common;
+namespace Grand.Web.AdminShared.Validators.Common;
public class UserFieldValidator : BaseGrandValidator<UserFieldModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Course/CourseLessonValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseLessonValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Course/CourseLessonValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Course/CourseLessonValidator.cs
index 5271dce10..6901e7508 100644
--- a/src/Web/Grand.Web.Admin/Validators/Course/CourseLessonValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseLessonValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Validators.Course;
+namespace Grand.Web.AdminShared.Validators.Course;
public class CourseLessonValidator : BaseGrandValidator<CourseLessonModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Course/CourseLevelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseLevelValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Course/CourseLevelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Course/CourseLevelValidator.cs
index 864472514..5f650d170 100644
--- a/src/Web/Grand.Web.Admin/Validators/Course/CourseLevelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseLevelValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Validators.Course;
+namespace Grand.Web.AdminShared.Validators.Course;
public class CourseLevelValidator : BaseGrandValidator<CourseLevelModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Course/CourseSubjectValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseSubjectValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Course/CourseSubjectValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Course/CourseSubjectValidator.cs
index ad977e4af..b87e6b854 100644
--- a/src/Web/Grand.Web.Admin/Validators/Course/CourseSubjectValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseSubjectValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Validators.Course;
+namespace Grand.Web.AdminShared.Validators.Course;
public class CourseSubjectValidator : BaseGrandValidator<CourseSubjectModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Course/CourseValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseValidator.cs
similarity index 94%
rename from src/Web/Grand.Web.Admin/Validators/Course/CourseValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Course/CourseValidator.cs
index 5c7604533..bd8b08497 100644
--- a/src/Web/Grand.Web.Admin/Validators/Course/CourseValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Course/CourseValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Courses;
+using Grand.Web.AdminShared.Models.Courses;
-namespace Grand.Web.Admin.Validators.Course;
+namespace Grand.Web.AdminShared.Validators.Course;
public class CourseValidator : BaseGrandValidator<CourseModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAddressValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAddressValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerAddressValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAddressValidator.cs
index 3e1a08cfe..5dec1550f 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAddressValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAddressValidator.cs
@@ -2,12 +2,12 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Common;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Validators.Common;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Validators.Common;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerAddressValidator : BaseGrandValidator<CustomerAddressModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValidator.cs
index 1f9fa3e27..e0dd81252 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerAttributeValidator : BaseGrandValidator<CustomerAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValueValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValueValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValueValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValueValidator.cs
index a2484db76..e6f06b222 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerAttributeValueValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerAttributeValueValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerAttributeValueValidator : BaseGrandValidator<CustomerAttributeValueModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupAclUpdateValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupAclUpdateValidator.cs
index 50f0c280a..ad2030434 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupAclUpdateValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerGroupAclUpdateValidator : BaseGrandValidator<CustomerGroupAclUpdateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupDeleteValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupDeleteValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupDeleteValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupDeleteValidator.cs
index 979384020..fab132df3 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupDeleteValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupDeleteValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerGroupDeleteValidator : BaseGrandValidator<CustomerGroupDeleteModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupValidator.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupValidator.cs
index 382c149c8..53e6de1d0 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerGroupValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerGroupValidator : BaseGrandValidator<CustomerGroupModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerTagValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerTagValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerTagValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerTagValidator.cs
index e1df27a15..15c42909f 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerTagValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerTagValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerTagValidator : BaseGrandValidator<CustomerTagModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerValidator.cs
similarity index 98%
rename from src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerValidator.cs
index 888795400..0559575ca 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/CustomerValidator.cs
@@ -6,10 +6,10 @@ using Grand.Domain.Customers;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
using System.Text.RegularExpressions;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class CustomerValidator : BaseGrandValidator<CustomerModel>
{
@@ -103,7 +103,7 @@ public class CustomerValidator : BaseGrandValidator<CustomerModel>
customerGroups.FirstOrDefault(cr => cr.SystemName == SystemCustomerGroupNames.Administrators) != null;
var isVendorGroup =
customerGroups.FirstOrDefault(cr => cr.SystemName == SystemCustomerGroupNames.Vendors) != null;
- var isStaffGroup = customerGroups.FirstOrDefault(cr => cr.SystemName == SystemCustomerGroupNames.Staff) !=
+ var isStaffGroup = customerGroups.FirstOrDefault(cr => cr.SystemName == SystemCustomerGroupNames.StoreManager) !=
null;
var isSalesGroup =
customerGroups.FirstOrDefault(cr => cr.SystemName == SystemCustomerGroupNames.SalesManager) != null;
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/SalesEmployeeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/SalesEmployeeValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Customers/SalesEmployeeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/SalesEmployeeValidator.cs
index 3824f4257..49c640137 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/SalesEmployeeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/SalesEmployeeValidator.cs
@@ -1,10 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
-using Grand.Web.Admin.Validators.Common;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Validators.Common;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class SalesEmployeeValidator : BaseGrandValidator<SalesEmployeeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/UserApiCreateValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiCreateValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Customers/UserApiCreateValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiCreateValidator.cs
index 39704b0ef..db1c6a4cf 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/UserApiCreateValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiCreateValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class UserApiCreateValidator : BaseGrandValidator<UserApiCreateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/UserApiValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiValidator.cs
similarity index 91%
rename from src/Web/Grand.Web.Admin/Validators/Customers/UserApiValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiValidator.cs
index 7896e8789..0bcf11a5f 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/UserApiValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Customers/UserApiValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Customers;
+using Grand.Web.AdminShared.Models.Customers;
-namespace Grand.Web.Admin.Validators.Customers;
+namespace Grand.Web.AdminShared.Validators.Customers;
public class UserApiValidator : BaseGrandValidator<UserApiModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/CountryValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/CountryValidator.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Validators/Directory/CountryValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/CountryValidator.cs
index e1f7e1c7a..51b60a6a5 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/CountryValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/CountryValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class CountryValidator : BaseGrandValidator<CountryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/CurrencyValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/CurrencyValidator.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Validators/Directory/CurrencyValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/CurrencyValidator.cs
index 80e08369a..2fb7dc60c 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/CurrencyValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/CurrencyValidator.cs
@@ -1,10 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
using System.Globalization;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class CurrencyValidator : BaseGrandValidator<CurrencyModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureDimensionValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureDimensionValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Directory/MeasureDimensionValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureDimensionValidator.cs
index 0e3d5e64e..a55a511cb 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureDimensionValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureDimensionValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class MeasureDimensionValidator : BaseGrandValidator<MeasureDimensionModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureUnitValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureUnitValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Directory/MeasureUnitValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureUnitValidator.cs
index 0f596d995..bb1828200 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureUnitValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureUnitValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class MeasureUnitValidator : BaseGrandValidator<MeasureUnitModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureWeightValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureWeightValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Directory/MeasureWeightValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureWeightValidator.cs
index 779b8f3f1..acd9d83cb 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/MeasureWeightValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/MeasureWeightValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class MeasureWeightValidator : BaseGrandValidator<MeasureWeightModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/RobotsTxtValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/RobotsTxtValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Directory/RobotsTxtValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/RobotsTxtValidator.cs
index 5d23e9959..aaf9d03f3 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/RobotsTxtValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/RobotsTxtValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class RobotsTxtValidator : BaseGrandValidator<RobotsTxtModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Directory/StateProvinceValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Directory/StateProvinceValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Directory/StateProvinceValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Directory/StateProvinceValidator.cs
index 9cfca1fbb..c667d392c 100644
--- a/src/Web/Grand.Web.Admin/Validators/Directory/StateProvinceValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Directory/StateProvinceValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Directory;
+using Grand.Web.AdminShared.Models.Directory;
-namespace Grand.Web.Admin.Validators.Directory;
+namespace Grand.Web.AdminShared.Validators.Directory;
public class StateProvinceValidator : BaseGrandValidator<StateProvinceModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Discounts/DiscountValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Discounts/DiscountValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Discounts/DiscountValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Discounts/DiscountValidator.cs
index 65d3c5470..6087ba7aa 100644
--- a/src/Web/Grand.Web.Admin/Validators/Discounts/DiscountValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Discounts/DiscountValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Discounts;
+using Grand.Web.AdminShared.Models.Discounts;
-namespace Grand.Web.Admin.Validators.Discounts;
+namespace Grand.Web.AdminShared.Validators.Discounts;
public class DiscountValidator : BaseGrandValidator<DiscountModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Documents/DocumentTypeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentTypeValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Documents/DocumentTypeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentTypeValidator.cs
index d9668383e..2b8d1f630 100644
--- a/src/Web/Grand.Web.Admin/Validators/Documents/DocumentTypeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentTypeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Validators.Documents;
+namespace Grand.Web.AdminShared.Validators.Documents;
public class DocumentTypeValidator : BaseGrandValidator<DocumentTypeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Documents/DocumentValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Documents/DocumentValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentValidator.cs
index 1257907a7..6d0fe0dba 100644
--- a/src/Web/Grand.Web.Admin/Validators/Documents/DocumentValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Documents/DocumentValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Documents;
+using Grand.Web.AdminShared.Models.Documents;
-namespace Grand.Web.Admin.Validators.Documents;
+namespace Grand.Web.AdminShared.Validators.Documents;
public class DocumentValidator : BaseGrandValidator<DocumentModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs
index 327caa6df..5202abb66 100644
--- a/src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseArticleModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Models.Knowledgebase;
-namespace Grand.Web.Admin.Validators.Knowledgebase;
+namespace Grand.Web.AdminShared.Validators.Knowledgebase;
public class KnowledgebaseArticleModelValidator : BaseGrandValidator<KnowledgebaseArticleModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs
index 525238ecc..192b157f4 100644
--- a/src/Web/Grand.Web.Admin/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Knowledgebase/KnowledgebaseCategoryModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Knowledgebase;
+using Grand.Web.AdminShared.Models.Knowledgebase;
-namespace Grand.Web.Admin.Validators.Knowledgebase;
+namespace Grand.Web.AdminShared.Validators.Knowledgebase;
public class KnowledgebaseCategoryModelValidator : BaseGrandValidator<KnowledgebaseCategoryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Layouts/BrandLayoutValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Layouts/BrandLayoutValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Layouts/BrandLayoutValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Layouts/BrandLayoutValidator.cs
index 6102df4c3..5e5cb06d8 100644
--- a/src/Web/Grand.Web.Admin/Validators/Layouts/BrandLayoutValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Layouts/BrandLayoutValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Validators.Layouts;
+namespace Grand.Web.AdminShared.Validators.Layouts;
public class BrandLayoutValidator : BaseGrandValidator<BrandLayoutModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Layouts/CategoryLayoutValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Layouts/CategoryLayoutValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Layouts/CategoryLayoutValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Layouts/CategoryLayoutValidator.cs
index d5342ef7b..0285d3118 100644
--- a/src/Web/Grand.Web.Admin/Validators/Layouts/CategoryLayoutValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Layouts/CategoryLayoutValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Validators.Layouts;
+namespace Grand.Web.AdminShared.Validators.Layouts;
public class CategoryLayoutValidator : BaseGrandValidator<CategoryLayoutModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Layouts/CollectionLayoutValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Layouts/CollectionLayoutValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Layouts/CollectionLayoutValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Layouts/CollectionLayoutValidator.cs
index d2ffe67db..6b3edb600 100644
--- a/src/Web/Grand.Web.Admin/Validators/Layouts/CollectionLayoutValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Layouts/CollectionLayoutValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Validators.Layouts;
+namespace Grand.Web.AdminShared.Validators.Layouts;
public class CollectionLayoutValidator : BaseGrandValidator<CollectionLayoutModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Layouts/PageLayoutValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Layouts/PageLayoutValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Layouts/PageLayoutValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Layouts/PageLayoutValidator.cs
index 332c913fb..9ad67f598 100644
--- a/src/Web/Grand.Web.Admin/Validators/Layouts/PageLayoutValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Layouts/PageLayoutValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Validators.Layouts;
+namespace Grand.Web.AdminShared.Validators.Layouts;
public class PageLayoutValidator : BaseGrandValidator<PageLayoutModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Layouts/ProductLayoutValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Layouts/ProductLayoutValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Layouts/ProductLayoutValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Layouts/ProductLayoutValidator.cs
index 656b91f94..7574dd35b 100644
--- a/src/Web/Grand.Web.Admin/Validators/Layouts/ProductLayoutValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Layouts/ProductLayoutValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Layouts;
+using Grand.Web.AdminShared.Models.Layouts;
-namespace Grand.Web.Admin.Validators.Layouts;
+namespace Grand.Web.AdminShared.Validators.Layouts;
public class ProductLayoutValidator : BaseGrandValidator<ProductLayoutModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Localization/LanguageResourceValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageResourceValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Localization/LanguageResourceValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageResourceValidator.cs
index 0d2b554db..f9fd13f67 100644
--- a/src/Web/Grand.Web.Admin/Validators/Localization/LanguageResourceValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageResourceValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
-namespace Grand.Web.Admin.Validators.Localization;
+namespace Grand.Web.AdminShared.Validators.Localization;
public class LanguageResourceValidator : BaseGrandValidator<LanguageResourceModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Localization/LanguageValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageValidator.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Validators/Localization/LanguageValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageValidator.cs
index e270e4902..bab532f81 100644
--- a/src/Web/Grand.Web.Admin/Validators/Localization/LanguageValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Localization/LanguageValidator.cs
@@ -1,10 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Localization;
+using Grand.Web.AdminShared.Models.Localization;
using System.Globalization;
-namespace Grand.Web.Admin.Validators.Localization;
+namespace Grand.Web.AdminShared.Validators.Localization;
public class LanguageValidator : BaseGrandValidator<LanguageModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/CampaignValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/CampaignValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Messages/CampaignValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/CampaignValidator.cs
index 7ecb3bf5f..fd9c00323 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/CampaignValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/CampaignValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class CampaignValidator : BaseGrandValidator<CampaignModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValidator.cs
index a40e97ec1..48a777f84 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class ContactAttributeValidator : BaseGrandValidator<ContactAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValueValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValueValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValueValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValueValidator.cs
index d0719600f..2f0e9d4f0 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/ContactAttributeValueValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactAttributeValueValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class ContactAttributeValueValidator : BaseGrandValidator<ContactAttributeValueModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/ContactFormDeleteValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactFormDeleteValidator.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Validators/Messages/ContactFormDeleteValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/ContactFormDeleteValidator.cs
index 23e594f3a..5a8b29cfb 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/ContactFormDeleteValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/ContactFormDeleteValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class ContactFormDeleteValidator : BaseGrandValidator<ContactFormDeleteModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/EmailAccountValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/EmailAccountValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Messages/EmailAccountValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/EmailAccountValidator.cs
index 0e10ae494..33520fb56 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/EmailAccountValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/EmailAccountValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class EmailAccountValidator : BaseGrandValidator<EmailAccountModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/MessageTemplateValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/MessageTemplateValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Messages/MessageTemplateValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/MessageTemplateValidator.cs
index f855e0cf3..ed05e40f8 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/MessageTemplateValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/MessageTemplateValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class MessageTemplateValidator : BaseGrandValidator<MessageTemplateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/NewsLetterSubscriptionValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/NewsLetterSubscriptionValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Messages/NewsLetterSubscriptionValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/NewsLetterSubscriptionValidator.cs
index d869c6014..d94d657e5 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/NewsLetterSubscriptionValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/NewsLetterSubscriptionValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class NewsLetterSubscriptionValidator : BaseGrandValidator<NewsLetterSubscriptionModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/NewsletterCategoryValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/NewsletterCategoryValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Messages/NewsletterCategoryValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/NewsletterCategoryValidator.cs
index 0306d506c..1eebda7ed 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/NewsletterCategoryValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/NewsletterCategoryValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class NewsletterCategoryValidator : BaseGrandValidator<NewsletterCategoryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Messages/QueuedEmailValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Messages/QueuedEmailValidator.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Validators/Messages/QueuedEmailValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Messages/QueuedEmailValidator.cs
index ad3f415af..1b50426c5 100644
--- a/src/Web/Grand.Web.Admin/Validators/Messages/QueuedEmailValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Messages/QueuedEmailValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Messages;
+using Grand.Web.AdminShared.Models.Messages;
-namespace Grand.Web.Admin.Validators.Messages;
+namespace Grand.Web.AdminShared.Validators.Messages;
public class QueuedEmailValidator : BaseGrandValidator<QueuedEmailModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/News/NewsItemValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/News/NewsItemValidator.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Validators/News/NewsItemValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/News/NewsItemValidator.cs
index a47e32865..1837b030c 100644
--- a/src/Web/Grand.Web.Admin/Validators/News/NewsItemValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/News/NewsItemValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.News;
+using Grand.Web.AdminShared.Models.News;
-namespace Grand.Web.Admin.Validators.News;
+namespace Grand.Web.AdminShared.Validators.News;
public class NewsItemValidator : BaseGrandValidator<NewsItemModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValidator.cs
index 69a2cb5d2..1810beb6b 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class CheckoutAttributeValidator : BaseGrandValidator<CheckoutAttributeModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValueValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValueValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValueValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValueValidator.cs
index 1dc2f1fa6..c7846ef6e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/CheckoutAttributeValueValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/CheckoutAttributeValueValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Checkout.CheckoutAttributes;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class CheckoutAttributeValueValidator : BaseGrandValidator<CheckoutAttributeValueModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherDeleteModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherDeleteModelValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherDeleteModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherDeleteModelValidator.cs
index 408d58096..a4d72d074 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherDeleteModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherDeleteModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Checkout.GiftVouchers;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class GiftVoucherDeleteModelValidator : BaseGrandValidator<GiftVoucherDeleteModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs
index 41dbe9118..d39932c7e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherNotifyRecipientValidator.cs
@@ -3,9 +3,9 @@ using Grand.Business.Core.Interfaces.Checkout.GiftVouchers;
using Grand.Domain.Catalog;
using Grand.Infrastructure.Validators;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class GiftVoucherNotifyRecipientValidator : BaseGrandValidator<GiftVoucherNotifyRecipient>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherValidator.cs
index b4f869333..57be27e93 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/GiftVoucherValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/GiftVoucherValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class GiftVoucherValidator : BaseGrandValidator<GiftVoucherModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/MerchandiseReturnValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/MerchandiseReturnValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Orders/MerchandiseReturnValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/MerchandiseReturnValidator.cs
index 5ac1f1327..6bbc27248 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/MerchandiseReturnValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/MerchandiseReturnValidator.cs
@@ -2,10 +2,10 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Domain.Orders;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class MerchandiseReturnValidator : BaseGrandValidator<MerchandiseReturnModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/OrderAddressModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderAddressModelValidator.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Validators/Orders/OrderAddressModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/OrderAddressModelValidator.cs
index bfcfb3c1f..7007d7345 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/OrderAddressModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderAddressModelValidator.cs
@@ -4,10 +4,10 @@ using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Common;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Extensions;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class OrderAddressModelValidator : BaseGrandValidator<OrderAddressModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/OrderDeleteModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderDeleteModelValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Orders/OrderDeleteModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/OrderDeleteModelValidator.cs
index b7934885b..ccd9776b5 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/OrderDeleteModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderDeleteModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class OrderDeleteModelValidator : BaseGrandValidator<OrderDeleteModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Orders/OrderStatusValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderStatusValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Orders/OrderStatusValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Orders/OrderStatusValidator.cs
index cdb4d5a67..8a4daa4dc 100644
--- a/src/Web/Grand.Web.Admin/Validators/Orders/OrderStatusValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Orders/OrderStatusValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Orders;
+using Grand.Web.AdminShared.Models.Orders;
-namespace Grand.Web.Admin.Validators.Orders;
+namespace Grand.Web.AdminShared.Validators.Orders;
public class OrderStatusValidator : BaseGrandValidator<OrderStatusModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Pages/PageValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Pages/PageValidator.cs
similarity index 89%
rename from src/Web/Grand.Web.Admin/Validators/Pages/PageValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Pages/PageValidator.cs
index 92cbd1d5f..aa66d4204 100644
--- a/src/Web/Grand.Web.Admin/Validators/Pages/PageValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Pages/PageValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Pages;
+using Grand.Web.AdminShared.Models.Pages;
-namespace Grand.Web.Admin.Validators.Pages;
+namespace Grand.Web.AdminShared.Validators.Pages;
public class PageValidator : BaseGrandValidator<PageModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Permission/PermissionCreateModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionCreateModelValidator.cs
similarity index 93%
rename from src/Web/Grand.Web.Admin/Validators/Permission/PermissionCreateModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionCreateModelValidator.cs
index f1d0c909e..e746ddc18 100644
--- a/src/Web/Grand.Web.Admin/Validators/Permission/PermissionCreateModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionCreateModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Permissions;
+using Grand.Web.AdminShared.Models.Permissions;
-namespace Grand.Web.Admin.Validators.Permission;
+namespace Grand.Web.AdminShared.Validators.Permission;
public class PermissionCreateModelValidator : BaseGrandValidator<PermissionCreateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Permission/PermissionUpdateModelValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionUpdateModelValidator.cs
similarity index 92%
rename from src/Web/Grand.Web.Admin/Validators/Permission/PermissionUpdateModelValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionUpdateModelValidator.cs
index 8b4a155db..1668eb036 100644
--- a/src/Web/Grand.Web.Admin/Validators/Permission/PermissionUpdateModelValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Permission/PermissionUpdateModelValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Permissions;
+using Grand.Web.AdminShared.Models.Permissions;
-namespace Grand.Web.Admin.Validators.Permission;
+namespace Grand.Web.AdminShared.Validators.Permission;
public class PermissionUpdateModelValidator : BaseGrandValidator<PermissionUpdateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Plugins/PluginValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Plugins/PluginValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Plugins/PluginValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Plugins/PluginValidator.cs
index 6689c8577..65fb7222e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Plugins/PluginValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Plugins/PluginValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Plugins;
+using Grand.Web.AdminShared.Models.Plugins;
-namespace Grand.Web.Admin.Validators.Plugins;
+namespace Grand.Web.AdminShared.Validators.Plugins;
public class PluginValidator : BaseGrandValidator<PluginModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Settings/LoyaltyPointsSettingsValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Settings/LoyaltyPointsSettingsValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Settings/LoyaltyPointsSettingsValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Settings/LoyaltyPointsSettingsValidator.cs
index 7d4764e56..2622690bf 100644
--- a/src/Web/Grand.Web.Admin/Validators/Settings/LoyaltyPointsSettingsValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Settings/LoyaltyPointsSettingsValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Orders;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Validators.Settings;
+namespace Grand.Web.AdminShared.Validators.Settings;
public class LoyaltyPointsSettingsValidator : BaseGrandValidator<SalesSettingsModel.LoyaltyPointsSettingsModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnActionValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnActionValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnActionValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnActionValidator.cs
index 4a5ed7091..b720b59d8 100644
--- a/src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnActionValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnActionValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Validators.Settings;
+namespace Grand.Web.AdminShared.Validators.Settings;
public class MerchandiseReturnActionValidator : BaseGrandValidator<MerchandiseReturnActionModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnReasonValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnReasonValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnReasonValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnReasonValidator.cs
index c3599f625..be133c548 100644
--- a/src/Web/Grand.Web.Admin/Validators/Settings/MerchandiseReturnReasonValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Settings/MerchandiseReturnReasonValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Validators.Settings;
+namespace Grand.Web.AdminShared.Validators.Settings;
public class MerchandiseReturnReasonValidator : BaseGrandValidator<MerchandiseReturnReasonModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Settings/OrderSettingsValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Settings/OrderSettingsValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Settings/OrderSettingsValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Settings/OrderSettingsValidator.cs
index 50d7f9564..ed1665897 100644
--- a/src/Web/Grand.Web.Admin/Validators/Settings/OrderSettingsValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Settings/OrderSettingsValidator.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Orders;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Validators.Settings;
+namespace Grand.Web.AdminShared.Validators.Settings;
public class OrderSettingsValidator : BaseGrandValidator<SalesSettingsModel.OrderSettingsModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Settings/SettingValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Settings/SettingValidator.cs
similarity index 84%
rename from src/Web/Grand.Web.Admin/Validators/Settings/SettingValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Settings/SettingValidator.cs
index 0b74287ce..97cd76ea1 100644
--- a/src/Web/Grand.Web.Admin/Validators/Settings/SettingValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Settings/SettingValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Settings;
+using Grand.Web.AdminShared.Models.Settings;
-namespace Grand.Web.Admin.Validators.Settings;
+namespace Grand.Web.AdminShared.Validators.Settings;
public class SettingValidator : BaseGrandValidator<SettingModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Shipping/DeliveryDateValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Shipping/DeliveryDateValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Shipping/DeliveryDateValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Shipping/DeliveryDateValidator.cs
index dee4dd457..4f901c97a 100644
--- a/src/Web/Grand.Web.Admin/Validators/Shipping/DeliveryDateValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Shipping/DeliveryDateValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Validators.Shipping;
+namespace Grand.Web.AdminShared.Validators.Shipping;
public class DeliveryDateValidator : BaseGrandValidator<DeliveryDateModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Shipping/PickupPointValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Shipping/PickupPointValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Shipping/PickupPointValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Shipping/PickupPointValidator.cs
index d06ef9a6d..3ae79410e 100644
--- a/src/Web/Grand.Web.Admin/Validators/Shipping/PickupPointValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Shipping/PickupPointValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Validators.Shipping;
+namespace Grand.Web.AdminShared.Validators.Shipping;
public class PickupPointValidator : BaseGrandValidator<PickupPointModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Shipping/ShippingMethodValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Shipping/ShippingMethodValidator.cs
similarity index 85%
rename from src/Web/Grand.Web.Admin/Validators/Shipping/ShippingMethodValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Shipping/ShippingMethodValidator.cs
index e7ba8ba4f..d93daa6ec 100644
--- a/src/Web/Grand.Web.Admin/Validators/Shipping/ShippingMethodValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Shipping/ShippingMethodValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Validators.Shipping;
+namespace Grand.Web.AdminShared.Validators.Shipping;
public class ShippingMethodValidator : BaseGrandValidator<ShippingMethodModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Shipping/WarehouseValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Shipping/WarehouseValidator.cs
similarity index 88%
rename from src/Web/Grand.Web.Admin/Validators/Shipping/WarehouseValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Shipping/WarehouseValidator.cs
index ae4230a80..60188be09 100644
--- a/src/Web/Grand.Web.Admin/Validators/Shipping/WarehouseValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Shipping/WarehouseValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Shipping;
+using Grand.Web.AdminShared.Models.Shipping;
-namespace Grand.Web.Admin.Validators.Shipping;
+namespace Grand.Web.AdminShared.Validators.Shipping;
public class WarehouseValidator : BaseGrandValidator<WarehouseModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Stores/DomainHostValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Stores/DomainHostValidator.cs
similarity index 90%
rename from src/Web/Grand.Web.Admin/Validators/Stores/DomainHostValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Stores/DomainHostValidator.cs
index 39ecb4eba..ba4bfe409 100644
--- a/src/Web/Grand.Web.Admin/Validators/Stores/DomainHostValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Stores/DomainHostValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Models.Stores;
-namespace Grand.Web.Admin.Validators.Stores;
+namespace Grand.Web.AdminShared.Validators.Stores;
public class DomainHostValidator : BaseGrandValidator<DomainHostModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Stores/StoreValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Stores/StoreValidator.cs
similarity index 95%
rename from src/Web/Grand.Web.Admin/Validators/Stores/StoreValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Stores/StoreValidator.cs
index 3e61b02ef..3d14a7e85 100644
--- a/src/Web/Grand.Web.Admin/Validators/Stores/StoreValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Stores/StoreValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Stores;
+using Grand.Web.AdminShared.Models.Stores;
-namespace Grand.Web.Admin.Validators.Stores;
+namespace Grand.Web.AdminShared.Validators.Stores;
public class StoreValidator : BaseGrandValidator<StoreModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Tasks/ScheduleTaskValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Tasks/ScheduleTaskValidator.cs
similarity index 81%
rename from src/Web/Grand.Web.Admin/Validators/Tasks/ScheduleTaskValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Tasks/ScheduleTaskValidator.cs
index 111d6ca07..cdc15b610 100644
--- a/src/Web/Grand.Web.Admin/Validators/Tasks/ScheduleTaskValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Tasks/ScheduleTaskValidator.cs
@@ -1,8 +1,8 @@
using FluentValidation;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Tasks;
+using Grand.Web.AdminShared.Models.Tasks;
-namespace Grand.Web.Admin.Validators.Tasks;
+namespace Grand.Web.AdminShared.Validators.Tasks;
public class ScheduleTaskValidator : BaseGrandValidator<ScheduleTaskModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Tax/TaxCategoryValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Tax/TaxCategoryValidator.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Validators/Tax/TaxCategoryValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Tax/TaxCategoryValidator.cs
index 0fb5a5077..fe2b9054b 100644
--- a/src/Web/Grand.Web.Admin/Validators/Tax/TaxCategoryValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Tax/TaxCategoryValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Tax;
+using Grand.Web.AdminShared.Models.Tax;
-namespace Grand.Web.Admin.Validators.Tax;
+namespace Grand.Web.AdminShared.Validators.Tax;
public class TaxCategoryValidator : BaseGrandValidator<TaxCategoryModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Vendors/VendorReviewValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorReviewValidator.cs
similarity index 87%
rename from src/Web/Grand.Web.Admin/Validators/Vendors/VendorReviewValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorReviewValidator.cs
index fd4621fbc..6ad36f9ea 100644
--- a/src/Web/Grand.Web.Admin/Validators/Vendors/VendorReviewValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorReviewValidator.cs
@@ -1,9 +1,9 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Vendors;
+using Grand.Web.AdminShared.Models.Vendors;
-namespace Grand.Web.Admin.Validators.Vendors;
+namespace Grand.Web.AdminShared.Validators.Vendors;
public class VendorReviewValidator : BaseGrandValidator<VendorReviewModel>
{
diff --git a/src/Web/Grand.Web.Admin/Validators/Vendors/VendorValidator.cs b/src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorValidator.cs
similarity index 86%
rename from src/Web/Grand.Web.Admin/Validators/Vendors/VendorValidator.cs
rename to src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorValidator.cs
index 7d80869f6..e81fbb050 100644
--- a/src/Web/Grand.Web.Admin/Validators/Vendors/VendorValidator.cs
+++ b/src/Web/Grand.Web.AdminShared/Validators/Vendors/VendorValidator.cs
@@ -1,10 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
-using Grand.Web.Admin.Models.Vendors;
-using Grand.Web.Admin.Validators.Common;
+using Grand.Web.AdminShared.Models.Vendors;
+using Grand.Web.AdminShared.Validators.Common;
-namespace Grand.Web.Admin.Validators.Vendors;
+namespace Grand.Web.AdminShared.Validators.Vendors;
public class VendorValidator : BaseGrandValidator<VendorModel>
{
diff --git a/src/Web/Grand.Web.Common/Controllers/BaseController.cs b/src/Web/Grand.Web.Common/Controllers/BaseController.cs
index 4661104eb..3a15c34f1 100644
--- a/src/Web/Grand.Web.Common/Controllers/BaseController.cs
+++ b/src/Web/Grand.Web.Common/Controllers/BaseController.cs
@@ -18,6 +18,38 @@ namespace Grand.Web.Common.Controllers;
[CustomerActivity]
public abstract class BaseController : Controller
{
+
+ /// <summary>
+ /// Save selected TAB index
+ /// </summary>
+ /// <param name="index">Idnex to save; null to automatically detect it</param>
+ /// <param name="persistForTheNextRequest">A value indicating whether a message should be persisted for the next request</param>
+ protected async Task SaveSelectedTabIndex(int? index = null, bool persistForTheNextRequest = true)
+ {
+ if (!index.HasValue)
+ {
+ var form = await HttpContext.Request.ReadFormAsync();
+ var tabindex = form["selected-tab-index"];
+ if (tabindex.Count > 0)
+ {
+ if (int.TryParse(tabindex[0], out var tmp)) index = tmp;
+ }
+ else
+ {
+ index = 1;
+ }
+ }
+
+ if (index.HasValue)
+ {
+ var dataKey = "Grand.selected-tab-index";
+ if (persistForTheNextRequest)
+ TempData[dataKey] = index;
+ else
+ ViewData[dataKey] = index;
+ }
+ }
+
#region Notifications
/// <summary>
diff --git a/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs b/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
index 368807c58..32e930b7b 100644
--- a/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
+++ b/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
@@ -35,6 +35,7 @@ public class AuthorizeAdminAttribute : TypeFilterAttribute
private class AuthorizeAdminFilter(bool ignoreFilter, IPermissionService permissionService,
SecuritySettings securitySettings, IContextAccessor contextAccessor, IGroupService groupService) : IAsyncAuthorizationFilter
{
+ const string routeName = "AdminLogin";
#region Methods
@@ -61,14 +62,21 @@ public class AuthorizeAdminAttribute : TypeFilterAttribute
//there is AdminAuthorizeFilter, so check access
if (filterContext.Filters.Any(filter => filter is AuthorizeAdminFilter))
{
+
+
//authorize permission of access to the admin area
if (!await permissionService.Authorize(StandardPermission.ManageAccessAdminPanel))
- filterContext.Result = new RedirectToRouteResult("AdminLogin", new RouteValueDictionary());
+ filterContext.Result = new RedirectToRouteResult(routeName, new RouteValueDictionary());
//whether current customer is vendor
if (await groupService.IsVendor(contextAccessor.WorkContext.CurrentCustomer) ||
contextAccessor.WorkContext.CurrentVendor is not null)
- filterContext.Result = new RedirectToRouteResult("AdminLogin", new RouteValueDictionary());
+ filterContext.Result = new RedirectToRouteResult(routeName, new RouteValueDictionary());
+
+ //whether current customer is store manager
+ if (await groupService.IsStoreManager(contextAccessor.WorkContext.CurrentCustomer) ||
+ !string.IsNullOrEmpty(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ filterContext.Result = new RedirectToRouteResult(routeName, new RouteValueDictionary());
//get allowed IP addresses
var ipAddresses = securitySettings.AdminAreaAllowedIpAddresses;
@@ -80,7 +88,7 @@ public class AuthorizeAdminAttribute : TypeFilterAttribute
//whether current IP is allowed
var currentIp = filterContext.HttpContext.Connection.RemoteIpAddress?.ToString();
if (!ipAddresses.Any(ip => ip.Equals(currentIp, StringComparison.OrdinalIgnoreCase)))
- filterContext.Result = new RedirectToRouteResult("AdminLogin", new RouteValueDictionary());
+ filterContext.Result = new RedirectToRouteResult(routeName, new RouteValueDictionary());
}
}
diff --git a/src/Web/Grand.Web.Common/Filters/AuthorizeStoreAttribute.cs b/src/Web/Grand.Web.Common/Filters/AuthorizeStoreAttribute.cs
new file mode 100644
index 000000000..0a1c98912
--- /dev/null
+++ b/src/Web/Grand.Web.Common/Filters/AuthorizeStoreAttribute.cs
@@ -0,0 +1,81 @@
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Data;
+using Grand.Infrastructure;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Filters;
+using Microsoft.AspNetCore.Routing;
+
+namespace Grand.Web.Common.Filters;
+
+/// <summary>
+/// Represents a filter attribute confirming that user with "Vendor" customer group has appropriate store manager account
+/// associated (and active)
+/// </summary>
+public class AuthorizeStoreAttribute : TypeFilterAttribute
+{
+ /// <summary>
+ /// Create instance of the filter attribute
+ /// </summary>
+ /// <param name="ignore">Whether to ignore the execution of filter actions</param>
+ public AuthorizeStoreAttribute(bool ignore = false) : base(typeof(AuthorizeStoreFilter))
+ {
+ IgnoreFilter = ignore;
+ Arguments = [ignore];
+ }
+
+ public bool IgnoreFilter { get; }
+
+ #region Filter
+
+ /// <summary>
+ /// Represents a filter confirming that user with "Store" customer group has appropriate store account associated
+ /// (and active)
+ /// </summary>
+ private class AuthorizeStoreFilter(bool ignoreFilter, IContextAccessor contextAccessor, IGroupService groupService,
+ IPermissionService permissionService) : IAsyncAuthorizationFilter
+ {
+ #region Methods
+
+ /// <summary>
+ /// Called early in the filter pipeline to confirm request is authorized
+ /// </summary>
+ /// <param name="context">Authorization filter context</param>
+ public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
+ {
+ //ignore filter actions
+ ArgumentNullException.ThrowIfNull(context);
+
+ //check whether this filter has been overridden for the Action
+ var actionFilter = context.ActionDescriptor.FilterDescriptors
+ .Where(f => f.Scope == FilterScope.Action)
+ .Select(f => f.Filter).OfType<AuthorizeVendorAttribute>().FirstOrDefault();
+
+ //ignore filter (the action is available even if the current customer isn't a vendor)
+ if (actionFilter?.IgnoreFilter ?? ignoreFilter)
+ return;
+
+ if (!DataSettingsManager.DatabaseIsInstalled())
+ return;
+
+ //authorize permission of access to the vendor area
+ if (!await permissionService.Authorize(StandardPermission.ManageAccessStoreManagerPanel))
+ {
+ context.Result = new RedirectToRouteResult("StoreLogin", new RouteValueDictionary());
+ return;
+ }
+ //ensure that this user has store manager
+ if (!await groupService.IsStoreManager(contextAccessor.WorkContext.CurrentCustomer) || string.IsNullOrEmpty(contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ {
+ context.Result = new RedirectToRouteResult("StoreLogin", new RouteValueDictionary());
+ }
+ return;
+ //add active store
+ }
+
+ #endregion
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettingsExtension.cs b/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettingsExtension.cs
index afd110c76..a7b54ecb7 100644
--- a/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettingsExtension.cs
+++ b/src/Web/Grand.Web.Common/Security/Captcha/CaptchaSettingsExtension.cs
@@ -1,4 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
namespace Grand.Web.Common.Security.Captcha;
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaValidator.cs b/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaValidator.cs
index c8e1cf576..9114e149f 100644
--- a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaValidator.cs
+++ b/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaValidator.cs
@@ -1,10 +1,12 @@
-using Grand.Infrastructure.Extensions;
+using Grand.Domain.Common;
+using Grand.Infrastructure.Extensions;
+using Grand.SharedKernel.Captcha;
using Microsoft.AspNetCore.Http;
using System.Text.Json;
namespace Grand.Web.Common.Security.Captcha;
-public class GoogleReCaptchaValidator
+public class GoogleReCaptchaValidator : IGoogleReCaptchaValidator
{
private const string RecaptchaVerifyUrl =
"https://www.google.com/recaptcha/api/siteverify?secret={0}&response={1}&remoteip={2}";
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaVersion.cs b/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaVersion.cs
deleted file mode 100644
index eb45025f5..000000000
--- a/src/Web/Grand.Web.Common/Security/Captcha/GoogleReCaptchaVersion.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace Grand.Web.Common.Security.Captcha;
-
-/// <summary>
-/// Represents a reCAPTCHA version
-/// </summary>
-public enum GoogleReCaptchaVersion
-{
- /// <summary>
- /// Version 2.0
- /// </summary>
- V2 = 2,
-
- /// <summary>
- /// Version 3.0
- /// </summary>
- V3 = 3
-}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Common/Security/Captcha/GoogleRecaptchaControl.cs b/src/Web/Grand.Web.Common/Security/Captcha/GoogleRecaptchaControl.cs
index 7d9903723..d564b0df7 100644
--- a/src/Web/Grand.Web.Common/Security/Captcha/GoogleRecaptchaControl.cs
+++ b/src/Web/Grand.Web.Common/Security/Captcha/GoogleRecaptchaControl.cs
@@ -1,4 +1,5 @@
-using Grand.Web.Common.Extensions;
+using Grand.Domain.Common;
+using Grand.Web.Common.Extensions;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Grand.Web.Common.Security.Captcha;
diff --git a/src/Web/Grand.Web.Common/Startup/StartupApplication.cs b/src/Web/Grand.Web.Common/Startup/StartupApplication.cs
index 349534514..943280079 100644
--- a/src/Web/Grand.Web.Common/Startup/StartupApplication.cs
+++ b/src/Web/Grand.Web.Common/Startup/StartupApplication.cs
@@ -7,6 +7,7 @@ using Grand.Infrastructure.Caching.Message;
using Grand.Infrastructure.Caching.Redis;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Validators;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Helpers;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Menu;
@@ -124,7 +125,7 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddSingleton<IPoweredByMiddlewareOptions, PoweredByMiddlewareOptions>();
//request reCAPTCHA service
- serviceCollection.AddHttpClient<GoogleReCaptchaValidator>();
+ serviceCollection.AddHttpClient<IGoogleReCaptchaValidator, GoogleReCaptchaValidator>();
serviceCollection.AddScoped<IViewRenderService, ViewRenderService>();
}
diff --git a/src/Web/Grand.Web.Common/TagHelpers/GenerateCaptchaTagHelper.cs b/src/Web/Grand.Web.Common/TagHelpers/GenerateCaptchaTagHelper.cs
index 9e5b187ab..c72a1e897 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/GenerateCaptchaTagHelper.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/GenerateCaptchaTagHelper.cs
@@ -1,4 +1,5 @@
-using Grand.Web.Common.Security.Captcha;
+using Grand.Domain.Common;
+using Grand.Web.Common.Security.Captcha;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
diff --git a/src/Web/Grand.Web.Common/Validators/CaptchaValidator.cs b/src/Web/Grand.Web.Common/Validators/CaptchaValidator.cs
index c69020eec..d5ac13e2c 100644
--- a/src/Web/Grand.Web.Common/Validators/CaptchaValidator.cs
+++ b/src/Web/Grand.Web.Common/Validators/CaptchaValidator.cs
@@ -1,7 +1,7 @@
using FluentValidation;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
@@ -10,10 +10,10 @@ namespace Grand.Web.Common.Validators;
public class CaptchaValidator : BaseGrandValidator<ICaptchaValidModel>
{
private readonly IHttpContextAccessor _contextAccessor;
- private readonly GoogleReCaptchaValidator _googleReCaptchaValidator;
+ private readonly IGoogleReCaptchaValidator _googleReCaptchaValidator;
public CaptchaValidator(IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validators,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator
) : base(validators)
{
_contextAccessor = contextAccessor;
diff --git a/src/Web/Grand.Web.Common/WorkContextSetter.cs b/src/Web/Grand.Web.Common/WorkContextSetter.cs
index 8c57fefea..805ace465 100644
--- a/src/Web/Grand.Web.Common/WorkContextSetter.cs
+++ b/src/Web/Grand.Web.Common/WorkContextSetter.cs
@@ -153,6 +153,7 @@ public class WorkContextSetter : IWorkContextSetter
if (workContext.CurrentCustomer != null)
{
workContext.CurrentVendor = await CurrentVendor(workContext.CurrentCustomer);
+ workContext.StoreManager = await GetStoreManager(workContext.CurrentCustomer);
workContext.OriginalCustomerIfImpersonated = _originalCustomerIfImpersonated;
workContext.WorkingLanguage = await WorkingLanguage(workContext.CurrentCustomer, currentStore);
workContext.WorkingCurrency = await WorkingCurrency(workContext.CurrentCustomer, workContext.WorkingLanguage, currentStore);
@@ -316,6 +317,28 @@ public class WorkContextSetter : IWorkContextSetter
return vendor;
}
+ /// <summary>
+ /// Get the store (store manager)
+ /// </summary>
+ /// <param name="customer"></param>
+ /// <returns></returns>
+ protected async Task<Store> GetStoreManager(Customer customer)
+ {
+ if (customer == null)
+ return await Task.FromResult<Store>(null);
+
+ if (string.IsNullOrEmpty(customer.StoreId))
+ return await Task.FromResult<Store>(null);
+
+ //try to get store
+ var store = await _storeService.GetStoreById(customer.StoreId);
+ //check store availability
+ if (store == null) // || store.Deleted || !store.Published)
+ return await Task.FromResult<Store>(null);
+
+ return store;
+ }
+
/// <summary>
/// Set current user working language by Middleware
/// </summary>
@@ -432,6 +455,8 @@ public class WorkContextSetter : IWorkContextSetter
public Currency WorkingCurrency { get; set; }
+ public Store StoreManager { get; set; }
+
public TaxDisplayType TaxDisplayType { get; set; }
}
diff --git a/src/Web/Grand.Web.Store/App_Data/appsettings.json b/src/Web/Grand.Web.Store/App_Data/appsettings.json
new file mode 100644
index 000000000..267f7ee1b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/App_Data/appsettings.json
@@ -0,0 +1,181 @@
+{
+ "Application": {
+ //Enable if you want to see the full error in production environment. It's ignored (always enabled) in development environment
+ "DisplayFullErrorStack": true,
+ //Value of "Cache-Control" header value for static content
+ "StaticFilesCacheControl": "public,max-age=31536000",
+ //Enable the session-based TempData provider
+ "UseSessionStateTempDataProvider": false,
+ //A value indicating whether SEO friendly URLs with multiple languages are enabled
+ "SeoFriendlyUrlsForLanguagesEnabled": false,
+ "SeoFriendlyUrlsDefaultCode": "en",
+ //Note: While use of custom response header encoding may be needed in some cases,
+ //we discourage the use of non-ASCII encodings to avoid compatibility issues
+ //with other HTTP clients.
+ "AllowNonAsciiCharInHeaders": false,
+ //Gets or sets the maximum allowed size of any request body in bytes
+ //the default value is 30MB
+ "MaxRequestBodySize": null,
+ //max 2147483648
+
+ //Gets or sets the value to enable a middleware for logging additional information about CurrentCustomer and CurrentStore
+ "EnableContextLoggingMiddleware": true
+ },
+ //only for advanced users, allow to set ConnectionString for MongoDb
+ "ConnectionStrings": {
+ "Mongodb": ""
+ },
+ "Database": {
+ //This setting is required to use LiteDB database
+ "UseLiteDb": false,
+ //LiteDB database as a singleton service in the application
+ "Singleton": true,
+ //Init connection string - it's required only for the installation process!
+ "LiteDbConnectionString": "Filename=App_Data/database.db"
+ },
+ "Security": {
+ //Use a reverse proxy server - more information you can find at: https://docs.microsoft.com/en-US/aspnet/core/host-and-deploy/linux-nginx
+ "UseForwardedHeaders": false,
+ //In some cases, it might not be possible to add forwarded headers to the requests proxied to the app.
+ "ForceUseHTTPS": false,
+ //AllowedHosts, is used for host filtering to bind your app to specific hostnames
+ "AllowedHosts": "*",
+ //This settings adds the following headers to all responses that pass
+ //X-Content-Type-Options: nosniff
+ //Strict-Transport-Security: max-age=31536000; includeSubDomains
+ //X-Frame-Options: Deny
+ //X-XSS-Protection: 1; mode=block
+ //Referrer-Policy: strict-origin-when-cross-origin
+ //Content-Security-Policy: object-src 'none'; form-action 'self'; frame-ancestors 'none'
+ "UseDefaultSecurityHeaders": false,
+ //HTTP Strict Transport Security Protocol
+ "UseHsts": false,
+ //When enabled, allow Razor files to be updated if they're edited.
+ "EnableRuntimeCompilation": false,
+ //We recommend all ASP.NET Core web apps call HTTPS Redirection Middleware to redirect all HTTP requests to HTTPS
+ "UseHttpsRedirection": false,
+ "HttpsRedirectionRedirect": 308,
+ "HttpsRedirectionHttpsPort": 443,
+ //Key persistence location you can point to a directory on the local machine, or it can point to a folder on a network share.
+ //if is null it will use the default directory path - ApplicationPath\App_Data\DataProtectionKeys
+ "KeyPersistenceLocation": "/App_Data/DataProtectionKeys",
+ //Gets or sets a value indicating for cookie auth expires in hours - default 24 * 365 = 8760
+ "CookieAuthExpires": 8760,
+ //Gets or sets a value for cookie prefix - any changes will log out all of the customers
+ "CookiePrefix": ".Grand.",
+ //Gets or sets a value for cookie claim issuer - any changes will log out all of the customers
+ "CookieClaimsIssuer": "grandnode",
+ //CookieSecurePolicy.Always always sets the Secure flag
+ //Always setting the Secure flag is the most restrictive and most secure option.
+ //This is the one you should be targeting if your production environment fully runs on HTTPS
+ "CookieSecurePolicyAlways": false,
+ //Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site request forgery attacks
+ //Available values Unspecified, None, Lax, Strict
+ "CookieSameSite": "Lax",
+ "CookieSameSiteExternalAuth": "None",
+ //Enabling this setting allows for verification of access to a specific controller and action in the admin panel using menu configuration.
+ "AuthorizeAdminMenu": false
+ },
+ "Cache": {
+ //Gets or sets a value indicating for default cache time in minutes"
+ "DefaultCacheTimeMinutes": 60
+ },
+ "Extensions": {
+ //For developers - more info you can find at https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/
+ //https://github.com/dotnet/roslyn/wiki/Roslyn-Overview
+ "UseRoslynScripts": false,
+ //Disable upload extensions plugins
+ "DisableUploadExtensions": false,
+ //A list of plugins to be ignored during start application - pattern
+ "PluginSkipLoadingPattern": "",
+ //Enable if you want to clear /Plugins/bin directory on application startup
+ "ClearPluginShadowDirectoryOnStartup": true,
+ //For develop you should enable if you want to copy plugin dll files to directory /Plugins/bin on application startup
+ "PluginShadowCopy": true,
+ //separator comma
+ "InstalledPlugins": ""
+ },
+ "AccessControl": {
+ /// A value indicating whether to ignore ACL rules
+ "IgnoreAcl": false,
+ //A value indicating whether to ignore "limit per store" rules
+ "IgnoreStoreLimitations": false
+ },
+ "Performance": {
+ //Indicates whether to compress response (gzip by default)
+ //You may want to disable it, for example, If you have an active IIS Dynamic Compression Module configured at the server level
+ "UseResponseCompression": false,
+ //Indicates whether to ignore UsePoweredByMiddleware
+ "IgnoreUsePoweredByMiddleware": false
+ },
+ "FeatureManagement": {
+ "Grand.Module.ScheduledTasks": true
+ },
+ "Redis": {
+ ///Enable the Publish/Subscribe messaging with redis to manage memory cache on every server
+ "RedisPubSubEnabled": false,
+ "RedisPubSubConnectionString": "127.0.0.1:6379,allowAdmin=true",
+ "RedisPubSubChannel": "channel",
+ "PersistKeysToRedis": false,
+ "PersistKeysToRedisUrl": "127.0.0.1:6379,allowAdmin=true,defaultDatabase=1"
+ },
+ "UrlRewrite": {
+ //Load url rewrite rules from external file AppData/UrlRewrite.xml
+ "UseUrlRewrite": false,
+ "UrlRewriteHttpsOptions": false,
+ "UrlRewriteHttpsOptionsStatusCode": 303,
+ "UrlRewriteHttpsOptionsPort": 443,
+ "UrlRedirectToHttpsPermanent": false
+ },
+ "Azure": {
+ //Azure BLOB storage.
+ //Specify your connection string, container name, end point for BLOB storage here
+ "AzureBlobStorageConnectionString": "",
+ "AzureBlobStorageContainerName": "",
+ "AzureBlobStorageEndPoint": "",
+ //DataProtection - Azure Key Vault - you can use only one of method PersistKeysToAzureKeyVault or PersistKeysToAzureBlobStorage
+ "PersistKeysAzureBlobStorageConnectionString": "",
+ //required
+ "PersistKeysToAzureKeyVault": false,
+ "PersistKeysToAzureBlobStorage": false,
+ "DataProtectionContainerName": "",
+ //required
+ "DataProtectionBlobName": "keys.xml",
+ //required
+ "KeyIdentifier": "",
+ //required when use PersistKeysToAzureKeyVault
+
+ //Azure App Configuration
+ "AppConfiguration": "",
+ "AppKeyPrefix": ""
+ },
+ "Amazon": {
+ //Amazon Blob storage
+ //<!--Available Region System Names can be found here http://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region -->
+ "AmazonAwsAccessKeyId": "",
+ "AmazonAwsSecretAccessKey": "",
+ "AmazonBucketName": "",
+ "AmazonRegion": "",
+ "AmazonDistributionDomainName": ""
+ //Domain name for cloudfront distribution
+ },
+ "FacebookSettings": {
+ //Facebook-assigned App ID
+ "AppId": "",
+ //Facebook-assigned app secret
+ "AppSecret": ""
+ },
+ "GoogleSettings": {
+ "ClientId": "",
+ "ClientSecret": ""
+ },
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "System": "Information"
+ }
+ },
+ "ApplicationInsights": {
+ "ConnectionString": ""
+ }
+}
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Create.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Create.cshtml
new file mode 100644
index 000000000..c6a198e86
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Create.cshtml
@@ -0,0 +1,37 @@
+@model BrandModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Brands.AddNew"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Brand" asp-action="Create" method="post" id="brand-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Brands.AddNew"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Brands.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <vc:admin-widget widget-zone="brand_details_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Edit.cshtml
new file mode 100644
index 000000000..2470512b3
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Edit.cshtml
@@ -0,0 +1,45 @@
+@model BrandModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Brands.EditBrandDetails"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Brand" asp-action="Edit" method="post" id="brand-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Brands.EditBrandDetails"] - @Model.Name
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Brands.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="button" onclick="window.open('@Url.RouteUrl("Brand", new { Model.SeName })','_blank');" class="btn purple">
+ <i class="fa fa-eye"></i>
+ @Loc["Admin.Common.Preview"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <span id="brand-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="brand_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="brand-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/List.cshtml
new file mode 100644
index 000000000..acb00072f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/List.cshtml
@@ -0,0 +1,151 @@
+@model BrandListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ ViewBag.Title = Loc["Admin.Catalog.Brands"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Brands"]
+ </div>
+ <div class="actions btn-group btn-group-devided util-btn-margin-bottom-5">
+ <a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green">
+ <i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span>
+ </a>
+ <vc:admin-widget widget-zone="brand_list_buttons" additional-data="null"/>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="row align-items-end">
+ <div class="col-md-6 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchBrandName" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/>
+ <admin-input asp-for="SearchBrandName"/>
+ </div>
+ </div>
+ <div class="col-md-3 col-sm-12 col-12 mt-md-0 mt-3">
+ <div class="form-actions">
+ <button class="btn btn-success filter-submit" id="search-brands">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="brands-grid"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#brands-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("List", "Brand", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Brands.Fields.Name"]",
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ },
+ {
+ field: "ShowOnHomePage",
+ title: "@Loc["Admin.Catalog.Brands.Fields.ShowOnHomePage"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(ShowOnHomePage) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "IncludeInMenu",
+ title: "@Loc["Admin.Catalog.Brands.Fields.IncludeInMenu"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IncludeInMenu) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Brands.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayOrder",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ title: "@Loc["Admin.Catalog.Brands.Fields.DisplayOrder"]",
+ width: 125,
+ minScreenWidth: 750,
+ }]
+ });
+ });
+</script>
+<script>
+ $(document).ready(function () {
+ //search button
+ $('#search-brands').click(function () {
+ //search
+ var grid = $('#brands-grid').data('kendoGrid');
+ grid.dataSource.page(1);
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchBrandName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-brands").click();
+ return false;
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchBrandName: $('#@Html.IdFor(model => model.SearchBrandName)').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDiscounts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDiscounts.cshtml
new file mode 100644
index 000000000..4f8dc6e9d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDiscounts.cshtml
@@ -0,0 +1,27 @@
+@model BrandModel
+<vc:admin-widget widget-zone="brand_discounts_top" additional-data="Model"/>
+@{
+ if (Model.AvailableDiscounts is { Count: > 0 })
+ {
+ <div class="mt-checkbox-list">
+ @foreach (var discount in Model.AvailableDiscounts)
+ {
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <input type="checkbox" name="SelectedDiscountIds" value="@discount.Id"
+ @if (Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))
+ {
+ <text> checked="checked" </text>
+ }/>@discount.Name
+ <div class="control__indicator"></div>
+ </label>
+ }
+ </div>
+ }
+ else
+ {
+ <div class="note note-info">
+ @Html.Raw(Loc["Admin.Catalog.Brands.Discounts.NoDiscounts"])
+ </div>
+ }
+}
+<vc:admin-widget widget-zone="brand_discounts_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDocuments.cshtml
new file mode 100644
index 000000000..d0fe77d3a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabDocuments.cshtml
@@ -0,0 +1,80 @@
+@model BrandModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="brand_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="brand-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Brand, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="brand_details_documents_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $("#brand-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Brand, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabInfo.cshtml
new file mode 100644
index 000000000..d2717a9f5
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabInfo.cshtml
@@ -0,0 +1,201 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model BrandModel
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)").click(togglePageSize);
+ togglePageSize();
+ });
+
+ function togglePageSize() {
+ if ($('#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)').is(':checked')) {
+ $('#pnlPageSize').hide();
+ $('#pnlPageSizeOptions').show();
+ } else {
+ $('#pnlPageSize').show();
+ $('#pnlPageSizeOptions').hide();
+ }
+ }
+</script>
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Name"/>
+ <span asp-validation-for="@Model.Locales[item].Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Description" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].BottomDescription"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="brand_details_info_top" additional-data="Model"/>
+ <localized-editor localized-template="@template" name="brand-info-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Description" asp-template="Editor"/>
+ <span asp-validation-for="Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="BottomDescription"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="BrandLayoutId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BrandLayoutId" asp-items="Model.AvailableBrandLayouts"/>
+ <span asp-validation-for="BrandLayoutId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PictureId"/>
+ <div class="col-md-9 col-sm-9">
+ @{
+ ViewData["Reference"] = "Brand";
+ ViewData["ObjectId"] = Model.Id;
+ }
+ <admin-input asp-for="PictureId"/>
+ <span asp-validation-for="PictureId"></span>
+ @if (!string.IsNullOrEmpty(Model.PictureId))
+ {
+ <label class="control-label">
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Brand", new { area = Constants.AreaStore })/?brandId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
+ </label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
+ }
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IncludeInMenu"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IncludeInMenu"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IncludeInMenu"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowCustomersToSelectPageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSize">
+ <admin-label asp-for="PageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSize"/>
+ <span asp-validation-for="PageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSizeOptions">
+ <admin-label asp-for="PageSizeOptions"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSizeOptions"/>
+ <span asp-validation-for="PageSizeOptions"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DefaultSort"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="DefaultSort" asp-items="Model.AvailableSortOptions"/>
+ <span asp-validation-for="DefaultSort"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Icon"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Icon"/>
+ <span asp-validation-for="Icon"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Published"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="Published"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="Published"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExternalId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExternalId"/>
+ <span asp-validation-for="ExternalId"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:admin-widget widget-zone="brand_details_info_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabSeo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabSeo.cshtml
new file mode 100644
index 000000000..5e6df1966
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.TabSeo.cshtml
@@ -0,0 +1,73 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model BrandModel
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaKeywords"/>
+ <span asp-validation-for="@Model.Locales[item].MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="@Model.Locales[item].MetaDescription"></admin-textarea>
+ <span asp-validation-for="@Model.Locales[item].MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaTitle"/>
+ <span asp-validation-for="@Model.Locales[item].MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].SeName"/>
+ <span asp-validation-for="@Model.Locales[item].SeName"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="brand_details_seo_top" additional-data="Model"/>
+ <localized-editor localized-template="@template" name="brand-seo-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaKeywords"/>
+ <span asp-validation-for="MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="MetaDescription"></admin-textarea>
+ <span asp-validation-for="MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaTitle"/>
+ <span asp-validation-for="MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SeName"/>
+ <span asp-validation-for="SeName"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.cshtml
new file mode 100644
index 000000000..a7b9987f5
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Brand/Partials/CreateOrUpdate.cshtml
@@ -0,0 +1,53 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model BrandModel
+@inject IPermissionService permissionService
+@{
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<admin-tabstrip name="brand-edit" BindGrid="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Catalog.Brands.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabInfo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.SEO"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabSeo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Brands.Discounts"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDiscounts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Catalog.Brands.Documents"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDocuments" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="4">
+ <content>
+ <div>
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="brand_details_tabs" additional-data="Model"/>
+ </items>
+</admin-tabstrip>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Create.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Create.cshtml
new file mode 100644
index 000000000..3cbca3ecc
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Create.cshtml
@@ -0,0 +1,37 @@
+@model CategoryModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Categories.AddNew"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Category" asp-action="Create" method="post" id="category-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-sitemap"></i>
+ @Loc["Admin.Catalog.Categories.AddNew"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Categories.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ </div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="category_details_buttons" additional-data="null"/>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Edit.cshtml
new file mode 100644
index 000000000..c7965d881
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Edit.cshtml
@@ -0,0 +1,45 @@
+@model CategoryModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Categories.EditCategoryDetails"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Category" asp-action="Edit" method="post" id="category-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-sitemap"></i>
+ @Loc["Admin.Catalog.Categories.EditCategoryDetails"] - @Model.Name
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Categories.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="button" onclick="window.open('@Url.RouteUrl("Category", new { Model.SeName })','_blank');" class="btn purple">
+ <i class="fa fa-eye"></i>
+ @Loc["Admin.Common.Preview"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <span id="category-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ </div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="category_details_buttons" additional-data="Model"/>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="category-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/List.cshtml
new file mode 100644
index 000000000..6af090363
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/List.cshtml
@@ -0,0 +1,156 @@
+@model CategoryListModel
+@inject AdminAreaSettings adminAreaSettings
+
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Categories.Manage"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-sitemap"></i>
+ @Loc["Admin.Catalog.Categories.Manage"]
+ </div>
+ <div class="actions btn-group btn-group-devided util-btn-margin-bottom-5">
+ <a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green">
+ <i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span>
+ </a>
+ <vc:admin-widget widget-zone="category_list_buttons" additional-data="null"/>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="row align-items-end">
+ <div class="col-md-6 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchCategoryName" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/>
+ <admin-input asp-for="SearchCategoryName"/>
+ </div>
+ </div>
+ <div class="col-md-3 col-sm-12 col-12 mt-md-0 mt-3">
+ <div class="form-actions">
+ <button class="btn btn-success filter-submit" id="search-categories">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="categories-grid"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#categories-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("List", "Category", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Breadcrumb",
+ title: "@Loc["Admin.Catalog.Categories.Fields.Name"]",
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Breadcrumb)#</a>',
+ },
+ {
+ field: "ShowOnHomePage",
+ title: "@Loc["Admin.Catalog.Categories.Fields.ShowOnHomePage"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(ShowOnHomePage) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "IncludeInMenu",
+ title: "@Loc["Admin.Catalog.Categories.Fields.ShowInMenu"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IncludeInMenu) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Categories.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayOrder",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ title: "@Loc["Admin.Catalog.Categories.Fields.DisplayOrder"]",
+ width: 125,
+ minScreenWidth: 750,
+ }]
+ });
+ });
+</script>
+<script>
+ $(document).ready(function () {
+ //search button
+ $('#search-categories').click(function () {
+ //search
+ var grid = $('#categories-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchCategoryName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-categories").click();
+ return false;
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchCategoryName: $('#@Html.IdFor(model => model.SearchCategoryName)').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+</script>
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDiscounts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDiscounts.cshtml
new file mode 100644
index 000000000..26bfeff75
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDiscounts.cshtml
@@ -0,0 +1,25 @@
+@model CategoryModel
+<vc:admin-widget widget-zone="category_details_discounts_top" additional-data="Model"/>
+@if (Model.AvailableDiscounts is { Count: > 0 })
+{
+ <div class="mt-checkbox-list">
+ @foreach (var discount in Model.AvailableDiscounts)
+ {
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <input type="checkbox" name="SelectedDiscountIds" value="@discount.Id"
+ @if (Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))
+ {
+ <text> checked="checked" </text>
+ }/>@discount.Name
+ <div class="control__indicator"></div>
+ </label>
+ }
+ </div>
+}
+else
+{
+ <div class="note note-info">
+ @Html.Raw(Loc["Admin.Catalog.Categories.Discounts.NoDiscounts"])
+ </div>
+}
+<vc:admin-widget widget-zone="category_details_discounts_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDocuments.cshtml
new file mode 100644
index 000000000..9c0d13167
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabDocuments.cshtml
@@ -0,0 +1,80 @@
+@model CategoryModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="category_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="category-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Category, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="category_details_documents_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $("#category-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Category, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabInfo.cshtml
new file mode 100644
index 000000000..2e0d3fb96
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabInfo.cshtml
@@ -0,0 +1,276 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model CategoryModel
+
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)").click(togglePageSize);
+ $("#@Html.IdFor(model => model.ShowOnSearchBox)").click(toggleSearchBoxOrder);
+ togglePageSize();
+ toggleSearchBoxOrder();
+ });
+
+ function togglePageSize() {
+ if ($('#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)').is(':checked')) {
+ $('#pnlPageSize').hide();
+ $('#pnlPageSizeOptions').show();
+ } else {
+ $('#pnlPageSize').show();
+ $('#pnlPageSizeOptions').hide();
+ }
+ }
+ function toggleSearchBoxOrder() {
+ if ($('#@Html.IdFor(model => model.ShowOnSearchBox)').is(':checked')) {
+ $('#pnlSearchBoxOrder').show();
+ } else {
+ $('#pnlSearchBoxOrder').hide();
+ }
+ }
+
+</script>
+
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Name"/>
+ <span asp-validation-for="@Model.Locales[item].Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Description" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].BottomDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Flag"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Flag"/>
+ <span asp-validation-for="@Model.Locales[item].Flag"></span>
+ </div>
+ </div>
+ <input type="hidden" asp-for="@Model.Locales[item].LanguageId"/>
+ </div>;
+}
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="category_details_info_top" additional-data="Model"/>
+ <localized-editor localized-template="@template" name="category-info-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Description" asp-template="Editor"/>
+ <span asp-validation-for="Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="BottomDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Flag"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Flag"/>
+ <span asp-validation-for="Flag"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+ <div class="form-group">
+ <admin-label asp-for="FlagStyle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="FlagStyle"/>
+ <span asp-validation-for="FlagStyle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Icon"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Icon"/>
+ <span asp-validation-for="Icon"></span>
+ </div>
+ </div>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="CategoryLayoutId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="CategoryLayoutId" asp-items="Model.AvailableCategoryLayouts"/>
+ <span asp-validation-for="CategoryLayoutId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ @{
+ ViewData["Reference"] = "Category";
+ ViewData["ObjectId"] = Model.Id;
+ }
+ <admin-label asp-for="PictureId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PictureId"/>
+ <span asp-validation-for="PictureId"></span>
+ @if (!string.IsNullOrEmpty(Model.PictureId))
+ {
+ <label class="control-label">
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Category", new { area = Constants.AreaStore })/?categoryId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
+ </label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
+ }
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ParentCategoryId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ParentCategoryId"/>
+ <span asp-validation-for="ParentCategoryId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="FeaturedProductsOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="FeaturedProductsOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="FeaturedProductsOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IncludeInMenu"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IncludeInMenu"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IncludeInMenu"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnSearchBox"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnSearchBox"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnSearchBox"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlSearchBoxOrder">
+ <admin-label asp-for="SearchBoxDisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBoxDisplayOrder"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowCustomersToSelectPageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSize">
+ <admin-label asp-for="PageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSize"/>
+ <span asp-validation-for="PageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSizeOptions">
+ <admin-label asp-for="PageSizeOptions"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSizeOptions"/>
+ <span asp-validation-for="PageSizeOptions"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DefaultSort"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="DefaultSort" asp-items="Model.AvailableSortOptions"/>
+ <span asp-validation-for="DefaultSort"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Published"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="Published"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="Published"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="HideOnCatalog"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="HideOnCatalog"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="HideOnCatalog"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExternalId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExternalId"/>
+ <span asp-validation-for="ExternalId"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:admin-widget widget-zone="category_details_info_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabProducts.cshtml
new file mode 100644
index 000000000..ead773130
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabProducts.cshtml
@@ -0,0 +1,146 @@
+@model CategoryModel
+@inject AdminAreaSettings adminAreaSettings
+<vc:admin-widget widget-zone="category_details_products_top" additional-data="Model"/>
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <div class="panel-body">
+ <div id="products-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewProduct" href="@(Url.Action("ProductAddPopup", "Category", new { categoryId = Model.Id, btnId = "btnRefreshProducts", formId = "category-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Categories.Products.AddNew"]</a>
+ <input type="submit" id="btnRefreshProducts" style="display: none"/>
+ </div>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductList", "Category", new { categoryId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductUpdate", "Category", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductDelete", "Category", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductName: {editable: false, type: "string" },
+ IsFeaturedProduct: {editable: true, type: "boolean" },
+ DisplayOrder: {editable: true, type: "number" },
+ ProductId: {editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Catalog.Categories.Products.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>',
+ }, {
+ field: "IsFeaturedProduct",
+ title: "@Loc["Admin.Catalog.Categories.Products.Fields.IsFeaturedProduct"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ minScreenWidth: 750,
+ width: 175,
+ template: '# if(IsFeaturedProduct) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayOrder",
+ width: 125,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ minScreenWidth: 750,
+ title: "@Loc["Admin.Catalog.Categories.Products.Fields.DisplayOrder"]",
+ format: "{0:0}",
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ }]
+ });
+ });
+ </script>
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshProducts').click(function () {
+ //refresh grid
+ var grid = $("#products-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Categories.Products.SaveBeforeEdit"]
+ </div>
+}
+<vc:admin-widget widget-zone="category_details_products_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabSeo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabSeo.cshtml
new file mode 100644
index 000000000..6a82eda1b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.TabSeo.cshtml
@@ -0,0 +1,77 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model CategoryModel
+
+<vc:admin-widget widget-zone="category_details_seo_top" additional-data="Model"/>
+
+@{
+ Func<int, HelperResult> template = @<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaKeywords"/>
+ <span asp-validation-for="@Model.Locales[item].MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="@Model.Locales[item].MetaDescription"></admin-textarea>
+ <span asp-validation-for="@Model.Locales[item].MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaTitle"/>
+ <span asp-validation-for="@Model.Locales[item].MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].SeName"/>
+ <span asp-validation-for="@Model.Locales[item].SeName"></span>
+ </div>
+ </div>
+ <input type="hidden" asp-for="@Model.Locales[item].LanguageId"/>
+ </div>
+ </div>;
+}
+
+<localized-editor localized-template="@template" name="category-seo-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaKeywords"/>
+ <span asp-validation-for="MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="MetaDescription"></admin-textarea>
+ <span asp-validation-for="MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaTitle"/>
+ <span asp-validation-for="MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SeName"/>
+ <span asp-validation-for="SeName"></span>
+ </div>
+ </div>
+ </div>
+ </div>
+</localized-editor>
+
+<vc:admin-widget widget-zone="category_details_seo_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.cshtml
new file mode 100644
index 000000000..7b397fed3
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/Partials/CreateOrUpdate.cshtml
@@ -0,0 +1,61 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model CategoryModel
+@inject IPermissionService permissionService
+@{
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+
+<admin-tabstrip name="category-edit" BindGrid="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Catalog.Categories.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabInfo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.SEO"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabSeo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Categories.Products"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabProducts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Categories.Discounts"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDiscounts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Catalog.Categories.Documents"]" tab-index="4">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDocuments" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="5">
+ <content>
+ <div>
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="category_details_tabs" additional-data="Model"/>
+ </items>
+</admin-tabstrip>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Category/ProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/ProductAddPopup.cshtml
new file mode 100644
index 000000000..b51e33b47
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Category/ProductAddPopup.cshtml
@@ -0,0 +1,219 @@
+@model CategoryModel.AddCategoryProductModel
+@inject AdminAreaSettings adminAreaSettings
+
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Categories.Products.AddNew"];
+}
+<form id="ProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Category" asp-action="ProductAddPopup" method="post"
+ asp-route-CategoryId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["CategoryId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-sitemap"></i>
+ @Loc["Admin.Catalog.Categories.Products.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ $('.extend-collapse').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-close').toggle();
+ });
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAddPopupList", "Category", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function() {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function(event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Create.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Create.cshtml
new file mode 100644
index 000000000..2d523079f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Create.cshtml
@@ -0,0 +1,37 @@
+@model CollectionModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Collections.AddNew"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Collection" asp-action="Create" method="post" id="collection-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Collections.AddNew"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Collections.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <vc:admin-widget widget-zone="collection_details_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Edit.cshtml
new file mode 100644
index 000000000..bbc2e6dd1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Edit.cshtml
@@ -0,0 +1,45 @@
+@model CollectionModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Collections.EditCollectionDetails"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Collection" asp-action="Edit" method="post" id="collection-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Collections.EditCollectionDetails"] - @Model.Name
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Collections.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="button" onclick="window.open('@Url.RouteUrl("Collection", new { Model.SeName })','_blank');" class="btn purple">
+ <i class="fa fa-eye"></i>
+ @Loc["Admin.Common.Preview"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <span id="collection-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="collection_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="collection-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/List.cshtml
new file mode 100644
index 000000000..11320f2db
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/List.cshtml
@@ -0,0 +1,151 @@
+@model CollectionListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ ViewBag.Title = Loc["Admin.Catalog.Collections"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-building-o"></i>
+ @Loc["Admin.Catalog.Collections"]
+ </div>
+ <div class="actions btn-group btn-group-devided util-btn-margin-bottom-5">
+ <a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green">
+ <i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span>
+ </a>
+ <vc:admin-widget widget-zone="collection_list_buttons" additional-data="null"/>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="row align-items-end">
+ <div class="col-md-6 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchCollectionName" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/>
+ <admin-input asp-for="SearchCollectionName"/>
+ </div>
+ </div>
+ <div class="col-md-3 col-sm-12 col-12 mt-md-0 mt-3">
+ <div class="form-actions">
+ <button class="btn btn-success filter-submit" id="search-collections">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="collections-grid"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#collections-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("List", "Collection", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Collections.Fields.Name"]",
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ },
+ {
+ field: "ShowOnHomePage",
+ title: "@Loc["Admin.Catalog.Collections.Fields.ShowOnHomePage"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(ShowOnHomePage) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "IncludeInMenu",
+ title: "@Loc["Admin.Catalog.Collections.Fields.IncludeInMenu"]",
+ width: 175,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IncludeInMenu) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Collections.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayOrder",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ title: "@Loc["Admin.Catalog.Collections.Fields.DisplayOrder"]",
+ width: 125,
+ minScreenWidth: 750,
+ }]
+ });
+ });
+</script>
+<script>
+ $(document).ready(function () {
+ //search button
+ $('#search-collections').click(function () {
+ //search
+ var grid = $('#collections-grid').data('kendoGrid');
+ grid.dataSource.page(1);
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchCollectionName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-collections").click();
+ return false;
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchCollectionName: $('#@Html.IdFor(model => model.SearchCollectionName)').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDiscounts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDiscounts.cshtml
new file mode 100644
index 000000000..723b79fca
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDiscounts.cshtml
@@ -0,0 +1,27 @@
+@model CollectionModel
+<vc:admin-widget widget-zone="collection_discounts_top" additional-data="Model"/>
+@{
+ if (Model.AvailableDiscounts is { Count: > 0 })
+ {
+ <div class="mt-checkbox-list">
+ @foreach (var discount in Model.AvailableDiscounts)
+ {
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <input type="checkbox" name="SelectedDiscountIds" value="@discount.Id"
+ @if (Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))
+ {
+ <text> checked="checked" </text>
+ }/>@discount.Name
+ <div class="control__indicator"></div>
+ </label>
+ }
+ </div>
+ }
+ else
+ {
+ <div class="note note-info">
+ @Html.Raw(Loc["Admin.Catalog.Collections.Discounts.NoDiscounts"])
+ </div>
+ }
+}
+<vc:admin-widget widget-zone="collection_discounts_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDocuments.cshtml
new file mode 100644
index 000000000..f009e9f3f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabDocuments.cshtml
@@ -0,0 +1,80 @@
+@model CollectionModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="collection_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="collection-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Collection, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="collection_details_documents_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $("#collection-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Collection, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabInfo.cshtml
new file mode 100644
index 000000000..70a36cef1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabInfo.cshtml
@@ -0,0 +1,212 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model CollectionModel
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)").click(togglePageSize);
+ togglePageSize();
+ });
+
+ function togglePageSize() {
+ if ($('#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)').is(':checked')) {
+ $('#pnlPageSize').hide();
+ $('#pnlPageSizeOptions').show();
+ } else {
+ $('#pnlPageSize').show();
+ $('#pnlPageSizeOptions').hide();
+ }
+ }
+</script>
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Name"/>
+ <span asp-validation-for="@Model.Locales[item].Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Description" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].BottomDescription"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="collection_details_info_top" additional-data="Model"/>
+ <localized-editor localized-template="@template" name="collection-info-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Description"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Description" asp-template="Editor"/>
+ <span asp-validation-for="Description"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BottomDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BottomDescription" asp-template="Editor"/>
+ <span asp-validation-for="BottomDescription"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="CollectionLayoutId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="CollectionLayoutId" asp-items="Model.AvailableCollectionLayouts"/>
+ <span asp-validation-for="CollectionLayoutId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ @{
+ ViewData["Reference"] = "Collection";
+ ViewData["ObjectId"] = Model.Id;
+ }
+
+ <admin-label asp-for="PictureId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PictureId"/>
+ <span asp-validation-for="PictureId"></span>
+ @if (!string.IsNullOrEmpty(Model.PictureId))
+ {
+ <label class="control-label">
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Collection", new { area = Constants.AreaStore })/?collectionId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
+ </label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
+ }
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="FeaturedProductsOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="FeaturedProductsOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="FeaturedProductsOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IncludeInMenu"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IncludeInMenu"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IncludeInMenu"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowCustomersToSelectPageSize"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowCustomersToSelectPageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSize">
+ <admin-label asp-for="PageSize"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSize"/>
+ <span asp-validation-for="PageSize"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPageSizeOptions">
+ <admin-label asp-for="PageSizeOptions"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PageSizeOptions"/>
+ <span asp-validation-for="PageSizeOptions"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DefaultSort"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="DefaultSort" asp-items="Model.AvailableSortOptions"/>
+ <span asp-validation-for="DefaultSort"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Icon"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Icon"/>
+ <span asp-validation-for="Icon"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Published"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="Published"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="Published"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExternalId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExternalId"/>
+ <span asp-validation-for="ExternalId"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:admin-widget widget-zone="collection_details_info_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabProducts.cshtml
new file mode 100644
index 000000000..97716379e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabProducts.cshtml
@@ -0,0 +1,148 @@
+@model CollectionModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="collection_details_products_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="products-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewProduct" href="@(Url.Action("ProductAddPopup", "Collection", new { collectionId = Model.Id, btnId = "btnRefreshProducts", formId = "collection-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Collections.Products.AddNew"]</a>
+ <input type="submit" id="btnRefreshProducts" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="collection_details_products_bottom" additional-data="Model"/>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductList", "Collection", new { collectionId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductUpdate", "Collection", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductDelete", "Collection", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductName: {editable: false, type: "string" },
+ IsFeaturedProduct: {editable: true, type: "boolean" },
+ DisplayOrder: {editable: true, type: "number" },
+ ProductId: {editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ editable: false,
+ type: "string",
+ title: "@Loc["Admin.Catalog.Collections.Products.Fields.Product"]",
+ template: '<a href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>'
+ }, {
+ field: "IsFeaturedProduct",
+ title: "@Loc["Admin.Catalog.Collections.Products.Fields.IsFeaturedProduct"]",
+ width: 100,
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsFeaturedProduct) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Collections.Products.Fields.DisplayOrder"]",
+ minScreenWidth: 750,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ format: "{0:0}",
+ width: 120
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ }]
+ });
+ });
+ </script>
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshProducts').click(function () {
+ //refresh grid
+ var grid = $("#products-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Collections.Products.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabSeo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabSeo.cshtml
new file mode 100644
index 000000000..a117d5668
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.TabSeo.cshtml
@@ -0,0 +1,73 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model CollectionModel
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaKeywords"/>
+ <span asp-validation-for="@Model.Locales[item].MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="@Model.Locales[item].MetaDescription"></admin-textarea>
+ <span asp-validation-for="@Model.Locales[item].MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaTitle"/>
+ <span asp-validation-for="@Model.Locales[item].MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].SeName"/>
+ <span asp-validation-for="@Model.Locales[item].SeName"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="collection_details_seo_top" additional-data="Model"/>
+ <localized-editor localized-template="@template" name="collection-seo-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaKeywords"/>
+ <span asp-validation-for="MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="MetaDescription"></admin-textarea>
+ <span asp-validation-for="MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaTitle"/>
+ <span asp-validation-for="MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SeName"/>
+ <span asp-validation-for="SeName"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.cshtml
new file mode 100644
index 000000000..da1a5b18e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/Partials/CreateOrUpdate.cshtml
@@ -0,0 +1,60 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model CollectionModel
+@inject IPermissionService permissionService
+@{
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<admin-tabstrip name="collection-edit" BindGrid="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Catalog.Collections.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabInfo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.SEO"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabSeo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Collections.Products"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabProducts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Collections.Discounts"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDiscounts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Catalog.Collections.Documents"]" tab-index="4">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDocuments" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="5">
+ <content>
+ <div>
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="collection_details_tabs" additional-data="Model"/>
+ </items>
+</admin-tabstrip>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/ProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/ProductAddPopup.cshtml
new file mode 100644
index 000000000..eb7c04f94
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Collection/ProductAddPopup.cshtml
@@ -0,0 +1,221 @@
+@model CollectionModel.AddCollectionProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Collections.Products.AddNew"];
+}
+
+<form id="ProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Collection" asp-action="ProductAddPopup" method="post"
+ asp-route-CollectionId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["CollectionId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Collections.Products.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ $('.extend-collapse').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-close').toggle();
+ });
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAddPopupList", "Collection", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: {
+ style: "text-align:center"
+ },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Home/AccessDenied.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/AccessDenied.cshtml
new file mode 100644
index 000000000..e74630a87
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/AccessDenied.cshtml
@@ -0,0 +1,20 @@
+<input id="active-menu-item" type="hidden" value="/Store"/>
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <vc:vendor-widget widget-zone="store_security_access_denied_top" additional-data="null"/>
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-list-alt"></i>
+ @Loc["Admin.AccessDenied.Title"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="note note-warning">
+ @Loc["Admin.AccessDenied.Description"]
+ </div>
+ </div>
+ <vc:vendor-widget widget-zone="store_security_access_denied_bottom" additional-data="null"/>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Index.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Index.cshtml
new file mode 100644
index 000000000..c4204fe01
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Index.cshtml
@@ -0,0 +1,136 @@
+@inject IContextAccessor contextAccessor;
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Dashboard"];
+}
+
+<vc:store-widget widget-zone="store_dashboard_top" additional-data="null"/>
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel">
+ <div class="x_title">
+ <h2>@Loc["Admin.Dashboard.Summary"] - @contextAccessor.StoreContext.CurrentStore.Name</h2>
+ <div class="filter">
+ <div class="page-bar" style="height:43px;">
+ <div class="page-toolbar">
+ <div id="dashboard-report-range" class="pull-right btn btn-fit-height green" data-original-title="Change dashboard date range">
+ <i class="icon-calendar"></i>&nbsp;
+ <span class="thin uppercase d-none d-sm-inline"></span>&nbsp;
+ <i class="fa fa-angle-down"></i>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="clearfix"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:store-page system-name="StorePortalInfo"/>
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light bordered">
+ <div class="x_title">
+ <h2 class="caption-subject font-blue bold uppercase">@Loc["Admin.Dashboard.ReportLatestOrder"]</h2>
+ <div class="clear"></div>
+ </div>
+ <div class="x_content">
+ @await Component.InvokeAsync("StoreLatestOrder")
+ </div>
+ </div>
+ </div>
+</div>
+
+<vc:store-widget widget-zone="store_dashboard_bottom" additional-data="null"/>
+<script>
+ $(document).ready(function (e) {
+ var site = site || {};
+ site.baseUrl = site.baseUrl || "";
+ $(".partialContents").each(function (index, item) {
+ var url = site.baseUrl + $(item).data("url");
+ if (url && url.length > 0) {
+ $(item).load(url);
+ }
+ });
+ });
+
+
+ var Dashboard = function () {
+ return {
+ initDashboardDaterange: function () {
+ if (!jQuery().daterangepicker) {
+ return;
+ }
+
+ $('#dashboard-report-range').daterangepicker({
+ startDate: moment().startOf('month'),
+ "ranges": {
+ 'Today': [moment(), moment()],
+ 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
+ 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
+ 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
+ 'This Month': [moment().startOf('month'), moment().endOf('month')],
+ 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
+ },
+ "locale": {
+ "format": "MM/DD/YYYY",
+ "separator": " - ",
+ "applyLabel": "Apply",
+ "cancelLabel": "Cancel",
+ "fromLabel": "From",
+ "toLabel": "To",
+ "customRangeLabel": "Custom",
+ "daysOfWeek": [
+ "Su",
+ "Mo",
+ "Tu",
+ "We",
+ "Th",
+ "Fr",
+ "Sa"
+ ],
+ "monthNames": [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ ],
+ "firstDay": 1
+ },
+ opens: ($('html').css('direction') === 'rtl' ? 'right' : 'left'),
+ }, function (start, end, label) {
+ $('#dashboard-report-range span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
+ });
+
+ $('#dashboard-report-range span').html(moment().startOf('month').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
+ $('#dashboard-report-range').show();
+ },
+
+ init: function () {
+ this.initDashboardDaterange();
+ }
+ }
+ }();
+
+ Dashboard.init();
+
+ $('#dashboard-report-range').on('apply.daterangepicker', function (ev, picker) {
+ if ($.isFunction(window.initReportCustomerTimeChart)) {
+ initReportCustomerTimeChart(false);
+ };
+ if ($.isFunction(window.initReportOrderTimeChart)) {
+ initReportOrderTimeChart(false);
+ };
+ var gridOrders = $('#latest-orders-grid').data('kendoGrid');
+ if (gridOrders != undefined) {
+ gridOrders.dataSource.read();
+ }
+ });</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Statistics.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Statistics.cshtml
new file mode 100644
index 000000000..f1e7f11bb
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Home/Statistics.cshtml
@@ -0,0 +1,55 @@
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Dashboard.Statistics"];
+}
+
+<div class="page-bar" style="height:43px;">
+ <div class="page-toolbar">
+ <div id="dashboard-report-range" class="pull-right btn btn-sm">
+ <i class="icon-calendar"></i>&nbsp;
+ <span class="thin uppercase">@DateTime.Now.ToLocalTime().ToString(CultureInfo.InvariantCulture)</span>&nbsp;
+ </div>
+ </div>
+</div>
+<div class="content-header">
+ <h3 class="page-title">
+ <i class="icon-bulb"></i>
+ @Loc["Admin.Dashboard"]
+ <small>@Loc["Admin.Dashboard.Statistics"]</small>
+ </h3>
+</div>
+
+<div class="content">
+ <vc:store-widget widget-zone="store_dashboard_statistics_before"/>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="x_panel">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <span class="caption-subject font-dark bold uppercase">@Loc["Admin.Reports.BestSellers.ByQuantity"]</span>
+ </div>
+ </div>
+ <div class="x_content">
+ <vc:store-bestsellers-brief-report-by-quantity></vc:store-bestsellers-brief-report-by-quantity>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="x_panel">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <span class="caption-subject font-dark bold uppercase">@Loc["Admin.Reports.BestSellers.ByAmount"]</span>
+ </div>
+ </div>
+ <div class="x_content">
+ <vc:store-bestsellers-brief-report-by-amount></vc:store-bestsellers-brief-report-by-amount>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <vc:store-widget widget-zone="store_dashboard_statistics_after"/>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Login/Index.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Login/Index.cshtml
new file mode 100644
index 000000000..a8d0ef51f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Login/Index.cshtml
@@ -0,0 +1,76 @@
+@using Grand.Web.AdminShared.Models.Common
+@model LoginModel
+@{
+ //page title
+ Layout = Constants.LayoutStoreLogin;
+}
+
+<form asp-route="AdminLogin" asp-area="@Constants.AreaStore" method="post">
+ <div class="card col-xl-6 col-lg-8 col-md-10 col-12">
+ <h5 class="card-header">
+ <strong>@Loc["Admin.Login.Title"]</strong>
+ </h5>
+ <div class="card-body">
+ <div class="row">
+ <div asp-validation-summary="All" class="message-error text-center"></div>
+ <div class="col-12 form-group mb-0">
+ @if (Model.UsernamesEnabled)
+ {
+ <div class="form-group row">
+ <div class="col-lg-3 col-12 d-flex align-items-start justify-content-sm-start">
+ <label asp-for="Username" class="h5 m-0">@Loc["Admin.Login.UserName"]:</label>
+ </div>
+ <div class="col-lg-9 col-12">
+ <input asp-for="Username" class="form-control username" autofocus="autofocus"/>
+ <span asp-validation-for="Username"></span>
+ </div>
+ </div>
+ }
+ else
+ {
+ <div class="form-group row">
+ <div class="col-lg-3 col-12 d-flex align-items-start justify-content-start">
+ <label asp-for="Email" class="h5 m-0">@Loc["Admin.Login.Email"]:</label>
+ </div>
+ <div class="col-lg-9 col-12">
+ <input asp-for="Email" class="form-control email" autofocus="autofocus"/>
+ <span asp-validation-for="Email"></span>
+ </div>
+ </div>
+ }
+ <div class="form-group row">
+ <div class="col-lg-3 col-12 d-flex align-items-center justify-content-start">
+ <label asp-for="Password" class="h5 m-0">@Loc["Admin.Login.Password"]:</label>
+ </div>
+ <div class="col-lg-9 col-12">
+ <input asp-for="Password" class="form-control password" autocomplete="off"/>
+ <span asp-validation-for="Password"></span>
+ </div>
+ </div>
+ <div class="inputs d-flex flex-sm-row flex-column justify-content-center">
+ <label class="custom-control custom-checkbox">
+ <input class="custom-control-input" asp-for="RememberMe"/>
+ <input class="custom-control-label" name="RememberMe" type="hidden" value="false">
+ <span class="custom-control-label"></span>
+ <span class="custom-control-description">@Loc["Admin.Login.RememberMe"]</span>
+ </label>
+ <span class="ml-3 forgot-password">
+ <a asp-route="PasswordRecovery">@Loc["Admin.Login.ForgotPassword"]</a>
+ </span>
+ </div>
+ @if (Model.DisplayCaptcha)
+ {
+ <div class="captcha-box">
+ <captcha/>
+ </div>
+ }
+ </div>
+ </div>
+ </div>
+ <div class="card-footer px-0">
+ <div class="buttons">
+ <input class="btn btn-info login-button px-5" type="submit" value="@Loc["Admin.Login.LoginButton"]"/>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Login/TwoFactorAuthorization.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Login/TwoFactorAuthorization.cshtml
new file mode 100644
index 000000000..8f9d6f404
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Login/TwoFactorAuthorization.cshtml
@@ -0,0 +1,33 @@
+@inject IPageHeadBuilder pagebuilder
+@{
+ Layout = Constants.LayoutStoreLogin;
+ //title
+ pagebuilder.AddTitleParts(Loc["Admin.Login.TwoFactor.Title.Login"]);
+}
+<form asp-action="TwoFactorAuthorization" asp-controller="Login" asp-area="@Constants.AreaStore" method="post">
+ <div class="card col-xl-6 col-lg-8 col-md-10 col-12">
+ <h5 class="card-header">
+ <strong>@Loc["Admin.Login.TwoFactorAuth.EnterCode"]</strong>
+ </h5>
+ <div class="card-body">
+ <div class="row">
+ <div asp-validation-summary="All" class="col-12 justify-content-around text-danger"></div>
+ <div class="col-12 form-group mb-0 d-flex justify-content-around">
+ <div class="form-group row">
+ <div class="col-lg-3 col-12 d-flex align-items-start justify-content-sm-start">
+ <label name="token" class="h5 m-0">@Loc["Admin.Login.TwoFactorAuth.DigitCode"]</label>
+ </div>
+ <div class="col-lg-9 col-12">
+ <input name="token" type="text" class="form-control" autofocus/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="card-footer">
+ <div class="buttons">
+ <input class="btn btn-info login-button px-5" type="submit" value="@Loc["Admin.Login.TwoFactorAuth.SendCode"]"/>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Edit.cshtml
new file mode 100644
index 000000000..6d6cb2ee9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Edit.cshtml
@@ -0,0 +1,41 @@
+@model MerchandiseReturnModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.MerchandiseReturns.EditMerchandiseReturnDetails"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="MerchandiseReturn" asp-action="Edit" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.MerchandiseReturns.EditMerchandiseReturnDetails"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i> @Html.ActionLink(Loc["Admin.Orders.MerchandiseReturns.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <span id="merchandisereturn-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="merchandisereturn_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="merchandisereturn-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/List.cshtml
new file mode 100644
index 000000000..faeec0e56
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/List.cshtml
@@ -0,0 +1,207 @@
+@model MerchandiseReturnListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.MerchandiseReturns"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="MerchandiseReturn" asp-action="List" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.MerchandiseReturns"]
+ </div>
+ <vc:admin-widget widget-zone="merchandisereturn_list_buttons" additional-data="null"/>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchCustomerEmail" class="control-label"/>
+ <admin-input asp-for="SearchCustomerEmail"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="GoDirectlyToId" class="control-label"/>
+ <div class="input-group mb-0" style="text-align:left">
+ <admin-input asp-for="GoDirectlyToId"/>
+ <span class="input-group-append">
+ <input type="submit" id="go-to-merchandisereturn" asp-action="GoToId" name="go-to-merchandisereturn" class="btn default" value="@Loc["Admin.Common.Go"]"/>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-returnreqest">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="StartDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCustomerEmail" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCustomerEmail"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchMerchandiseReturnStatusId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchMerchandiseReturnStatusId" asp-items="Model.MerchandiseReturnStatus"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="x_content">
+ <div id="merchandisereturns-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<script>
+ $(document).ready(function() {
+ $("#merchandisereturns-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("List", "MerchandiseReturn", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "ReturnNumber",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.ID"]",
+ width: 50,
+ template: '<a class="k-link" href="Edit/#=Id#">#=ReturnNumber#</a>'
+ }, {
+ field: "Quantity",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Quantity"]",
+ width: 80,
+ template: '<a class="k-link" href="Edit/#=Id#">#=Quantity#</a>'
+ }, {
+ field: "Total",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Total"]",
+ width: 100,
+ template: '<a class="k-link" href="Edit/#=Id#">#=Total#</a>'
+ } , {
+ field: "CustomerId",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Customer"]",
+ width: 200,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:kendo.htmlEncode(CustomerInfo)#</a>'
+ }, {
+ field: "OrderId",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Order"]",
+ width: 80,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#">#:OrderNumber#</a>'
+ }, {
+ field: "MerchandiseReturnStatusStr",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Status"]",
+ width: 130,
+ template: '<a class="k-link" href="Edit/#=Id#">#=MerchandiseReturnStatusStr#</a>'
+ }, {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.CreatedOn"]",
+ width: 100,
+ type: "date",
+ format: "{0:G}"
+ }
+ ]
+ });
+ });
+ </script>
+
+<script>
+ function additionalData() {
+ var data = {
+ SearchMerchandiseReturnStatusId: $('#@Html.IdFor(model => model.SearchMerchandiseReturnStatusId)').val(),
+ SearchCustomerEmail: $('#@Html.IdFor(model => model.SearchCustomerEmail)').val(),
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ $(document).ready(function () {
+ $('#search-returnreqest').click(function () {
+ //search
+ var grid = $('#merchandisereturns-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchCustomerEmail)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-returnreqest").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.GoDirectlyToId)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#go-to-merchandisereturn").click();
+ return false;
+ }
+ });
+ });
+ </script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabAddress.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabAddress.cshtml
new file mode 100644
index 000000000..3ca211e2d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabAddress.cshtml
@@ -0,0 +1,15 @@
+@model MerchandiseReturnModel
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="merchandisereturn_tab_address_top" additional-data="Model"/>
+ <div class="form-body">
+ @if (Model.PickupAddress != null)
+ {
+ <div class="form-group">
+ <admin-label asp-for="PickupAddress"/>
+ <br/>
+ <admin-input asp-for="PickupAddress" asp-template="Address"/>
+ </div>
+ }
+ </div>
+ <vc:admin-widget widget-zone="merchandisereturn_tab_address_bottom" additional-data="Model"/>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabDocuments.cshtml
new file mode 100644
index 000000000..aadc4a57a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabDocuments.cshtml
@@ -0,0 +1,70 @@
+@model MerchandiseReturnModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="merchandisereturn_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="merchandisereturn-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.MerchandiseReturn, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Common.AddNew"]</button>
+ </div>
+ <vc:admin-widget widget-zone="merchandisereturn_details_documents_bottom" additional-data="Model"/>
+</div>
+
+<script>
+$(document).ready(function () {
+ $("#merchandisereturn-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.MerchandiseReturn, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+});
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabInfo.cshtml
new file mode 100644
index 000000000..e601269fa
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.TabInfo.cshtml
@@ -0,0 +1,152 @@
+@model MerchandiseReturnModel
+@inject AdminAreaSettings adminAreaSettings
+@inject OrderSettings orderSettings
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="merchandisereturn_tab_info_top" additional-data="Model"/>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="ReturnNumber"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.ReturnNumber</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExternalId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExternalId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Html.ActionLink(Loc["Admin.Common.View"], "Edit", "Order", new { id = Model.OrderId }, new { })</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CustomerId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label"> @Html.ActionLink(Model.CustomerInfo, "Edit", "Customer", new { id = Model.CustomerId }, new { }) </label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MerchandiseReturnStatusId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="MerchandiseReturnStatusId" asp-items="EnumTranslationService.ToSelectList((MerchandiseReturnStatus)Model.MerchandiseReturnStatusId)"/>
+ <span asp-validation-for="MerchandiseReturnStatusId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CustomerComments"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="CustomerComments"></admin-textarea>
+ <span asp-validation-for="CustomerComments"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="StaffNotes"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="StaffNotes"></admin-textarea>
+ <span asp-validation-for="StaffNotes"></span>
+ </div>
+ </div>
+ @if (orderSettings.MerchandiseReturns_AllowToSpecifyPickupDate)
+ {
+ <div class="form-group">
+ <admin-label asp-for="PickupDate"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PickupDate"/>
+ </div>
+ </div>
+ }
+ <div class="form-group">
+ <admin-label asp-for="CreatedOn"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Html.DisplayFor(model => model.CreatedOn)</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="NotifyCustomer"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="NotifyCustomer"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="NotifyCustomer"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="merchandisereturn_tab_info_bottom" additional-data="Model"/>
+</div>
+
+
+<script>
+ $(document).ready(function () {
+ var data = { merchandiseReturnId: "@Model.Id" };
+ addAntiForgeryToken(data);
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductsForMerchandiseReturn", "MerchandiseReturn", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: data
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "ProductName",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Item"]",
+ width: 200,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>'
+ }, {
+ field: "ProductSku",
+ title: "@Loc["Admin.Catalog.Products.Fields.Sku"]",
+ width: 200,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductSku)#</a>'
+ }, {
+ field: "Quantity",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.Quantity"]",
+ width: 80
+ }, {
+ field: "UnitPrice",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.UnitPrice"]",
+ width: 100
+ }, {
+ field: "ReasonForReturn",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.ReturnReason"]",
+ width: 200
+ }, {
+ field: "RequestedAction",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.Fields.ReturnAction"]",
+ width: 200,
+ }
+ ]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml
new file mode 100644
index 000000000..0efc911ea
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml
@@ -0,0 +1,59 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model MerchandiseReturnModel
+@inject OrderSettings orderSettings
+@inject IPermissionService permissionService
+@{
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<admin-tabstrip name="merchandisereturn-edit">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Orders.MerchandiseReturns.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabInfo" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (orderSettings.MerchandiseReturns_AllowToSpecifyPickupAddress)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.MerchandiseReturns.Address"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabAddress" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.MerchandiseReturns.Documents"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.TabDocuments" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/MerchandiseReturnNotes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="4">
+ <content>
+ <div>
+ <div class="form-horizontal">
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="merchandisereturn_details_tabs" additional-data="Model"/>
+ </items>
+</admin-tabstrip>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/MerchandiseReturnNotes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/MerchandiseReturnNotes.cshtml
new file mode 100644
index 000000000..62aeced99
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/MerchandiseReturn/Partials/MerchandiseReturnNotes.cshtml
@@ -0,0 +1,206 @@
+@using Grand.Domain.Media
+@model MerchandiseReturnModel
+@{
+ ViewData["DownloadType"] = DownloadType.MerchandiseReturn;
+ ViewData["ReferenceId"] = Model.Id;
+}
+
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="merchandisereturn_details_notes_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="merchandisereturnnotes-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="merchandisereturn_details_notes_bottom" additional-data="Model"/>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#merchandisereturnnotes-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("MerchandiseReturnNotesSelect", "MerchandiseReturn", new { merchandisereturnId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("MerchandiseReturnNoteDelete", "MerchandiseReturn", new { merchandisereturnId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ //do not implicitly specify all fields
+ //we do it only for fields which implicitly require it
+ //otherwise, they'll be formatted wrong way
+ CreatedOn: {type: "date" }
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.CreatedOn"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "Note",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.Note"]",
+ width: 350,
+ encoded: false
+ }, {
+ field: "DownloadId",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.Download"]",
+ width: 100,
+ template: '# if(DownloadId != "") {# <a href="@Url.Action("DownloadFile", "Download", new { area = Constants.AreaStore })/?downloadGuid=#=DownloadGuid#">@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.Download.Link"]</a> #} else {# @Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.Download.Link.No"] #} #'
+ }, {
+ field: "CreatedByCustomer",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.CreatedByCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(CreatedByCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayToCustomer",
+ title: "@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.Fields.DisplayToCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(DisplayToCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ width: 100
+ }]
+ });
+ });
+</script>
+<p>
+ <strong>
+ @Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.AddTitle"]
+ </strong>
+</p>
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AddMerchandiseReturnNoteHasDownload)").change(toggleAddMerchandiseReturnNoteHasDownload);
+ toggleAddMerchandiseReturnNoteHasDownload();
+ });
+ function toggleAddMerchandiseReturnNoteHasDownload() {
+ if ($('#@Html.IdFor(model => model.AddMerchandiseReturnNoteHasDownload)').is(':checked')) {
+ $('#pnlAddMerchandiseReturnNoteDownloadId').show();
+ }
+ else {
+ $('#pnlAddMerchandiseReturnNoteDownloadId').hide();
+ }
+ }
+
+</script>
+
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AddMerchandiseReturnNoteMessage"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="AddMerchandiseReturnNoteMessage"></admin-textarea>
+ <span asp-validation-for="AddMerchandiseReturnNoteMessage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddMerchandiseReturnNoteDownloadId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddMerchandiseReturnNoteHasDownload"/>
+ <div class="control__indicator"></div>
+ </label>
+ <div id="pnlAddMerchandiseReturnNoteDownloadId">
+ <admin-input asp-for="AddMerchandiseReturnNoteDownloadId"/>
+ <span asp-validation-for="AddMerchandiseReturnNoteDownloadId"></span>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddMerchandiseReturnNoteDisplayToCustomer"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddMerchandiseReturnNoteDisplayToCustomer"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AddMerchandiseReturnNoteDisplayToCustomer"></span>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="offset-md-3 col-md-9 col-sm-9">
+ <button type="button" id="addMerchandiseReturnNote" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Orders.MerchandiseReturns.MerchandiseReturnNotes.AddButton"]</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $('#addMerchandiseReturnNote').click(function () {
+ var merchandisereturnNoteMessage = $("#@Html.IdFor(model => model.AddMerchandiseReturnNoteMessage)").val();
+ if (merchandisereturnNoteMessage.length == 0) {
+ alert('Message text is required');
+ return;
+ }
+ var merchandisereturnNoteDownloadId = '';
+ if ($('#@Html.IdFor(model => model.AddMerchandiseReturnNoteHasDownload)').is(':checked')) {
+ merchandisereturnNoteDownloadId = $("#@Html.IdFor(model => model.AddMerchandiseReturnNoteDownloadId)").val();
+ }
+ var merchandisereturnNoteDisplayToCustomer = $("#@Html.IdFor(model => model.AddMerchandiseReturnNoteDisplayToCustomer)").is(':checked');
+ $('#addMerchandiseReturnNote').attr('disabled', true);
+ var postData = {
+ DisplayToCustomer: merchandisereturnNoteDisplayToCustomer,
+ message: merchandisereturnNoteMessage,
+ downloadId: merchandisereturnNoteDownloadId,
+ merchandisereturnId: '@Model.Id',
+ orderId: '@Model.OrderId'
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache:false,
+ type: "POST",
+ url: "@(Url.Action("MerchandiseReturnNoteAdd", "MerchandiseReturn", new { area = Constants.AreaStore }))",
+ data: postData,
+ success: function (data) {
+ var grid = $("#merchandisereturnnotes-grid").data('kendoGrid');
+ grid.dataSource.read();
+ $('#addMerchandiseReturnNote').attr('disabled', false);
+ },
+ error:function (xhr, ajaxOptions, thrownError){
+ alert('Failed to add merchandise return note.');
+ $('#addMerchandiseReturnNote').attr('disabled', false);
+ }
+ });
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrder.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrder.cshtml
new file mode 100644
index 000000000..d454b6b3a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrder.cshtml
@@ -0,0 +1,178 @@
+@model OrderModel.AddOrderProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = string.Format(Loc["Admin.Orders.Products.AddNew.Title1"], Model.OrderNumber);
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @string.Format(Loc["Admin.Orders.Products.AddNew.Title1"], Model.OrderNumber)
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>
+ @Html.ActionLink(Loc["Admin.Orders.Products.AddNew.BackToOrder"], "Edit", new { id = Model.OrderId })
+ </small>
+ </div>
+ </div>
+ <div class="x_content form">
+ <vc:admin-widget widget-zone="order_add_products_top" additional-data="Model"/>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group popup">
+ <admin-label class="col-sm-2 control-label" asp-for="SearchProductName"/>
+ <div class="col-8 col-md-4 col-sm-4">
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ <div class="col-8 col-md-6 col-sm-4 mt-mobile-10">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button type="button" class="btn btn-default filter-extend-button">
+ <i class="fa fa-filter"></i>
+ </button>
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ <div class="form-group extend-collapse">
+ <admin-label asp-for="SearchCategoryId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group extend-collapse">
+ <admin-label asp-for="SearchBrandId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group extend-collapse">
+ <admin-label asp-for="SearchCollectionId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group extend-collapse">
+ <admin-label asp-for="SearchProductTypeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="order_add_products_bottom" additional-data="Model"/>
+ </div>
+ <div class="x_content">
+ <strong>@Loc["Admin.Orders.Products.AddNew.Note1"]</strong>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ $(document).ready(function () {
+
+ $('.extend-collapse').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-close').toggle();
+ });
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("AddProductToOrder", "Order", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ //selectable
+ selectable: true,
+ change: onChange,
+ columns: [{
+ field: "Name",
+ title: "@Loc["Admin.Orders.Products.AddNew.Name"]",
+ width: 400
+ },{
+ field: "Sku",
+ title: "@Loc["Admin.Orders.Products.AddNew.SKU"]",
+ width: 100
+ }]
+ });
+ });
+</script>
+<script>
+ $(document).ready(function () {
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function onChange(e) {
+ var grid = $('#products-grid').data('kendoGrid');
+ var selectedItem = grid.dataItem(grid.select());
+ var productId = selectedItem.Id;
+ //load "product details page" block
+ var productDetailsActionUrl = '@Html.Raw(Url.Action("AddProductToOrderDetails", "Order", new { orderId = Model.OrderId, productId = "productidplaceholder", area = Constants.AreaStore }))';
+ productDetailsActionUrl = productDetailsActionUrl.replace("productidplaceholder", productId);
+ setLocation(productDetailsActionUrl);
+ }
+</script>
+<div id="productdetails">
+</div>
+<input asp-for="OrderId" type="hidden"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrderDetails.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrderDetails.cshtml
new file mode 100644
index 000000000..e39f7868b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddProductToOrderDetails.cshtml
@@ -0,0 +1,111 @@
+@model OrderModel.AddOrderProductModel.ProductDetailsModel
+@{
+ ViewBag.Title = string.Format(Loc["Admin.Orders.Products.AddNew.Title2"], Model.Name, Model.OrderNumber);
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="AddProductToOrderDetails" asp-route-orderId="@Model.OrderId"
+ asp-route-productId="@Model.ProductId" enctype="multipart/form-data" method="post" id="product-details-form">
+ <div asp-validation-summary="All"></div>
+ <vc:admin-widget widget-zone="order_add_products_details_top" additional-data="Model"/>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @string.Format(Loc["Admin.Orders.Products.AddNew.Title2"], Model.Name, Model.OrderNumber)
+ @Html.ActionLink("(" + Loc["Admin.Orders.Products.AddNew.BackToList"] + ")", "AddProductToOrder", new { orderId = Model.OrderId })
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="offset-md-1 col-md-11 col-sm-11">
+ @if (Model.Warnings.Count > 0)
+ {
+ <div class="note note-danger">
+ @foreach (var warning in Model.Warnings)
+ {
+ @warning
+ <br/>
+ }
+ </div>
+ }
+ </div>
+ @if (Model.ProductType == ProductType.SimpleProduct)
+ {
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="UnitPriceInclTax"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="UnitPriceInclTax"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="UnitPriceExclTax"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="UnitPriceExclTax"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Quantity"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Quantity"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TaxRate"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="TaxRate"/>
+ </div>
+ </div>
+ @{
+ var dataDict = new ViewDataDictionary(ViewData) { new("productId", Model.ProductId) };
+ <partial name="Partials/ProductAddAttributes" model="Model.ProductAttributes" view-data="dataDict"/>
+ }
+ @{
+ var dataDictGiftVoucher = new ViewDataDictionary(ViewData)
+ {
+ TemplateInfo =
+ {
+ HtmlFieldPrefix = "giftvoucher"
+ }
+ };
+ <partial name="Partials/ProductAddGiftVoucherInfo" model="Model.GiftVoucher" view-data="dataDictGiftVoucher"/>
+ }
+ <div class="form-actions">
+ <div class="row">
+ <div class="offset-md-3 col-md-9 col-sm-9">
+ <input type="submit" class="k-button" value="@Loc["Admin.Orders.Products.AddNew"]"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ }
+ else if (Model.ProductType == ProductType.GroupedProduct)
+ {
+ <div>
+ <div class="note note-info">
+ Grouped products are not currently supported for adding to an existing order
+ </div>
+ </div>
+ }
+ else if (Model.ProductType == ProductType.Reservation)
+ {
+ <div>
+ <div class="note note-info">
+ Reservation products are not currently supported for adding to an existing order
+ </div>
+ </div>
+ }
+ else
+ {
+ <div class="note note-info">
+ This product type (unknown) is not currently supported for adding to an existing order
+ </div>
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="order_add_products_details_bottom" additional-data="Model"/>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddressEdit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddressEdit.cshtml
new file mode 100644
index 000000000..7516132fe
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/AddressEdit.cshtml
@@ -0,0 +1,36 @@
+@model OrderAddressModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.Address.EditAddress"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="AddressEdit"
+ asp-route-addressId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["addressId"])"
+ asp-route-billingAddress="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["BillingAddress"])"
+ asp-route-orderId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["orderId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Orders.Address.EditAddress"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>
+ @Html.ActionLink(Loc["Admin.Orders.Address.BackToOrder"], "Edit", new { id = Model.OrderId })
+ </small>
+ </div>
+ <div class="actions">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <vc:admin-widget widget-zone="order_address_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdateAddress" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Edit.cshtml
new file mode 100644
index 000000000..12951625a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Edit.cshtml
@@ -0,0 +1,133 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model OrderModel
+@inject IPermissionService permissionService
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.EditOrderDetails"];
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+ var canManageMessageQueue = await permissionService.Authorize(StandardPermission.ManageMessageQueue);
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="Edit" method="post" id="order-form">
+ <input type="hidden" asp-for="Id"/>
+ <div asp-validation-summary="All"></div>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="icon-basket"></i>
+ @Loc["Admin.Orders.EditOrderDetails"] - @Model.OrderNumber
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Orders.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <a href="@Url.Action("PdfInvoice", new { orderId = Model.Id, area = Constants.AreaStore })" class="btn purple">
+ <i class="fa fa-file-pdf-o"></i> @Loc["Admin.Orders.PdfInvoice"]
+ </a>
+ <span id="order-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <a asp-action="CancelOrder" asp-route-id="@Model.Id" class="btn border-red" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');">
+ <i class="red fa fa-times-circle-o"></i>
+ @Loc["Admin.Common.Cancel"]
+ </a>
+ <input type="submit" id="btnRefreshPage" style="display: none"/>
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshPage').click(function () {
+ //refresh page
+ location.reload();
+ });
+ });
+ </script>
+ <vc:admin-widget widget-zone="order_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <admin-tabstrip name="order-edit" SetTabPos="true" BindGrid="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Orders.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Info" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+
+ <tabstrip-item text="@Loc["Admin.Orders.Addresses"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Addresses" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (Model.IsShippable)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.Shipments"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Shipment" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Orders.Products"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Products" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Orders.OrderNotes"]" tab-index="4">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Notes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.Documents"]" tab-index="5">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Documents" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="6">
+ <content>
+ <div>
+ <div class="form-actions">
+ <input type="submit" value="@Loc["Admin.Common.Save"]" id="btnSaveUserFields" name="save-generic-attributes" asp-action="EditUserFields" class="k-button"/>
+ </div>
+ <div class="form-horizontal">
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageMessageQueue)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.Notifications"]" tab-index="7">
+ <content>
+ <div>
+ <partial name="Partials/OrderDetails.Notifications" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <vc:admin-widget widget-zone="order_details_tabs" additional-data="Model"/>
+ </items>
+ </admin-tabstrip>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="order-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/List.cshtml
new file mode 100644
index 000000000..6237ce585
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/List.cshtml
@@ -0,0 +1,511 @@
+@model OrderListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="List" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="icon-basket"></i>
+ @Loc["Admin.Orders"]
+ </div>
+ <div class="actions btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="submit" name="pdf-invoice-all" asp-action="PdfInvoiceAll" class="btn green">
+ <i class="fa fa-file-pdf-o"></i>
+ @Loc["Admin.Orders.PdfInvoice.All"]
+ </button>
+ <button type="button" id="pdf-invoice-selected" class="btn green">
+ <i class="fa fa-file-pdf-o"></i>
+ @Loc["Admin.Orders.PdfInvoice.Selected"]
+ </button>
+ <button type="button" name="delete-selected" id="delete-selected" class="btn red">
+ <i class="fa fa-trash-o"></i>
+ @Loc["Admin.Common.Delete.Selected"]
+ </button>
+ </div>
+
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-8 col-ms-12 col-12">
+ <div class="row">
+ <div class="col-md-6 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="BillingEmail" class="control-label"/>
+ <admin-input asp-for="BillingEmail"/>
+ </div>
+ </div>
+ <div class="col-md-6 col-sm-12 col-12">
+ <admin-label asp-for="GoDirectlyToNumber" class="control-label"/>
+ <div class="input-group mb-0">
+ <admin-input asp-for="GoDirectlyToNumber"/>
+ <div class="input-group-append">
+ <input type="submit" name="go-to-order-by-number" id="gotoorderbynumber" asp-action="GoToOrderId" class="input-group btn btn-default" value="@Loc["Admin.Common.Go"]"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-orders">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="StartDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderGuid" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OrderGuid"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BillingCountryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BillingCountryId" asp-items="Model.AvailableCountries"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ProductId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <input class="form-control" type="text" id="search-product-name" autocomplete="off"/>
+ <span id="search-product-friendly-name"></span>
+ <input type="button" id="search-product-clear" class="k-button" style="display:none;" value="@Loc["Admin.Common.Clear"]"/>
+ @Html.TextBoxFor(model => model.ProductId, new { autocomplete = "off", style = "display:none;" })
+ <script>
+ $(document).ready(function() {
+ $('#search-product-name').autocomplete({
+ delay: 500,
+ minLength: 3,
+ source: '@(Url.Action("ProductSearchAutoComplete", new { area = Constants.AreaStore }))',
+ select: function(event, ui) {
+ $('#@Html.IdFor(model => model.ProductId)').val(ui.item.productid);
+ $('#search-product-friendly-name').text(ui.item.label);
+
+ $('#search-product-clear').show();
+ return false;
+ }
+ });
+
+ //remove button
+ $('#search-product-clear').click(function () {
+ $('#@Html.IdFor(model => model.ProductId)').val('0');
+ $('#search-product-friendly-name').text('');
+ $('#search-product-clear').hide();
+ return false;
+ });
+ });
+ </script>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BillingLastName" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BillingLastName"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderStatusId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="OrderStatusId" asp-items="Model.AvailableOrderStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShippingStatusId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ShippingStatusId" asp-items="Model.AvailableShippingStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentStatusId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentStatusId" asp-items="Model.AvailablePaymentStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="WarehouseId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="WarehouseId" asp-items="Model.AvailableWarehouses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentMethodSystemName" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentMethodSystemName" asp-items="Model.AvailablePaymentMethods"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderTag" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="OrderTag" asp-items="Model.AvailableOrderTags"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="orders-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+
+ $('.extend-collapse').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-close').toggle();
+ });
+
+
+ $("#orders-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("OrderList", "Order", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Id: { editable: false, type: "string" },
+ CreatedOn: { type: "Date" },
+ StoreName: { editable: false, type: "string" },
+ OrderTotal: { editable: false, type: "string" },
+ OrderStatus: { editable: false, type: "string" },
+ PaymentStatus: { editable: false, type: "string" },
+ ShippingStatus: { editable: false, type: "string" },
+ CustomerEmail: { editable: false, type: "string" },
+ CustomerFullName: { editable: false, type: "string" },
+ OrderStatusId: { editable: false, type: "number" },
+ }
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ dataBound: onDataBound,
+ columns: [
+ {
+ field: "Id",
+ headerTemplate: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input id='mastercheckbox' type='checkbox'/> <div class='control__indicator'></div></label>",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input type='checkbox' value='#=Id#' class='checkboxGroups'/> <div class='control__indicator'></div></label>",
+ width: 40
+ },
+ {
+ field: "OrderNumber",
+ title: "@Loc["Admin.Orders.Fields.Id"]",
+ width: 50,
+ template: '<a class="k-link" href="Edit/#=Id#">#=OrderNumber#</a>'
+ },
+ {
+ field: "OrderStatus",
+ title: "@Loc["Admin.Orders.Fields.OrderStatus"]",
+ width: 120,
+ template: '<h4><a class="k-link orderstatuslist" href="Edit/#=Id#"><span class="label label-' +
+ '# if(OrderStatusId == 10) {#warning #} #' +
+ '# if(OrderStatusId == 20) {#info #} #' +
+ '# if(OrderStatusId == 25) {#info #} #' +
+ '# if(OrderStatusId == 30) {#success #} #' +
+ '# if(OrderStatusId == 40) {#danger #} #' +
+ '# if(OrderStatusId > 40) {#primary #} #' +
+ '">#=OrderStatus#</span></a></h4>'
+ },
+ {
+ field: "PaymentStatus",
+ title: "@Loc["Admin.Orders.Fields.PaymentStatus"]",
+ width: 120,
+ template: '<a class="k-link" href="Edit/#=Id#">#=PaymentStatus#</a>'
+ },
+ {
+ field: "ShippingStatus",
+ title: "@Loc["Admin.Orders.Fields.ShippingStatus"]",
+ width: 120,
+ template: '<a class="k-link" href="Edit/#=Id#">#=ShippingStatus#</a>'
+ },
+ {
+ field: "CustomerEmail",
+ title: "@Loc["Admin.Orders.Fields.Customer"]",
+ width: 220,
+ template: function(dataItem) {
+ return "<a class=\"k-link\" href='@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/" + dataItem.CustomerId + "'>" + kendo.htmlEncode(dataItem.CustomerFullName) + " (" + dataItem.CustomerEmail + ")</a>";
+ }
+ },
+ @if (!adminAreaSettings.HideStoreColumn)
+ {
+ <text>
+ {
+ field: "StoreName",
+ title: "@Loc["Admin.Orders.Fields.Store"]",
+ width: 150,
+ minScreenWidth: 770,
+ },
+ </text>
+ }
+ {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.Fields.CreatedOn"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}",
+
+ },
+ {
+ field: "OrderTotal",
+ title: "@Loc["Admin.Orders.Fields.OrderTotal"]",
+ width: 150,
+ template: '#=OrderTotal#',
+ headerAttributes: { style: "text-align:right" },
+ attributes: { style: "text-align:right" },
+ }
+ ]
+ } );
+ });
+ </script>
+
+ <script>
+
+ var selectedIds = [];
+
+ $(document).ready(function () {
+
+ //search button
+ $('#search-orders').click(function () {
+ //search
+ var grid = $('#orders-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ selectedIds = [];
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.BillingEmail)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+
+ $("#@Html.IdFor(model => model.BillingLastName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+
+ $("#@Html.IdFor(model => model.OrderGuid)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.StartDate)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.EndDate)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+
+ $("#@Html.IdFor(model => model.GoDirectlyToNumber)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#gotoorderbynumber").click();
+ return false;
+ }
+ });
+
+ $("#search-product-name").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-orders").click();
+ return false;
+ }
+ });
+
+ $('#delete-selected').click(function(e) {
+ if (confirm('@Loc["Admin.Common.AreYouSure"]')) {
+
+ var postData = {
+ selectedIds: selectedIds
+ };
+ addAntiForgeryToken(postData);
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("DeleteSelected", "Order", new { area = Constants.AreaStore }))",
+ data: postData,
+ complete: function (data) {
+ //reload grid
+ var grid = $('#orders-grid').data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ alert(thrownError);
+ },
+ traditional: true
+ });
+ }
+ return false;
+ });
+
+ $('#mastercheckbox').click(function () {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ //wire up checkboxes.
+ $('#orders-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function (e) {
+ var $check = $(this);
+ if ($check.is(":checked") == true) {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked == -1) {
+ //add id to selectedIds.
+ selectedIds.push($check.val());
+ }
+ }
+ else {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked > -1) {
+ //remove id from selectedIds.
+ selectedIds = $.grep(selectedIds, function (item, index) {
+ return item != $check.val();
+ });
+ }
+ }
+ updateMasterCheckbox();
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ OrderStatusId: $('#@Html.IdFor(model => model.OrderStatusId)').val(),
+ PaymentStatusId: $('#@Html.IdFor(model => model.PaymentStatusId)').val(),
+ ShippingStatusId: $('#@Html.IdFor(model => model.ShippingStatusId)').val(),
+ WarehouseId: $('#@Html.IdFor(model => model.WarehouseId)').val(),
+ BillingEmail: $('#@Html.IdFor(model => model.BillingEmail)').val(),
+ BillingLastName: $('#@Html.IdFor(model => model.BillingLastName)').val(),
+ BillingCountryId: $('#@Html.IdFor(model => model.BillingCountryId)').val(),
+ PaymentMethodSystemName: $('#@Html.IdFor(model => model.PaymentMethodSystemName)').val(),
+ ProductId: $('#@Html.IdFor(model => model.ProductId)').val(),
+ OrderGuid: $('#@Html.IdFor(model => model.OrderGuid)').val(),
+ GoDirectlyToNumber: $('#@Html.IdFor(model => model.GoDirectlyToNumber)').val(),
+ OrderTag: $('#@Html.IdFor(model => model.OrderTag)').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function onDataBound(e) {
+
+ $('#orders-grid input[type=checkbox][id!=mastercheckbox]').each(function () {
+ var currentId = $(this).val();
+ var checked = jQuery.inArray(currentId, selectedIds);
+ //set checked based on if current checkbox's value is in selectedIds.
+ $(this).prop('checked', checked > -1);
+ });
+
+ updateMasterCheckbox();
+
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#orders-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#orders-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ </script>
+</form>
+<script>
+
+ $(document).ready(function () {
+ $('#exportxml-selected').click(function (e) {
+ e.preventDefault();
+ var ids = selectedIds.join(",");
+ $('#export-xml-selected-form #selectedIds').val(ids);
+ $('#export-xml-selected-form').submit();
+ return false;
+ });
+ });
+
+</script>
+<form asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="PdfInvoiceSelected" method="post" id="pdf-invoice-selected-form">
+
+ <input type="hidden" id="selectedIds" name="selectedIds" value=""/>
+</form>
+
+<script>
+
+ $(document).ready(function () {
+ $('#pdf-invoice-selected').click(function (e) {
+ e.preventDefault();
+ var ids = selectedIds.join(",");
+ $('#pdf-invoice-selected-form #selectedIds').val(ids);
+ $('#pdf-invoice-selected-form').submit();
+ return false;
+ });
+ });
+
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/CreateOrUpdateAddress.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/CreateOrUpdateAddress.cshtml
new file mode 100644
index 000000000..02aab8b36
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/CreateOrUpdateAddress.cshtml
@@ -0,0 +1,5 @@
+@model OrderAddressModel
+<vc:admin-widget widget-zone="order_address_details_top" additional-data="Model"/>
+<div asp-validation-summary="All"></div>
+<admin-input asp-for="Address" asp-template="Address"/>
+<vc:admin-widget widget-zone="order_address_details_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Addresses.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Addresses.cshtml
new file mode 100644
index 000000000..10359b8b4
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Addresses.cshtml
@@ -0,0 +1,437 @@
+@model OrderModel
+<vc:admin-widget widget-zone="order_details_address_top" additional-data="Model"/>
+<div class="card col-md-6">
+ <div class="card-body">
+ <h4 class="card-title">@Loc["Admin.Orders.BillingInfo"]</h4>
+ <p class="card-text">
+ <table class="table table-bordered table-striped table-hover">
+ @if (Model.BillingAddress.FirstNameEnabled || Model.BillingAddress.LastNameEnabled)
+ {
+ <tr>
+ <td style="width:25%">
+ @Loc["Admin.Orders.Address.FullName"]:
+ </td>
+ <td>
+ @Model.BillingAddress.FirstName @Model.BillingAddress.LastName
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.EmailEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Email"]:
+ </td>
+ <td>
+ @Model.BillingAddress.Email
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.PhoneEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Phone"]:
+ </td>
+ <td>
+ @Model.BillingAddress.PhoneNumber
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.FaxEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Fax"]:
+ </td>
+ <td>
+ @Model.BillingAddress.FaxNumber
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.CompanyEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Company"]:
+ </td>
+ <td>
+ @Model.BillingAddress.Company
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.VatNumberEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.VatNumber"]:
+ </td>
+ <td>
+ @Model.BillingAddress.VatNumber
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.StreetAddressEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Address1"]:
+ </td>
+ <td>
+ @Model.BillingAddress.Address1
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.StreetAddress2Enabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Address2"]:
+ </td>
+ <td>
+ @Model.BillingAddress.Address2
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.CityEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.City"]:
+ </td>
+ <td>
+ @Model.BillingAddress.City
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.StateProvinceEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.StateProvince"]:
+ </td>
+ <td>
+ @Model.BillingAddress.StateProvinceName
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.ZipPostalCodeEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.ZipPostalCode"]:
+ </td>
+ <td>
+ @Model.BillingAddress.ZipPostalCode
+ </td>
+ </tr>
+ }
+ @if (Model.BillingAddress.CountryEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Country"]:
+ </td>
+ <td>
+ @Model.BillingAddress.CountryName
+ </td>
+ </tr>
+ }
+ @if (!string.IsNullOrEmpty(Model.BillingAddress.FormattedCustomAddressAttributes))
+ {
+ <tr class="custom-attributes-view">
+ <td colspan="2">
+ @Html.Raw(Model.BillingAddress.FormattedCustomAddressAttributes)
+ </td>
+ </tr>
+ }
+
+ <tr>
+ <td colspan="2">
+ <a href="@Url.Action("AddressEdit", new { addressId = Model.BillingAddress.Id, orderId = Model.Id, BillingAddress = true, area = Constants.AreaStore })" class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Common.Edit"]</a>
+ </td>
+ </tr>
+
+ </table>
+ </p>
+ </div>
+</div>
+
+@if (Model.IsShippable)
+{
+ <div class="card col-md-6">
+ <div class="card-body">
+ <h4 class="card-title">@Loc["Admin.Orders.ShippingInfo"]</h4>
+ <p class="card-text">
+
+ @if (Model.ShippingAddress != null)
+ {
+ <table class="table table-bordered table-striped table-hover">
+ @if (Model.ShippingAddress.FirstNameEnabled || Model.ShippingAddress.LastNameEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.FullName"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.FirstName @Model.ShippingAddress.LastName
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.EmailEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Email"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.Email
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.PhoneEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Phone"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.PhoneNumber
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.FaxEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Fax"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.FaxNumber
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.CompanyEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Company"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.Company
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.StreetAddressEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Address1"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.Address1
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.StreetAddress2Enabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Address2"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.Address2
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.CityEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.City"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.City
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.StateProvinceEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.StateProvince"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.StateProvinceName
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.ZipPostalCodeEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.ZipPostalCode"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.ZipPostalCode
+ </td>
+ </tr>
+ }
+ @if (Model.ShippingAddress.CountryEnabled)
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Country"]:
+ </td>
+ <td>
+ @Model.ShippingAddress.CountryName
+ </td>
+ </tr>
+ }
+ @if (!string.IsNullOrEmpty(Model.ShippingAddress.FormattedCustomAddressAttributes))
+ {
+ <tr class="custom-attributes-view">
+ <td colspan="2">
+ @Html.Raw(Model.ShippingAddress.FormattedCustomAddressAttributes)
+ </td>
+ </tr>
+ }
+
+ <tr>
+ <td colspan="2">
+ <a href="@Url.Action("AddressEdit", new { addressId = Model.ShippingAddress.Id, orderId = Model.Id, area = Constants.AreaStore })" class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Common.Edit"]</a>
+ </td>
+ </tr>
+
+ </table>
+ <div style="padding-top: 15px;">
+ <img alt="google maps" src="@Url.Content($"{Grand.SharedUIResources.Constants.WwwRoot}/administration/build/images/google-maps.gif")"/>
+ <a href="@Html.Raw(Model.ShippingAddressGoogleMapsUrl)" target="_blank">@Loc["Admin.Orders.Fields.ShippingAddress.ViewOnGoogleMaps"]</a>
+ </div>
+ }
+ @if (Model.PickupAddress != null)
+ {
+ <div class="form-group">
+ <admin-label asp-for="PickupAddress"/>
+ <div class="col-md-9 col-sm-9">
+ <table class="table table-bordered table-striped table-hover">
+ @if (!string.IsNullOrEmpty(Model.PickupAddress.Address1))
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Address1"]:
+ </td>
+ <td>
+ @Model.PickupAddress.Address1
+ </td>
+ </tr>
+ }
+ @if (!string.IsNullOrEmpty(Model.PickupAddress.City))
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.City"]:
+ </td>
+ <td>
+ @Model.PickupAddress.City
+ </td>
+ </tr>
+ }
+ @if (!string.IsNullOrEmpty(Model.PickupAddress.ZipPostalCode))
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.ZipPostalCode"]:
+ </td>
+ <td>
+ @Model.PickupAddress.ZipPostalCode
+ </td>
+ </tr>
+ }
+ @if (!string.IsNullOrEmpty(Model.PickupAddress.CountryName))
+ {
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Address.Country"]:
+ </td>
+ <td>
+ @Model.PickupAddress.CountryName
+ </td>
+ </tr>
+ }
+ </table>
+ </div>
+ </div>
+ }
+
+ @if (Model.IsShippable)
+ {
+ <div class="form-horizontal">
+ <div class="form-body">
+
+ <div class="form-group">
+ <admin-label asp-for="ShippingMethod"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label" id="lblShippingMethod">@Model.ShippingMethod</label>
+
+ <script>
+ $(document).ready(function () {
+ toggleEditShippingMethod(false);
+ });
+
+
+ function toggleEditShippingMethod(editmode) {
+ if (editmode) {
+ $('#lblShippingMethod').hide();
+ $('#divShippingMethod').show();
+ $('#btnEditShippingMethod').hide();
+ $('#btnSaveShippingMethod').show();
+ $('#btnCancelShippingMethod').show();
+ } else {
+ $('#lblShippingMethod').show();
+ $('#divShippingMethod').hide();
+ $('#btnEditShippingMethod').show();
+ $('#btnSaveShippingMethod').hide();
+ $('#btnCancelShippingMethod').hide();
+ }
+ }
+
+ </script>
+ <div id="divShippingMethod" style="display: inline-block;">
+ <admin-input asp-for="ShippingMethod"/>
+ </div>
+ <button type="submit" id="btnEditShippingMethod" onclick=" toggleEditShippingMethod(true);return false; " class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Common.Edit"]</button>
+ <input type="submit" value="@Loc["Admin.Common.Save"]" id="btnSaveShippingMethod" asp-action="EditShippingMethod" name="save-shipping-method" class="k-button" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <input type="submit" value="@Loc["Admin.Common.Cancel"]" onclick=" toggleEditShippingMethod(false);return false; " id="btnCancelShippingMethod" class="k-button"/>
+
+ @if (!string.IsNullOrEmpty(Model.ShippingAdditionDescription))
+ {
+ <br/>
+ <label>@Html.Raw(Model.ShippingAdditionDescription)</label>
+ }
+ </div>
+ </div>
+
+ <div class="form-group">
+ <admin-label asp-for="ShippingStatus"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.ShippingStatus</label>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ }
+
+ </p>
+ </div>
+ </div>
+}
+else
+{
+ <div class="card col-md-6">
+ <div class="note note-info">@Loc["Admin.Orders.ShippingInfo.NotRequired"]</div>
+ </div>
+}
+
+<vc:admin-widget widget-zone="order_details_address_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Documents.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Documents.cshtml
new file mode 100644
index 000000000..2a754f08e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Documents.cshtml
@@ -0,0 +1,71 @@
+@model OrderModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="order-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Order, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="order_details_documents_bottom" additional-data="Model"/>
+</div>
+
+<script>
+$(document).ready(function () {
+ $("#order-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Order, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+});
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Info.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Info.cshtml
new file mode 100644
index 000000000..9192a5900
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Info.cshtml
@@ -0,0 +1,545 @@
+@using System.Text.Encodings.Web
+@using Grand.Business.Core.Interfaces.Checkout.Orders
+@using Grand.Domain.Payments
+@using Grand.Domain.Tax
+@using Constants = Grand.SharedUIResources.Constants
+@model OrderModel
+@inject IOrderTagService orderTagService
+
+
+<link rel="stylesheet" type="text/css" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.tag-editor.css"/>
+<script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.tag-editor.min.js"></script>
+<script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.caret.min.js"></script>
+
+@{
+ //tags
+ var orderTags = await orderTagService.GetAllOrderTags();
+ var orderTagsSB = new StringBuilder();
+ orderTagsSB.Append("var initialOrderTags = [");
+ for (var i = 0; i < orderTags.Count; i++)
+ {
+ var tag = orderTags[i];
+ orderTagsSB.Append("'");
+ orderTagsSB.Append(JavaScriptEncoder.Default.Encode(tag.Name));
+ orderTagsSB.Append("'");
+ if (i != orderTags.Count - 1)
+ {
+ orderTagsSB.Append(",");
+ }
+ }
+
+ orderTagsSB.Append("]");
+}
+
+<script>
+ $(document).ready(function() {
+ toggleChangeOrderStatus(false);
+ toggleOrderTotals(false);
+
+ //tags
+ @Html.Raw(orderTagsSB.ToString())
+ $("#@Html.IdFor(model => model.OrderTags)").tagEditor({
+ autocomplete: {
+ delay: 0,
+ position: { collision: 'flip' },
+ source: initialOrderTags
+ },
+ delimiter: ',',
+ placeholder: 'Enter tags...'
+ });
+ });
+
+ function toggleChangeOrderStatus(editmode) {
+ if (editmode) {
+ $('#pnlChangeOrderStatus').show();
+ $('#btnChangeOrderStatus').hide();
+ } else {
+ $('#pnlChangeOrderStatus').hide();
+ $('#btnChangeOrderStatus').show();
+ }
+ }
+
+ function toggleOrderTotals(editmode) {
+ if (editmode) {
+ $('#trEditOrderTotals').show();
+ $('#btnEditOrderTotals').hide();
+ $('#btnSaveOrderTotals').show();
+ $('#btnCancelOrderTotals').show();
+ } else {
+ $('#trEditOrderTotals').hide();
+ $('#btnEditOrderTotals').show();
+ $('#btnSaveOrderTotals').hide();
+ $('#btnCancelOrderTotals').hide();
+ }
+ }
+
+ </script>
+
+<div class="form-horizontal">
+<vc:admin-widget widget-zone="order_details_info_top" additional-data="Model"/>
+<div class="form-body">
+<div class="form-group">
+ <admin-label asp-for="OrderNumber" 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.OrderNumber</label>
+ </div>
+</div>
+
+<div class="form-group order-status-block @Model.OrderStatus">
+ <admin-label asp-for="OrderStatus" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3 pt-2"></admin-label>
+ <div class="col-12 col-md-9 col-sm-9 orderEditBtn">
+ <div class="d-inline-flex w-100 align-items-center mb-3">
+ <div class="alert mb-0">
+ @Model.OrderStatus
+ </div>&nbsp;&nbsp;&nbsp;&nbsp;
+ @if (Model.CanCancelOrder)
+ {
+ <input type="submit" name="cancelorder" asp-action="CancelOrder" value="@Loc["Admin.Orders.Fields.OrderStatus.Cancel"]" id="cancelorder" class="btn red" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');"/>
+ }
+ <input type="submit" name="btnChangeOrderStatus" value="@Loc["Admin.Orders.Fields.OrderStatus.Change"]" onclick="toggleChangeOrderStatus(true);return false;" id="btnChangeOrderStatus" class="btn green"/>
+ </div>
+ <div id="pnlChangeOrderStatus">
+ <div class="note note-info">@Loc["Admin.Orders.Fields.OrderStatus.Change.ForAdvancedUsers"]</div>
+ <admin-select asp-for="OrderStatusId" asp-items="Model.OrderStatuses"/>
+ <div class="form-actions btn-group btn-group-devided mt-3">
+ <input type="submit" name="btnSaveOrderStatus" asp-action="ChangeOrderStatus" value="@Loc["Admin.Common.Save"]" id="btnSaveOrderStatus" class="k-button" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');"/>
+ <input type="submit" name="btnCancelOrderStatus" value="@Loc["Admin.Common.Cancel"]" onclick="toggleChangeOrderStatus(false);return false;" id="btnCancelOrderStatus" class="k-button"/>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="form-group">
+ <admin-label asp-for="ShippingStatus" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-12 col-md-9 col-sm-9">
+ <label class="control-label">
+ @Model.ShippingStatus
+ </label>
+ </div>
+</div>
+
+<div class="form-group">
+ <admin-label asp-for="PaymentStatus" 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">
+ @{
+ var labelStatus = "";
+ switch (Model.PaymentStatusEnum)
+ {
+ case PaymentStatus.Paid:
+ labelStatus = "success";
+ break;
+ case PaymentStatus.PartiallyPaid:
+ labelStatus = "info";
+ break;
+ case PaymentStatus.Pending:
+ labelStatus = "default";
+ break;
+ case PaymentStatus.Authorized:
+ labelStatus = "info";
+ break;
+ case PaymentStatus.PartiallyRefunded:
+ labelStatus = "info";
+ break;
+ case PaymentStatus.Refunded:
+ labelStatus = "warning";
+ break;
+ case PaymentStatus.Voided:
+ labelStatus = "danger";
+ break;
+ }
+ }
+ <div>
+
+ <a class="btn btn-@labelStatus" href="@Url.Action("Edit", "PaymentTransaction", new { id = Model.PaymentTransactionId, area = Grand.Web.Store.Extensions.Constants.AreaStore })">@Model.PaymentStatus - @Loc["Admin.Common.View"]</a>
+
+ </div>
+ </div>
+</div>
+
+<div class="form-group" id="trEditOrderTags">
+ <admin-label asp-for="OrderTags"/>
+ <div class="col-md-9 col-sm-9">
+ <span asp-validation-for="OrderTags"></span>
+ <div class="input-group flex-nowrap w-100">
+ <admin-input asp-for="OrderTags"/>
+ <input type="submit" name="btnSaveOrderTags" asp-action="SaveOrderTags" value="@Loc["Admin.Orders.Fields.SaveOrderTags"]" id="btnSaveOrderTags" class="k-button" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ </div>
+ </div>
+</div>
+
+@if (!string.IsNullOrEmpty(Model.Code))
+{
+ <div class="form-group">
+ <admin-label asp-for="Code" 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.Code</label>
+ </div>
+ </div>
+}
+<div class="form-group">
+ <admin-label asp-for="CurrencyCode" 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.CurrencyCode
+ @if (Model.CurrencyRate != 1)
+ {
+ <text>(@Model.CurrencyRate)</text>
+ }
+ </label>
+ </div>
+</div>
+
+<div class="form-group">
+ <admin-label asp-for="OrderGuid" 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.OrderGuid</label>
+ </div>
+</div>
+
+<div class="form-group">
+ <admin-label asp-for="StoreName" 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.StoreName</label>
+ </div>
+</div>
+
+<div class="form-group">
+ <admin-label asp-for="CustomerId" 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">
+ @Html.ActionLink(Model.CustomerInfo, "Edit", "Customer", new { id = Model.CustomerId }, new { })
+ </label>
+ </div>
+</div>
+<div class="form-group">
+ <admin-label asp-for="CustomerIp" 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.CustomerIp</label>
+ </div>
+</div>
+@if (!string.IsNullOrEmpty(Model.VatNumber))
+{
+ <div class="form-group">
+ <admin-label asp-for="VatNumber" 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.VatNumber</label>
+ </div>
+ </div>
+}
+@if (!string.IsNullOrEmpty(Model.AffiliateId))
+{
+ <div class="form-group">
+ <admin-label asp-for="AffiliateId" 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">
+ <a href="@Url.Action("Edit", "Affiliate", new { id = Model.AffiliateId, area = Grand.Web.Store.Extensions.Constants.AreaStore })">@Model.AffiliateName - @Loc["Admin.Common.View"]</a>
+ </label>
+ </div>
+ </div>
+}
+@if (!string.IsNullOrEmpty(Model.SalesEmployeeId))
+{
+ <div class="form-group">
+ <admin-label asp-for="SalesEmployeeId" 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.SalesEmployeeName</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.IncludingTax)
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderSubtotalInclTax" 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.OrderSubtotalInclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.ExcludingTax)
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderSubtotalExclTax" 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.OrderSubtotalExclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.IncludingTax
+ && !string.IsNullOrEmpty(Model.OrderSubTotalDiscountInclTax))
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderSubTotalDiscountInclTax" 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.OrderSubTotalDiscountInclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.ExcludingTax
+ && !string.IsNullOrEmpty(Model.OrderSubTotalDiscountExclTax))
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderSubTotalDiscountExclTax" 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.OrderSubTotalDiscountExclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.IncludingTax)
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderShippingInclTax" 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.OrderShippingInclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.ExcludingTax)
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderShippingExclTax" 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.OrderShippingExclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.IncludingTax
+ && !string.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeInclTax))
+{
+ <div class="form-group">
+ <admin-label asp-for="PaymentMethodAdditionalFeeInclTax" 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.PaymentMethodAdditionalFeeInclTax</label>
+ </div>
+ </div>
+}
+@if (Model.TaxDisplayType == TaxDisplayType.ExcludingTax
+ && !string.IsNullOrEmpty(Model.PaymentMethodAdditionalFeeExclTax))
+{
+ <div class="form-group">
+ <admin-label asp-for="PaymentMethodAdditionalFeeExclTax" 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.PaymentMethodAdditionalFeeExclTax</label>
+ </div>
+ </div>
+}
+@if (Model.DisplayTaxRates)
+{
+ foreach (var tr in Model.TaxRates)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Tax" 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">@tr.Rate% - @tr.Value</label>
+ </div>
+ </div>
+ }
+}
+@if (Model.DisplayTax)
+{
+ <div class="form-group">
+ <admin-label asp-for="Tax" 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.Tax</label>
+ </div>
+ </div>
+}
+@if (!string.IsNullOrEmpty(Model.OrderTotalDiscount))
+{
+ <div class="form-group">
+ <admin-label asp-for="OrderTotalDiscount" 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.OrderTotalDiscount</label>
+ </div>
+ </div>
+}
+@foreach (var gc in Model.GiftVouchers)
+{
+ <div class="form-group">
+ <admin-label asp-for="GiftVouchers[0].CouponCode" 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">(@(gc.CouponCode))</label>
+ <label class="control-label">@gc.Amount</label>
+ </div>
+ </div>
+}
+@if (Model.RedeemedLoyaltyPoints > 0)
+{
+ <div class="form-group">
+ <admin-label asp-for="RedeemedLoyaltyPoints" 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.RedeemedLoyaltyPoints @Loc["Admin.Orders.Fields.RedeemedLoyaltyPoints.Points"]
+ <text>/</text>
+ @Model.RedeemedLoyaltyPointsAmount
+ </label>
+ </div>
+ </div>
+}
+<div class="form-group">
+ <admin-label asp-for="OrderTotal" 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.OrderTotal</label>
+ </div>
+</div>
+@if (!string.IsNullOrEmpty(Model.RefundedAmount))
+{
+ <div class="form-group">
+ <admin-label asp-for="RefundedAmount" 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.RefundedAmount</label>
+ </div>
+ </div>
+}
+@if (!string.IsNullOrEmpty(Model.SuggestedRefundedAmount))
+{
+ <div class="form-group">
+ <admin-label asp-for="SuggestedRefundedAmount" 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.SuggestedRefundedAmount</label>
+ </div>
+ </div>
+}
+@if (Model.UsedDiscounts.Count > 0)
+{
+ <div class="form-group">
+ <admin-label asp-for="UsedDiscounts" 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">
+ @for (var i = 0; i < Model.UsedDiscounts.Count; i++)
+ {
+ var discount = Model.UsedDiscounts[i];
+ <label class="control-label">
+ <a href="@Url.Action("Edit", "Discount", new { id = discount.DiscountId, area = Grand.Web.Store.Extensions.Constants.AreaStore })">@discount.DiscountName</a>
+ @if (i != Model.UsedDiscounts.Count - 1)
+ {
+ <text>,</text>
+ }
+ </label>
+ }
+ </div>
+ </div>
+}
+<div class="form-group">
+ <admin-label asp-for="Profit" 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.Profit</label>
+ </div>
+</div>
+
+<div class="form-group" id="trEditOrderTotals">
+ <label class="control-label col-md-3"></label>
+ <div class="col-12 col-md-12 col-sm-12">
+ <div class="form-horizontal portlet light bg-inverse form-fit">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="OrderSubtotalInclTaxValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label"> @Loc["Admin.Orders.Fields.Edit.InclTax"] </label>
+ <admin-input asp-for="OrderSubtotalInclTaxValue"/>
+ </div>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label">@Loc["Admin.Orders.Fields.Edit.ExclTax"] </label>
+ <admin-input asp-for="OrderSubtotalExclTaxValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderSubTotalDiscountInclTaxValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label">@Loc["Admin.Orders.Fields.Edit.InclTax"] </label>
+ <admin-input asp-for="OrderSubTotalDiscountInclTaxValue"/>
+ </div>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label">@Loc["Admin.Orders.Fields.Edit.ExclTax"] </label>
+ <admin-input asp-for="OrderSubTotalDiscountExclTaxValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderShippingInclTaxValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label">@Loc["Admin.Orders.Fields.Edit.InclTax"] </label>
+ <admin-input asp-for="OrderShippingInclTaxValue"/>
+ </div>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label">@Loc["Admin.Orders.Fields.Edit.ExclTax"]</label>
+ <admin-input asp-for="OrderShippingExclTaxValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentMethodAdditionalFeeInclTaxValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label"> @Loc["Admin.Orders.Fields.Edit.InclTax"] </label>
+ <admin-input asp-for="PaymentMethodAdditionalFeeInclTaxValue"/>
+ </div>
+ <div class="col-8 col-md-4 col-sm-6">
+ <label class="control-label"> @Loc["Admin.Orders.Fields.Edit.ExclTax"] </label>
+ <admin-input asp-for="PaymentMethodAdditionalFeeExclTaxValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TaxValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-md-8">
+ <admin-input asp-for="TaxValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderTotalDiscountValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-md-8">
+ <admin-input asp-for="OrderTotalDiscountValue"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CurrencyRate" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-md-8">
+ <admin-input asp-for="CurrencyRate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderTotalValue" asp-display-hint="false" class="control-label col-12 col-md-3 col-sm-3"></admin-label>
+ <div class="col-md-8">
+ <admin-input asp-for="OrderTotalValue"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="form-group">
+ <label class="control-label col-md-3"></label>
+ <div class="col-md-9 actions btn-group btn-group-devided">
+ <button type="submit" id="btnEditOrderTotals" onclick=" toggleOrderTotals(true);return false; " name="btnEditOrderTotals" class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Orders.Fields.EditOrderTotals"]</button>
+ <input type="submit" name="btnSaveOrderTotals" asp-action="EditOrderTotals" value="@Loc["Admin.Orders.Fields.SaveOrderTotals"]" id="btnSaveOrderTotals" class="k-button" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <input type="submit" name="btnCancelOrderTotals" value="@Loc["Admin.Orders.Fields.CancelOrderTotals"]" onclick=" toggleOrderTotals(false);return false; " id="btnCancelOrderTotals" class="k-button"/>
+ </div>
+</div>
+<div class="form-group">
+ <admin-label asp-for="PaymentMethod" 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.PaymentMethod</label>
+ </div>
+</div>
+
+@if (Model.CustomValues is { Count: > 0 })
+{
+ <div class="form-group">
+ <admin-label asp-for="CustomValues" 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">
+ <table>
+ @foreach (var item in Model.CustomValues)
+ {
+ <tr>
+ <td>@item.Key:</td>
+ <td>@(item.Value != null ? item.Value.ToString() : "")</td>
+ </tr>
+ }
+ </table>
+ </div>
+ </div>
+}
+<div class="form-group">
+ <admin-label asp-for="CreatedOn" 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"> @Html.DisplayFor(model => model.CreatedOn)</label>
+ </div>
+</div>
+</div>
+<vc:admin-widget widget-zone="order_details_info_bottom" additional-data="Model"/>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notes.cshtml
new file mode 100644
index 000000000..a04d4b4f8
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notes.cshtml
@@ -0,0 +1,205 @@
+@using Grand.Domain.Media
+@model OrderModel
+@{
+ ViewData["DownloadType"] = DownloadType.Order;
+ ViewData["ReferenceId"] = Model.Id;
+}
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_details_notes_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="ordernotes-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="order_details_notes_bottom" additional-data="Model"/>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#ordernotes-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("OrderNotesSelect", "Order", new { orderId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("OrderNoteDelete", "Order", new { orderId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ //do not implicitly specify all fields
+ //we do it only for fields which implicitly require it
+ //otherwise, they'll be formatted wrong way
+ CreatedOn: {type: "date" }
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.OrderNotes.Fields.CreatedOn"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "Note",
+ title: "@Loc["Admin.Orders.OrderNotes.Fields.Note"]",
+ width: 350,
+ encoded: false
+ }, {
+ field: "DownloadId",
+ title: "@Loc["Admin.Orders.OrderNotes.Fields.Download"]",
+ width: 100,
+ template: '# if(DownloadId != "") {# <a href="@Url.Action("DownloadFile", "Download", new { area = Constants.AreaStore })/?downloadGuid=#=DownloadGuid#">@Loc["Admin.Orders.OrderNotes.Fields.Download.Link"]</a> #} else {# @Loc["Admin.Orders.OrderNotes.Fields.Download.Link.No"] #} #'
+ }, {
+ field: "CreatedByCustomer",
+ title: "@Loc["Admin.Orders.OrderNotes.Fields.CreatedByCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(CreatedByCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayToCustomer",
+ title: "@Loc["Admin.Orders.OrderNotes.Fields.DisplayToCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(DisplayToCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ width: 100
+ }]
+ });
+ });
+</script>
+<p>
+ <strong>
+ @Loc["Admin.Orders.OrderNotes.AddTitle"]
+ </strong>
+</p>
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AddOrderNoteHasDownload)").change(toggleAddOrderNoteHasDownload);
+ toggleAddOrderNoteHasDownload();
+ });
+ function toggleAddOrderNoteHasDownload() {
+ if ($('#@Html.IdFor(model => model.AddOrderNoteHasDownload)').is(':checked')) {
+ $('#pnlAddOrderNoteDownloadId').show();
+ }
+ else {
+ $('#pnlAddOrderNoteDownloadId').hide();
+ }
+ }
+
+</script>
+
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AddOrderNoteMessage"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="AddOrderNoteMessage"></admin-textarea>
+ <span asp-validation-for="AddOrderNoteMessage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddOrderNoteDownloadId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddOrderNoteHasDownload"/>
+ <div class="control__indicator"></div>
+ </label>
+ <div id="pnlAddOrderNoteDownloadId">
+ <admin-input asp-for="AddOrderNoteDownloadId"/>
+ <span asp-validation-for="AddOrderNoteDownloadId"></span>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddOrderNoteDisplayToCustomer"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddOrderNoteDisplayToCustomer"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AddOrderNoteDisplayToCustomer"></span>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="offset-md-3 col-md-9 col-sm-9">
+ <button type="button" id="addOrderNote" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Orders.OrderNotes.AddButton"]</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $('#addOrderNote').click(function () {
+ var orderNoteMessage = $("#@Html.IdFor(model => model.AddOrderNoteMessage)").val();
+ if (orderNoteMessage.length == 0) {
+ alert('Message text is required');
+ return;
+ }
+ var orderNoteDownloadId = '';
+ if ($('#@Html.IdFor(model => model.AddOrderNoteHasDownload)').is(':checked')) {
+ orderNoteDownloadId = $("#@Html.IdFor(model => model.AddOrderNoteDownloadId)").val();
+ }
+ var orderNoteDisplayToCustomer = $("#@Html.IdFor(model => model.AddOrderNoteDisplayToCustomer)").is(':checked');
+ $('#addOrderNote').attr('disabled', true);
+ var postData = {
+ DisplayToCustomer: orderNoteDisplayToCustomer,
+ message: orderNoteMessage,
+ downloadId: orderNoteDownloadId,
+ orderId: '@Model.Id'
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache:false,
+ type: "POST",
+ url: "@(Url.Action("OrderNoteAdd", "Order", new { area = Constants.AreaStore }))",
+ data: postData,
+ success: function (data) {
+ var grid = $("#ordernotes-grid").data('kendoGrid');
+ grid.dataSource.read();
+ $('#addOrderNote').attr('disabled', false);
+ },
+ error:function (xhr, ajaxOptions, thrownError){
+ alert('Failed to add order note.');
+ $('#addOrderNote').attr('disabled', false);
+ }
+ });
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notifications.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notifications.cshtml
new file mode 100644
index 000000000..26fd22f38
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Notifications.cshtml
@@ -0,0 +1,72 @@
+@model OrderModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_details_notifications_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="order-notifications-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="order_details_notifications_bottom" additional-data="Model"/>
+</div>
+
+<script>
+$(document).ready(function () {
+ $("#order-notifications-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("QueuedEmailByReference", "QueuedEmail", new { reference = (int)Reference.Order, ObjectId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Subject",
+ title: "@Loc["Admin.System.QueuedEmails.Fields.Subject"]",
+ width: 300,
+ template: '<a class="k-link" href="@Url.Action("Edit", "QueuedEmail")/#=Id#">#=kendo.htmlEncode(Subject)#</a>',
+ }, {
+ field: "To",
+ title: "@Loc["Admin.System.QueuedEmails.Fields.To"]",
+ width: 100
+ }, {
+ field: "CreatedOn",
+ title: "@Loc["Admin.System.QueuedEmails.Fields.CreatedOn"]",
+ width: 100,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "SentOn",
+ title: "@Loc["Admin.System.QueuedEmails.Fields.SentOn"]",
+ width: 100,
+ type: "date",
+ format: "{0:G}"
+ }]
+ });
+});
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Products.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Products.cshtml
new file mode 100644
index 000000000..f0adac689
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Products.cshtml
@@ -0,0 +1,355 @@
+@using Grand.Domain.Tax
+@model OrderModel
+
+<vc:admin-widget widget-zone="order_details_products_top" additional-data="Model"/>
+<div class="table-responsive order-table">
+ <table class="table table-bordered table-striped table-hover">
+ <tr>
+ <td>
+ @foreach (var item in Model.Items)
+ {
+ <script>
+ $(document).ready(function() {
+ toggleOrderItemEdit@(item.Id)(false);
+ });
+ </script>
+
+ <script>
+ function toggleOrderItemEdit@(item.Id) (editMode) {
+ if (editMode) {
+ $('#pnlEditPvUnitPrice@(item.Id)').show();
+ $('#pnlEditPvQuantity@(item.Id)').show();
+ $('#btnEditOrderItem@(item.Id)').hide();
+ $('#btnDeleteOrderItem@(item.Id)').hide();
+ $('#btnSaveOrderItem@(item.Id)').show();
+ $('#btnCancel@(item.Id)').show();
+ $('#btnCancelOrderItem@(item.Id)').hide();
+ }
+ else {
+ $('#pnlEditPvUnitPrice@(item.Id)').hide();
+ $('#pnlEditPvQuantity@(item.Id)').hide();
+ $('#btnEditOrderItem@(item.Id)').show();
+ $('#btnDeleteOrderItem@(item.Id)').show();
+ $('#btnSaveOrderItem@(item.Id)').hide();
+ $('#btnCancel@(item.Id)').hide();
+ $('#btnCancelOrderItem@(item.Id)').show();
+ }
+ }
+ </script>
+ }
+ <table class="table table-bordered table-striped table-hover">
+ <col/>
+ <col/>
+ @if (Model.HasDownloadableProducts)
+ {
+ <col/>
+ }
+ <col/>
+ <col/>
+ <col/>
+ <col/>
+ <col/>
+ <thead>
+ <tr>
+ <th>
+ @Loc["Admin.Orders.Products.Picture"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Products.ProductName"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Products.Price"]
+ </th>
+ <th class="qty-head">
+ @Loc["Admin.Orders.Products.Quantity"]
+ </th>
+ @if (Model.Items.Sum(x => x.DiscountInclTaxValue) > 0)
+ {
+ <th>
+ @Loc["Admin.Orders.Products.Discount"]
+ </th>
+ }
+ @if (Model.Items.Sum(x => x.CommissionValue) > 0)
+ {
+ <th>
+ @Loc["Admin.Orders.Products.Commission"]
+ </th>
+ }
+ <th>
+ @Loc["Admin.Orders.Products.Total"]
+ </th>
+ <th>
+ @Loc["Admin.Common.Edit"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @for (var j = 0; j < Model.Items.Count; j++)
+ {
+ var item = Model.Items[j];
+ <input asp-for="@Model.Items[j].Id" type="hidden"/>
+ <tr>
+ <td>
+ <img src="@item.PictureThumbnailUrl" alt="" title=""/>
+ </td>
+ <td>
+ <div>
+ <em>
+ <a href="@Url.Action("Edit", "Product", new { id = item.ProductId, area = Constants.AreaStore })">@item.ProductName</a>
+ </em>
+ @if (!string.IsNullOrEmpty(item.AttributeInfo))
+ {
+ <p>
+ @Html.Raw(item.AttributeInfo)
+ </p>
+ }
+ @if (!string.IsNullOrEmpty(item.RecurringInfo))
+ {
+ <p>
+ @Html.Raw(item.RecurringInfo)
+ </p>
+ }
+ @if (!string.IsNullOrEmpty(item.RentalInfo))
+ {
+ <p>
+ @Html.Raw(item.RentalInfo)
+ </p>
+ }
+ @if (!string.IsNullOrEmpty(item.Sku))
+ {
+ <p>
+ <strong>@Loc["Admin.Orders.Products.SKU"]</strong><text>:</text>
+ @item.Sku
+ </p>
+ }
+ @if (!string.IsNullOrEmpty(item.VendorName))
+ {
+ <p>
+ <strong>@Loc["Admin.Orders.Products.Vendor"]</strong><text>:</text>
+ @item.VendorName
+ </p>
+ }
+ @if (item.MerchandiseReturnIds.Count > 0)
+ {
+ <p>
+ @Loc["Admin.Orders.Products.MerchandiseReturns"]<text>:</text>
+ @for (var i = 0; i < item.MerchandiseReturnIds.Count; i++)
+ {
+ <a href="@Url.Action("Edit", "MerchandiseReturn", new { id = item.MerchandiseReturnIds[i], area = Constants.AreaStore })" class="k-button"><span class="k-icon k-i-eye"></span>&nbsp;@Loc["Admin.Orders.MerchandiseReturns.View"]</a>
+ if (i != item.MerchandiseReturnIds.Count - 1)
+ {
+ <text>,</text>
+ }
+ }
+ </p>
+ }
+ @if (item.PurchasedGiftVoucherIds.Count > 0)
+ {
+ <p>
+ @Loc["Admin.Orders.Products.GiftVouchers"]<text>:</text>
+ @for (var i = 0; i < item.PurchasedGiftVoucherIds.Count; i++)
+ {
+ <a href="@Url.Action("Edit", "GiftVoucher", new { id = item.PurchasedGiftVoucherIds[i], area = Constants.AreaStore })" class="k-button"><span class="k-icon k-i-eye"></span>&nbsp;@Loc["Admin.Orders.Products.GiftVoucher.View"]</a>
+ if (i != item.PurchasedGiftVoucherIds.Count - 1)
+ {
+ <text>,</text>
+ }
+ }
+ </p>
+ }
+ @if (Model.HasDownloadableProducts)
+ {
+ <p>
+ @if (item.IsDownload)
+ {
+ <div>
+ @string.Format(Loc["Admin.Orders.Products.Download.DownloadCount"], item.DownloadCount)
+ <input type="submit" asp-action="ResetDownloadCount" asp-route-orderItemId="@(item.Id)"
+ name="btnResetDownloadCount@(item.Id)" value="@Loc["Admin.Orders.Products.Download.ResetDownloadCount"]" title="@Loc["Admin.Orders.Products.Download.ResetDownloadCount.Title"]" id="btnResetDownloadCount@(item.Id)" class="k-button"/>
+ <hr/>
+ </div>
+ if (item.DownloadActivationType == DownloadActivationType.Manually)
+ {
+ <div>
+ <input type="submit" name="btnPvActivateDownload@(item.Id)"
+ value="@(item.IsDownloadActivated ? Loc["Admin.Orders.Products.Download.Deactivate"] : Loc["Admin.Orders.Products.Download.Activate"])"
+ id="btnPvActivateDownload@(item.Id)" class="k-button" asp-action="ActivateDownloadItem" asp-route-orderItemId="@(item.Id)"/>
+ <hr/>
+ </div>
+ }
+
+ <div>
+ <strong>
+ @Loc["Admin.Orders.Products.License"]
+ </strong>
+ <br/>
+ @if (item.LicenseDownloadGuid != Guid.Empty)
+ {
+ <a href="@Url.Action("DownloadFile", "Download", new { downloadGuid = item.LicenseDownloadGuid, area = Constants.AreaStore })" class="btn purple">@Loc["Admin.Orders.Products.License.DownloadLicense"]</a>
+ }
+ <br/>
+ <a id="pvlicensefile" name="pvlicensefile" href="@(Url.Action("UploadLicenseFilePopup", "Order", new { id = Model.Id, orderItemId = item.Id, btnId = "btnRefreshPage", formId = "order-form", area = Constants.AreaStore }))" class="k-button">
+ @Loc["Admin.Orders.Products.License.UploadFile"]
+ </a>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $('#pvlicensefile').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
+ }
+ </p>
+ }
+ </div>
+ </td>
+ <td>
+ @switch (Model.TaxDisplayType)
+ {
+ case TaxDisplayType.ExcludingTax:
+ {
+ @item.UnitPriceExclTax
+ }
+ break;
+ case TaxDisplayType.IncludingTax:
+ {
+ @item.UnitPriceInclTax
+ }
+ break;
+ }
+
+ <div id="pnlEditPvUnitPrice@(item.Id)">
+ <table class="order-edit">
+ <tr>
+ <td>
+ @Loc["Admin.Orders.Products.Edit.ExclTax"]
+ </td>
+ <td>
+ @*
+ <input name="pvUnitPriceExclTax@(item.Id)" type="text" value="@item.UnitPriceExclTaxValue" id="pvUnitPriceExclTax@(item.Id)" class="adminInput" style="width:80px;" />
+ *@
+ <input asp-for="@Model.Items[j].UnitPriceExclTaxValue" class="adminInput" style="width:40px;"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ <td>
+ @item.Quantity
+ <div id="pnlEditPvQuantity@(item.Id)">
+ <table class="order-edit">
+ <tr>
+ <td colspan="2">
+ @*
+ <input name="pvQuantity@(item.Id)" type="text" value="@item.Quantity" id="pvQuantity@(item.Id)" class="adminInput" style="width:40px;" />
+ *@
+ <input asp-for="@Model.Items[j].Quantity" class="adminInput" style="width:40px;"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ @if (item.OpenQty > 0)
+ {
+ <div>
+ Open: @item.OpenQty
+ </div>
+ }
+ @if (item.CancelQty > 0)
+ {
+ <div>
+ Canceled: @item.CancelQty
+ </div>
+ }
+ </td>
+ @if (Model.Items.Sum(x => x.DiscountInclTaxValue) > 0)
+ {
+ <td>
+ @switch (Model.TaxDisplayType)
+ {
+ case TaxDisplayType.ExcludingTax:
+ {
+ @item.DiscountExclTax
+ }
+ break;
+ case TaxDisplayType.IncludingTax:
+ {
+ @item.DiscountInclTax
+ }
+ break;
+ }
+
+ </td>
+ }
+ @if (Model.Items.Sum(x => x.CommissionValue) > 0)
+ {
+ <td>
+ <div>@item.Commission</div>
+ </td>
+ }
+ <td>
+
+ @switch (Model.TaxDisplayType)
+ {
+ case TaxDisplayType.ExcludingTax:
+ {
+ @item.SubTotalExclTax
+ }
+ break;
+ case TaxDisplayType.IncludingTax:
+ {
+ @item.SubTotalInclTax
+ }
+ break;
+ }
+
+ </td>
+
+ <td align="center">
+ <div class="btn-group">
+ <button type="submit" name="btnEditOrderItem@(item.Id)" id="btnEditOrderItem@(item.Id)" onclick="toggleOrderItemEdit@(item.Id)(true);return false; " class="k-button" title="@Loc["Admin.Common.Edit"]">
+ <span class="k-icon k-i-edit"></span>
+ </button>
+ <button type="submit" name="btnDeleteOrderItem@(item.Id)" asp-action="DeleteOrderItem" asp-route-orderItemId="@(item.Id)" id="btnDeleteOrderItem@(item.Id)" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button" title="@Loc["Admin.Common.Delete"]">
+ <span class="k-icon k-i-delete"></span>
+ </button>
+ <button type="submit" name="btnCancelOrderItem@(item.Id)" asp-action="CancelOrderItem" asp-route-orderItemId="@(item.Id)" id="btnCancelOrderItem@(item.Id)" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button" title="@Loc["Admin.Common.Cancel"]">
+ <span class="k-icon k-i-cancel"></span>
+ </button>
+ <button type="submit" name="btnSaveOrderItem@(item.Id)" asp-action="SaveOrderItem" asp-route-orderItemId="@(item.Id)" id="btnSaveOrderItem@(item.Id)" style="display:none;" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button" title="@Loc["Admin.Common.Save"]">
+ <span class="k-icon k-i-save"></span>
+ </button>
+ <button type="submit" name="btnCancel@(item.Id)" id="btnCancel@(item.Id)" onclick="toggleOrderItemEdit@(item.Id) (false);return false; " class="k-button">
+ <span class="k-icon k-i-cancel" title="@Loc["Admin.Common.Cancel"]"></span>
+ </button>
+ </div>
+ </td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </table>
+</div>
+<vc:admin-widget widget-zone="order_details_products_bottom" additional-data="Model"/>
+
+@if (!string.IsNullOrEmpty(Model.CheckoutAttributeInfo))
+{
+ <div class="note note-info">
+ @Html.Raw(Model.CheckoutAttributeInfo)
+ </div>
+}
+<div class="form-actions">
+ <button type="submit" id="btnAddNewProduct" name="btnAddNewProduct" onclick=" javascript:setLocation('@(Url.Action("AddProductToOrder", "Order", new { orderId = Model.Id, area = Constants.AreaStore }))'); return false; " class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Orders.Products.AddNew"]</button>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Shipment.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Shipment.cshtml
new file mode 100644
index 000000000..1bac31908
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/OrderDetails.Shipment.cshtml
@@ -0,0 +1,167 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model OrderModel
+@inject IPermissionService permissionService;
+<vc:admin-widget widget-zone="order_details_address_top" additional-data="Model"/>
+@if (Model.IsShippable)
+{
+ @if (await permissionService.Authorize(PermissionSystemName.Shipments))
+ {
+ <div class="card col-md-12">
+ <div class="card-body">
+ <h4 class="card-title">@Loc["Admin.Orders.Shipments"]</h4>
+ <div class="card-text">
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_details_shipping_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="shipments-grid"></div>
+ </div>
+ <div class="panel-footer">
+ @if (Model.CanAddNewShipments)
+ {
+ <button type="submit" id="btnAddNewShipment" name="btnAddNewShipment" onclick="javascript:setLocation('@(Url.Action("AddShipment", "Shipment", new { orderId = Model.Id, area = Constants.AreaStore }))'); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Orders.Shipments.AddNew"]</button>
+ }
+ </div>
+ <vc:admin-widget widget-zone="order_details_shipping_bottom" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ <script>
+ $(document).ready(function () {
+ $("#shipments-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ShipmentsByOrder", "Shipment", new { orderId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ //details grid
+ detailInit: detailInit,
+ scrollable: false,
+ columns: [{
+ field: "ShipmentNumber",
+ title: "@Loc["Admin.Orders.Shipments.ID"]",
+ width: 50,
+ template: '<a class="k-link" href="@Url.Action("ShipmentDetails", "Shipment", new { area = Constants.AreaStore })/#=Id#">#=ShipmentNumber#</a>'
+ }, {
+ field: "TrackingNumber",
+ title: "@Loc["Admin.Orders.Shipments.TrackingNumber"]",
+ width: 100,
+ template: '<a class="k-link" href="@Url.Action("ShipmentDetails", "Shipment", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(TrackingNumber)#</a>'
+ }, {
+ field: "TotalWeight",
+ title: "@Loc["Admin.Orders.Shipments.TotalWeight"]",
+ width: 100
+ }, {
+ field: "ShippedDate",
+ title: "@Loc["Admin.Orders.Shipments.ShippedDate"]",
+ width: 200,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "DeliveryDate",
+ title: "@Loc["Admin.Orders.Shipments.DeliveryDate"]",
+ width: 200,
+ type: "date",
+ format: "{0:G}"
+ }]
+ });
+ });
+
+ //details grid
+ function detailInit(e) {
+ $("<div/>").appendTo(e.detailCell).kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ShipmentsItemsByShipmentId", "Shipment", new { area = Constants.AreaStore }))?shipmentId="+e.data.Id,
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ scrollable: false,
+ sortable: true,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ columns: [
+ {
+ field: "ProductName",
+ title: "@Loc["Admin.Orders.Shipments.Products.ProductName"]",
+ width: 400
+ },{
+ field: "ShippedFromWarehouse",
+ title: "@Loc["Admin.Orders.Shipments.Products.Warehouse"]",
+ width: 150
+ },{
+ field: "QuantityInThisShipment",
+ title: "@Loc["Admin.Orders.Shipments.Products.QtyShipped"]",
+ width: 150
+ },{
+ field: "ItemWeight",
+ title: "@Loc["Admin.Orders.Shipments.Products.ItemWeight"]",
+ width: 150
+ },{
+ field: "ItemDimensions",
+ title: "@Loc["Admin.Orders.Shipments.Products.ItemDimensions"]",
+ width: 150
+ }
+ ]
+ });
+ }
+ </script>
+ }
+}
+else
+{
+ <div class="card col-md-6">
+ <div class="note note-info">@Loc["Admin.Orders.ShippingInfo.NotRequired"]</div>
+ </div>
+}
+
+<vc:admin-widget widget-zone="order_details_address_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddAttributes.cshtml
new file mode 100644
index 000000000..31b110e06
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddAttributes.cshtml
@@ -0,0 +1,96 @@
+@model IList<OrderModel.AddOrderProductModel.ProductAttributeModel>
+@if (Model.Count > 0)
+{
+ foreach (var attribute in Model)
+ {
+ <div class="form-group">
+ @{
+ var controlId = $"attributes[{attribute.Id}]";
+ var textPrompt = !string.IsNullOrEmpty(attribute.TextPrompt) ? attribute.TextPrompt : attribute.Name;
+ }
+ <label class="control-label col-md-3">
+ @textPrompt
+ @if (attribute.IsRequired)
+ {
+ <span class="required">*</span>
+ }
+ </label>
+ <div class="col-md-9 col-sm-9">
+ @switch (attribute.AttributeControlType)
+ {
+ case AttributeControlType.DropdownList:
+ {
+ <select class="form-control" name="@(controlId)" id="@(controlId)">
+ @if (!attribute.IsRequired)
+ {
+ <option value="">---</option>
+ }
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <option selected="@attributeValue.IsPreSelected" value="@attributeValue.Id">
+ @attributeValue.Name
+ </option>
+ }
+ </select>
+ }
+ break;
+ case AttributeControlType.RadioList:
+ case AttributeControlType.ColorSquares:
+ case AttributeControlType.ImageSquares:
+ {
+ <div class="radio-list">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <input id="@(controlId)" type="radio" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected"/>
+ <label for="@(controlId)">@attributeValue.Name</label>
+ </div>
+ }
+ </div>
+ }
+ break;
+ case AttributeControlType.Checkboxes:
+ case AttributeControlType.ReadonlyCheckboxes:
+ {
+ <div class="checkbox-list">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <input id="@(controlId)" type="checkbox" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected" @(attribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ? Html.Raw(" disabled=\"disabled\"") : null)/>
+ <label for="@(controlId)">@attributeValue.Name</label>
+ </div>
+ }
+ </div>
+ }
+ break;
+ case AttributeControlType.TextBox:
+ {
+ <input name="@(controlId)" type="text" id="@(controlId)" class="form-control"/>
+ }
+ break;
+ case AttributeControlType.MultilineTextbox:
+ {
+ <textarea cols="20" id="@(controlId)" name="@(controlId)" rows="2" class="form-control"></textarea>
+ }
+ break;
+ case AttributeControlType.Datepicker:
+ {
+ <date-picker-dropdown control-day="@(controlId + "_day")"
+ control-month="@(controlId + "_month")"
+ control-year="@(controlId + "_year")"
+ begin-year="@(DateTime.Now.Year)"
+ end-year="@(DateTime.Now.Year + 1)"
+ PartialViewName="Partials/DateDropDowns"
+ class="col-12 input-group"/>
+ }
+ break;
+ case AttributeControlType.FileUpload:
+ {
+ <input type="file" id="@(controlId)" name="@(controlId)" class="form-control"/>
+ }
+ break;
+ }
+ </div>
+ </div>
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddGiftVoucherInfo.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddGiftVoucherInfo.cshtml
new file mode 100644
index 000000000..db636bd0e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/Partials/ProductAddGiftVoucherInfo.cshtml
@@ -0,0 +1,42 @@
+@model OrderModel.AddOrderProductModel.GiftVoucherModel
+@if (Model.IsGiftVoucher)
+{
+ <div class="form-group">
+ <div class="form-group">
+ <admin-label asp-for="RecipientName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="RecipientName"/>
+ </div>
+ </div>
+ <div class="form-group">
+ @if (Model.GiftVoucherType == GiftVoucherType.Virtual)
+ {
+ <admin-label asp-for="RecipientEmail"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="RecipientEmail"/>
+ </div>
+ }
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SenderName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SenderName"/>
+ </div>
+ </div>
+ <div class="form-group">
+ @if (Model.GiftVoucherType == GiftVoucherType.Virtual)
+ {
+ <admin-label asp-for="SenderEmail"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SenderEmail"/>
+ </div>
+ }
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Message"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="Message"></admin-textarea>
+ </div>
+ </div>
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Order/UploadLicenseFilePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/UploadLicenseFilePopup.cshtml
new file mode 100644
index 000000000..3b6571398
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Order/UploadLicenseFilePopup.cshtml
@@ -0,0 +1,64 @@
+@model OrderModel.UploadLicenseModel
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.Products.License.UploadFile"];
+}
+<form id="UploadLicenseFilePopup" asp-area="@Constants.AreaStore" asp-controller="Order" asp-action="UploadLicenseFilePopup" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-comment"></i>
+ @Loc["Admin.Orders.Products.License.UploadFile"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <input type="submit" name="uploadlicense" value="@Loc["Admin.Common.Save"]" id="uploadlicense" class="btn green"/>
+ @if (!string.IsNullOrEmpty(Model.LicenseDownloadId))
+ {
+ <input type="submit" name="deletelicense" asp-action="DeleteLicenseFilePopup" value="@Loc["Admin.Common.Delete"]" id="deletelicense" class="btn red"/>
+ }
+ </div>
+ <vc:admin-widget widget-zone="order_upload_license_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div asp-validation-summary="All"></div>
+ @if (ViewBag.RefreshPage == true)
+ {
+ <script>
+ try {
+ window.location.href = window.location.href;
+ }
+ catch (e){}
+ </script>
+ }
+
+ <input asp-for="OrderId" type="hidden"/>
+ <input asp-for="OrderItemId" type="hidden"/>
+ <admin-input asp-for="LicenseDownloadId"/>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#UploadLicenseFilePopup").submit(function (e) {
+ e.preventDefault();
+ var url;
+ var form = $(this);
+ if (e.originalEvent.submitter.id == "deletelicense") {
+ url = e.originalEvent.submitter.getAttribute('formaction');
+ } else {
+ url = form.attr('action');
+ }
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ window.location.href = window.location.href;
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Edit.cshtml
new file mode 100644
index 000000000..bbb1f63db
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Edit.cshtml
@@ -0,0 +1,145 @@
+@model PaymentTransactionModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.PaymentTransaction.Details"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="PaymentTransaction" asp-action="Edit" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.PaymentTransaction.Details"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i> @Html.ActionLink(Loc["Admin.Orders.PaymentTransaction.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ @if (Model.CanCapture)
+ {
+ <input type="submit" name="capturepaymenttransaction" asp-action="CapturePaymentTransaction" value="@Loc["Admin.PaymentTransaction.Fields.Capture"]"
+ id="capturepaymenttransaction" class="k-button" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanMarkAsPaid)
+ {
+ <button type="submit" id="markpaymenttransactionaspaid" name="markpaymenttransactionaspaid" asp-action="MarkPaymentTransactionAsPaid"
+ onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button">
+ <i class="fa fa-money" aria-hidden="true"></i>&nbsp;@Loc["Admin.PaymentTransaction.Fields.MarkAsPaid"]
+ </button>
+ }
+ @if (Model.CanPartiallyPaidOffline)
+ {
+ <a id="partiallypaidpaymenttransactionoffline" name="partiallypaidpaymenttransactionoffline"
+ href="@(Url.Action("PartiallyPaidPopup", "PaymentTransaction", new { id = Model.Id, online = false, btnId = "btnRefreshPage", formId = "order-form", area = Constants.AreaStore }))"
+ class="k-button">
+ @Loc["Admin.PaymentTransaction.Fields.PartialPaidOffline"]
+ </a>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanRefund)
+ {
+ <input type="submit" name="refundpaymenttransaction" asp-action="RefundPaymentTransaction" value="@Loc["Admin.PaymentTransaction.Fields.Refund"]" id="refundpaymenttransaction"
+ class="k-button" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanRefundOffline)
+ {
+ <input type="submit" name="refundpaymenttransactionoffline" asp-action="RefundPaymentTransactionOffline" value="@Loc["Admin.PaymentTransaction.Fields.RefundOffline"]"
+ id="refundpaymenttransactionoffline" class="k-button" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanPartiallyRefund)
+ {
+ <a id="partiallyrefundpaymenttransaction" name="partiallyrefundpaymenttransaction"
+ value="@Loc["Admin.PaymentTransaction.Fields.PartialRefund"]"
+ href="@(Url.Action("PartiallyRefundPopup", "PaymentTransaction", new { id = Model.Id, online = true, btnId = "btnRefreshPage", formId = "order-form", area = Constants.AreaStore }))"
+ class="k-button">
+ @Loc["Admin.PaymentTransaction.Fields.PartialRefund"]
+ </a>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanPartiallyRefundOffline)
+ {
+ <a id="partiallyrefundpaymenttransactionoffline" name="partiallyrefundpaymenttransactionoffline"
+ href="@(Url.Action("PartiallyRefundPopup", "PaymentTransaction", new { id = Model.Id, online = false, btnId = "btnRefreshPage", formId = "order-form", area = Constants.AreaStore }))"
+ class="k-button">
+ @Loc["Admin.PaymentTransaction.Fields.PartialRefundOffline"]
+ </a>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanVoid)
+ {
+ <input type="submit" name="voidpaymenttransaction" asp-action="VoidPaymentTransaction"
+ value="@Loc["Admin.Orders.Fields.Void"]" id="voidpaymenttransaction" class="k-button"
+ onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <text>&nbsp;</text>
+ }
+ @if (Model.CanVoidOffline)
+ {
+ <input type="submit" name="voidpaymenttransactionoffline" asp-action="VoidPaymentTransactionOffline"
+ value="@Loc["Admin.PaymentTransaction.Fields.VoidOffline"]" id="voidpaymenttransactionoffline" class="k-button"
+ onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); "/>
+ <text>&nbsp;</text>
+ }
+ <span id="paymenttransaction-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="payment_transaction_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/Update" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $('#partiallypaidpaymenttransactionoffline').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $('#partiallyrefundpaymenttransaction').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $('#partiallyrefundpaymenttransactionoffline').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
+</form>
+<admin-delete-confirmation button-id="paymenttransaction-delete"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/List.cshtml
new file mode 100644
index 000000000..069bb29b3
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/List.cshtml
@@ -0,0 +1,202 @@
+@model PaymentTransactionListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.PaymentTransaction"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="PaymentTransaction" asp-action="List" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.PaymentTransaction"]
+ </div>
+ <vc:admin-widget widget-zone="payment_transaction_list_buttons" additional-data="null"/>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchCustomerEmail" class="control-label"/>
+ <admin-input asp-for="SearchCustomerEmail"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="OrderNumber" class="control-label"/>
+ <div class="input-group mb-0" style="text-align:left">
+ <admin-input asp-for="OrderNumber"/>
+ <span class="input-group-append">
+ <input type="submit" id="go-to-ordernumber" asp-action="GoToOrderNumber" name="go-to-ordernumber" class="btn default" value="@Loc["Admin.Common.Go"]"/>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-paymenttransaction">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="StartDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchTransactionStatus" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchTransactionStatus" asp-items="Model.PaymentTransactionStatus"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="x_content">
+ <div id="paymenttransactions-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+<script>
+ $(document).ready(function() {
+ $("#paymenttransactions-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("List", "PaymentTransaction", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "PaymentMethodSystemName",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.PaymentMethodSystemName"]",
+ width: 80,
+ template: '<a class="k-link" href="Edit/#=Id#">#=PaymentMethodSystemName#</a>'
+ }, {
+ field: "TransactionAmount",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.TransactionAmount"]",
+ width: 80,
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.toString(TransactionAmount, "n2")# #=CurrencyCode#</a>'
+ }, {
+ field: "PaidAmount",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.PaidAmount"]",
+ width: 100,
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.toString(PaidAmount, "n2")# #=CurrencyCode#</a>'
+ }, {
+ field: "CustomerId",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.Customer"]",
+ width: 200,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:kendo.htmlEncode(CustomerEmail)#</a>'
+ }, {
+ field: "OrderNumber",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.OrderNumber"]",
+ width: 80,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#">#:OrderNumber#</a>'
+ }, {
+ field: "Status",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.Status"]",
+ width: 130,
+ template: '<a class="k-link" href="Edit/#=Id#">#=Status#</a>'
+ }, {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.PaymentTransaction.Fields.CreatedOn"]",
+ width: 100,
+ type: "date",
+ format: "{0:G}"
+ }
+ ]
+ });
+ });
+</script>
+
+<script>
+ function additionalData() {
+ var data = {
+ SearchTransactionStatus: $('#@Html.IdFor(model => model.SearchTransactionStatus)').val(),
+ SearchCustomerEmail: $('#@Html.IdFor(model => model.SearchCustomerEmail)').val(),
+ OrderNumber: $('#@Html.IdFor(model => model.OrderNumber)').val(),
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ $(document).ready(function () {
+ $('#search-paymenttransaction').click(function () {
+ //search
+ var grid = $('#paymenttransactions-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchCustomerEmail)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-paymenttransaction").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.OrderNumber)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#go-to-ordernumber").click();
+ return false;
+ }
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyPaidPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyPaidPopup.cshtml
new file mode 100644
index 000000000..0cbacceda
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyPaidPopup.cshtml
@@ -0,0 +1,79 @@
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.PaymentTransaction.Fields.PartialPaid"];
+}
+@model PaymentTransactionModel
+<form id="PartiallyPaidPopup" asp-area="@Constants.AreaStore" asp-controller="PaymentTransaction" asp-action="PartiallyPaidPopup" method="post"
+ asp-route-OrderId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-online="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["online"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <input asp-for="Id" type="hidden"/>
+ <input asp-for="MaxAmountToPaid" type="hidden"/>
+ <input asp-for="CurrencyCode" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-tag"></i>
+ @Loc["Admin.PaymentTransaction.Fields.PartialPaid"]
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="payment_transaction_partially_paid_buttons" additional-data="Model"/>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AmountToPaid"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AmountToPaid"/> &nbsp;
+ <span style="white-space: nowrap">
+ @string.Format(Loc["Admin.PaymentTransaction.Fields.PartialPaid.AmountToPaid.Max"], Model.MaxAmountToPaid.ToString("N2"), Model.CurrencyCode)
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="form-actions">
+ <input type="submit" name="partialpaidpaymenttransaction" value="@Loc["Admin.PaymentTransaction.Fields.Paid"]" id="partialpaidpaymenttransaction" class="btn default"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div asp-validation-summary="All"></div>
+ @if (ViewBag.RefreshPage == true)
+ {
+ <script>
+ try {
+ window.location.href = window.location.href;
+ }
+ catch (e) { }
+ </script>
+ }
+ <script>
+ $("#PartiallyPaidPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ }
+ });
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyRefundPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyRefundPopup.cshtml
new file mode 100644
index 000000000..c1afd93e7
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/PartiallyRefundPopup.cshtml
@@ -0,0 +1,80 @@
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.PaymentTransaction.Fields.PartialRefund"];
+}
+@model PaymentTransactionModel
+<form id="PartiallyRefundPopup" asp-area="@Constants.AreaStore" asp-controller="PaymentTransaction" asp-action="PartiallyRefundPopup" method="post"
+ asp-route-OrderId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-online="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["online"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <input asp-for="Id" type="hidden"/>
+ <input asp-for="MaxAmountToRefund" type="hidden"/>
+ <input asp-for="CurrencyCode" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-tag"></i>
+ @Loc["Admin.PaymentTransaction.Fields.PartialRefund"]
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="payment_transaction_partially_refund_buttons" additional-data="Model"/>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AmountToRefund"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AmountToRefund"/> &nbsp;
+ <span style="white-space: nowrap">
+ @string.Format(Loc["Admin.PaymentTransaction.Fields.PartialRefund.AmountToRefund.Max"], Model.MaxAmountToRefund.ToString("G29"), Model.CurrencyCode)
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="form-actions">
+ <input type="submit" name="partialrefundpaymenttransaction" asp-action="PartiallyRefundPopup" value="@Loc["Admin.PaymentTransaction.Fields.Refund"]" id="partialrefundpaymenttransaction" class="btn default"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div asp-validation-summary="All"></div>
+ @if (ViewBag.RefreshPage == true)
+ {
+ <script>
+ try {
+ window.location.href = window.location.href;
+ }
+ catch (e) { }
+ </script>
+ }
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#PartiallyRefundPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ }
+ });
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Partials/Update.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Partials/Update.cshtml
new file mode 100644
index 000000000..47718e874
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/PaymentTransaction/Partials/Update.cshtml
@@ -0,0 +1,135 @@
+@model PaymentTransactionModel
+
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="payment_transaction_details_top" additional-data="Model"/>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="PaymentMethodSystemName"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.PaymentMethodSystemName</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Status"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.Status</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TransactionAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.TransactionAmount [@Model.CurrencyCode]</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaidAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.PaidAmount [@Model.CurrencyCode]</label>
+ </div>
+ </div>
+ @if (Model.RefundedAmount > 0)
+ {
+ <div class="form-group">
+ <admin-label asp-for="RefundedAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.RefundedAmount [@Model.CurrencyCode]</label>
+ </div>
+ </div>
+ }
+ <div class="form-group">
+ <admin-label asp-for="CustomerId" 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">
+ @Html.ActionLink(Model.CustomerEmail, "Edit", "Customer", new { id = Model.CustomerId }, new { })
+ </label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderId" 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">
+ @Html.ActionLink(Model.OrderNumber.ToString(), "Edit", "Order", new { id = Model.OrderId }, new { })
+ </label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CreatedOn" 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"> @Html.DisplayFor(model => model.CreatedOn)</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IPAddress" 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.IPAddress</label>
+ </div>
+ </div>
+ @if (!string.IsNullOrEmpty(Model.AdditionalInfo))
+ {
+ <div class="form-group">
+ <admin-label asp-for="AdditionalInfo" 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.AdditionalInfo</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.Description))
+ {
+ <div class="form-group">
+ <admin-label asp-for="Description" 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.Description</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.CaptureTransactionId))
+ {
+ <div class="form-group">
+ <admin-label asp-for="CaptureTransactionId" 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.CaptureTransactionId</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.CaptureTransactionResult))
+ {
+ <div class="form-group">
+ <admin-label asp-for="CaptureTransactionResult" 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.CaptureTransactionResult</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.AuthorizationTransactionId))
+ {
+ <div class="form-group">
+ <admin-label asp-for="AuthorizationTransactionId" 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.AuthorizationTransactionId</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.AuthorizationTransactionCode))
+ {
+ <div class="form-group">
+ <admin-label asp-for="AuthorizationTransactionCode" 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.AuthorizationTransactionCode</label>
+ </div>
+ </div>
+ }
+ @if (!string.IsNullOrEmpty(Model.AuthorizationTransactionResult))
+ {
+ <div class="form-group">
+ <admin-label asp-for="AuthorizationTransactionResult" 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.AuthorizationTransactionResult</label>
+ </div>
+ </div>
+ }
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociateProductToAttributeValuePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociateProductToAttributeValuePopup.cshtml
new file mode 100644
index 000000000..22cf8fa00
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociateProductToAttributeValuePopup.cshtml
@@ -0,0 +1,207 @@
+@model ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"];
+}
+
+<form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="AssociateProductToAttributeValuePopup"
+ asp-route-productIdInput="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["productIdInput"])"
+ asp-route-productNameInput="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["productNameInput"])" id="associateproduct">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <input asp-for="AssociatedToProductId" type="hidden"/>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#associateproduct").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ var productId = $("#@Html.IdFor(model => model.AssociatedToProductId)").val();
+ var productName = $("#@Html.IdFor(model => model.AssociatedToProductId)").data("name");
+ var id = $('.btnProductAttributeValueEditPopup.active').data("id");
+ var button = $('.btnProductAttributeValueEditPopup[data-id="' + id + '"]');
+ var mfp = $('.mfp-wrap');
+
+ mfp.attr("data-id", id);
+ mfp.attr("data-prodid", productId);
+ mfp.attr("data-prodname", productName);
+
+ $('.btnProductAttributeValueEditPopup.active').removeClass('active');
+
+ button.click();
+
+ } else {
+ $.magnificPopup.instance.currItem.src = data;
+ $.magnificPopup.instance.updateItemHTML();
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function selectAssociatedProduct(productid, productname) {
+ $("#@Html.IdFor(model => model.AssociatedToProductId)").val(productid);
+ $("#@Html.IdFor(model => model.AssociatedToProductId)").attr("data-name", productname);
+ $('#associateproduct').submit();
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("AssociateProductToAttributeValuePopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Name: { editable: false, type: "string" },
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Name",
+ title: "@Loc["Admin.Common.Select"]",
+ width: 50,
+ template: '<input type="button" value="@Loc["Admin.Common.Select"]" onclick="selectAssociatedProduct(\'#=Id#\',\'#=Name#\')" class="k-button" />'
+ },{
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociatedProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociatedProductAddPopup.cshtml
new file mode 100644
index 000000000..fb283c0d9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AssociatedProductAddPopup.cshtml
@@ -0,0 +1,223 @@
+@model ProductModel.AddAssociatedProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"];
+}
+
+<form id="AssociatedProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="AssociatedProductAddPopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#AssociatedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshAssociatedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ $('.extend-collapse').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-close').toggle();
+ });
+
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("AssociatedProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: {
+ style: "text-align:center"
+ },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]",
+ template: "#:Name# # if(AssociatedToProductName !== null) {# <br /><i>@Loc["Admin.Catalog.Products.Fields.AssociatedToProductName"]: #:AssociatedToProductName#</i> #} #"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AttributeCombinationPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AttributeCombinationPopup.cshtml
new file mode 100644
index 000000000..bda884bbf
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/AttributeCombinationPopup.cshtml
@@ -0,0 +1,476 @@
+@using System.Text.Encodings.Web
+@using Grand.Business.Core.Interfaces.Common.Directory
+@using Grand.Business.Core.Interfaces.Common.Stores
+@model ProductAttributeCombinationModel
+@inject IStoreService _storeService
+@inject IGroupService _groupService
+@{
+ Layout = "";
+ ViewBag.Title = string.IsNullOrEmpty(Model.Id) ? Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddTitle"] : Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Update"];
+}
+<form id="AttributeCombinationPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="AttributeCombinationPopup" enctype="multipart/form-data"
+ asp-route-productId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["productId"])"
+ asp-route-Id="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<input asp-for="ProductId" type="hidden"/>
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @if (string.IsNullOrEmpty(Model.Id))
+ {
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddTitle"]
+ }
+ else
+ {
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Update"]
+ }
+ </div>
+ </div>
+ <div class="x_content">
+ <div class="form-horizontal">
+ <div class="form-body">
+ @if (Model.Warnings.Count > 0)
+ {
+ <div class="message-box message-box-error">
+ @foreach (var warning in Model.Warnings)
+ {
+ @warning
+ <br/>
+ }
+ </div>
+ }
+ @if (string.IsNullOrEmpty(Model.Id))
+ {
+ <partial name="Partials/ProductAttributes" model="Model.ProductAttributes"/>
+ }
+ else
+ {
+ <div class="form-group">
+ <label class="control-label col-sm-3">
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Attributes"]
+ </label>
+ <div class="col-md-9 col-sm-9">
+ <text>@Html.Raw(Model.Attributes)</text>
+ </div>
+ </div>
+ }
+ <br/>
+ </div>
+ </div>
+ <div class="form-horizontal">
+ <div class="form-body">
+ @if (!Model.UseMultipleWarehouses)
+ {
+ <div class="form-group">
+ <admin-label asp-for="StockQuantity" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StockQuantity"/>
+ <span asp-validation-for="StockQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ReservedQuantity" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ReservedQuantity"/>
+ <span asp-validation-for="ReservedQuantity"></span>
+ </div>
+ </div>
+ }
+ else
+ {
+ <div class="form-group" id="pnlMultipleWarehouses">
+
+ <div class="col-md-9 col-sm-9">
+ @if (Model.WarehouseInventoryModels.Count > 0)
+ {
+ <table style="width: 600px; border-collapse: collapse;">
+ <thead>
+ <tr>
+ <th>
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.WarehouseUsed"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.StockQuantity"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.ReservedQuantity"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @for (var i = 0; i < Model.WarehouseInventoryModels.Count; i++)
+ {
+ var item = Model.WarehouseInventoryModels[i];
+ <tr style="height:40px;">
+ <td style="width: 35%;">
+ <div style="padding-left: 5px; padding-right: 5px;">
+ @item.WarehouseName
+ <input asp-for="@Model.WarehouseInventoryModels[i].WarehouseId" type="hidden"/>
+ </div>
+ </td>
+ <td align="center" style="width: 10%;">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="@Model.WarehouseInventoryModels[i].WarehouseUsed"/>
+ <div class="control__indicator"></div>
+ </label>
+ <td align="center" style="width: 20%;">
+ <admin-input asp-for="@Model.WarehouseInventoryModels[i].StockQuantity"/>
+ </td>
+ <td align="center" style="width: 20%;">
+ <admin-input asp-for="@Model.WarehouseInventoryModels[i].ReservedQuantity"/>
+ </td>
+
+ </tr>
+ }
+ </tbody>
+ </table>
+ }
+ else
+ {
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse.NotDefined"]
+ }
+ </div>
+ </div>
+ }
+ <div class="form-group">
+ <admin-label asp-for="AllowOutOfStockOrders" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowOutOfStockOrders"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowOutOfStockOrders"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Text" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Text"/>
+ <span asp-validation-for="Text"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Sku" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Sku"/>
+ <span asp-validation-for="Sku"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Mpn" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Mpn"/>
+ <span asp-validation-for="Mpn"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Gtin" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Gtin"/>
+ <span asp-validation-for="Gtin"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OverriddenPrice" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OverriddenPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="OverriddenPrice"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="NotifyAdminForQuantityBelow" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="NotifyAdminForQuantityBelow"/>
+ <span asp-validation-for="NotifyAdminForQuantityBelow"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PictureId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <ul style="list-style: none;">
+ <li style="float: left; width: 110px;">
+ <p style="float: left; padding-top: 20px;">
+ <input type="radio" name="@Html.NameFor(x => x.PictureId)" value="0" id="id_image_0"
+ @if (!string.IsNullOrEmpty(Model.PictureId))
+ {
+ <text> checked="checked" </text>
+ }>
+ </p>
+ <p style="float: left; padding-top: 20px;">
+ <label for="id_image_0">
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Picture.NoPicture"]
+ </label>
+ </p>
+ </li>
+ @foreach (var picture in Model.ProductPictureModels)
+ {
+ <li style="float: left; width: 110px;">
+ <p style="float: left; padding-top: 20px;">
+ <input type="radio" name="@Html.NameFor(x => x.PictureId)" value="@picture.PictureId" id="[email protected]"
+ @if (picture.PictureId == Model.PictureId)
+ {
+ <text> checked="checked" </text>
+ }>
+ </p>
+ <p style="float: left;">
+ <label for="[email protected]">
+ <img src="@picture.PictureUrl" alt="" title="" width="75">
+ </label>
+ </p>
+ </li>
+ }
+ </ul>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <vc:admin-widget widget-zone="product_details_attribute_combination_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ @if (!string.IsNullOrEmpty(Model.Id))
+ {
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices"] [@Model.PrimaryStoreCurrencyCode]
+ </div>
+ <div class="panel-body">
+ <div id="tierprices-grid"></div>
+ </div>
+ </div>
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ var mfp = $.magnificPopup.instance;
+ $("#AttributeCombinationPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshCombinations').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <script>
+ //local datasource
+ var allStores = [
+ {
+ Id : ' ',
+ Name : "@Loc["Admin.Settings.AllSettings.Fields.StoreName.AllStores"]"
+ }
+ @{
+ var allStores = await _storeService.GetAllStores();
+ }
+ @foreach (var store in allStores)
+ {
+ <text>
+ , {
+ Id: "@(store.Id)",
+ Name: "@(Html.Raw(JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(store.Shortcut) ? "" : store.Shortcut)))"
+ }
+ </text>
+ }
+
+ ];
+
+ var allCustomerGroups = [
+ {
+ Id : ' ',
+ Name : "@Loc["Admin.Catalog.Products.TierPrices.Fields.CustomerGroup.All"]"
+ }
+ @{
+ var allCustomerGroups = await _groupService.GetAllCustomerGroups(showHidden: true);
+ }
+ @foreach (var customerGroup in allCustomerGroups)
+ {
+ <text>
+ , {
+ Id: "@(customerGroup.Id)",
+ Name: "@(Html.Raw(JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(customerGroup.Name) ? "" : customerGroup.Name))))"
+ }
+ </text>
+ }
+ ];
+
+ function storeDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:StoreId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autoBind: true,
+ dataSource: allStores,
+ });
+ }
+
+ function customerGroupDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CustomerGroupId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autoBind: true,
+ dataSource: allCustomerGroups,
+
+ });
+ }
+
+ $("#tierprices-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceList", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ create: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceInsert", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceUpdate", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceDelete", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Store: { editable: true, type: "string" },
+ StoreId: { editable: true, type: "string" },
+ CustomerGroup: { editable: true, type: "string" },
+ CustomerGroupId: { editable: true, type: "string" },
+ Quantity: { editable: true, type: "number" },
+ Price: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "StoreId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Store"]",
+ width: 250,
+ editor: storeDropDownEditor,
+ template: "#:Store#"
+ },
+ {
+ field: "CustomerGroupId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.CustomerGroup"]",
+ width: 250,
+ editor: customerGroupDropDownEditor,
+ template: "#:CustomerGroup#"
+ },
+
+ {
+ field: "Quantity",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Quantity"]",
+ width: 150,
+ format: "{0:0}"
+ }, {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Price"]",
+ width: 150,
+ editor: function (container, options) {
+ $('<input name="' + options.field + '"/>')
+ .appendTo(container)
+ .kendoNumericTextBox({
+ format: "{0:n4}",
+ decimals: 4
+ });
+ }
+ },{
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
+
+ </script>
+}
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BulkEdit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BulkEdit.cshtml
new file mode 100644
index 000000000..49e251ba9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BulkEdit.cshtml
@@ -0,0 +1,299 @@
+@model BulkEditListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.BulkEdit"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="BulkEdit" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.BulkEdit"]
+ </div>
+ <vc:admin-widget widget-zone="product_bulk_edit_buttons" additional-data="null"/>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-8 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ @{
+ var methods = EnumTranslationService.ToSelectList(ManageInventoryMethod.DontManageStock);
+ }
+ var allInventoryMethod = [
+ @foreach (var method in methods)
+ {
+ <text>
+ {
+ Id: '@(method.Value)',
+ Name: "@Html.Raw(method.Text)"
+ },
+ </text>
+ }
+ ];
+
+ $(document).ready(function() {
+ var _grid = $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BulkEditSelect", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ },
+ update: {
+ url: "@Html.Raw(Url.Action("BulkEditUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json"
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("BulkEditDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json"
+ },
+ parameterMap: function(data, operation) {
+ if (operation != "read") {
+
+ var result = {};
+
+ for (var i = 0; i < data.models.length; i++) {
+ var entity = data.models[i];
+
+ for (var member in entity) {
+ result["products[" + i + "]." + member] = entity[member];
+ if (member == 'Price' || member == 'OldPrice') {
+ result["products[" + i + "]." + member] = kendo.toString(entity[member], "n4");
+ }
+
+ }
+ }
+
+ addAntiForgeryToken(result);
+ return result;
+ } else {
+ addAntiForgeryToken(data);
+ //return JSON.stringify(data);
+ return data;
+ }
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Name: { editable: true, type: "string" },
+ ProductId: { editable: false, type: "string" },
+ Sku: { editable: true, type: "string" },
+ Price: { editable: true, type: "number" },
+ OldPrice: { editable: true, type: "number" },
+ ManageInventoryMethodId: { editable: true, type: "int" },
+ ManageInventoryMethod: { editable: true, type: "string" },
+ StockQuantity: { editable: true, type: "number" },
+ Published: { editable: true, type: "boolean" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ //bulk editing
+ batch: true,
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ toolbar: ["save", "cancel"],
+ editable: {
+ confirmation: true,
+ //bulk editing
+ mode: "incell"
+ },
+ scrollable: true,
+ columns: [ {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.Name"]",
+ width: 200
+ }, {
+ field: "ProductId",
+ title: "@Loc["Admin.Common.View"]",
+ width: 80,
+ template: '<a href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=Id#">@Loc["Admin.Common.View"]</a>'
+ },{
+ field: "Sku",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.Sku"]",
+ width: 100
+ }, {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.Price"]",
+ width: 100,
+ editor: function (container, options) {
+ $('<input name="' + options.field + '"/>')
+ .appendTo(container)
+ .kendoNumericTextBox({
+ format: "{0:n4}",
+ decimals: 4
+ });
+ }
+ }, {
+ field: "OldPrice",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.OldPrice"]",
+ width: 100,
+ editor: function (container, options) {
+ $('<input name="' + options.field + '"/>')
+ .appendTo(container)
+ .kendoNumericTextBox({
+ format: "{0:n4}",
+ decimals: 4
+ });
+ }
+ }, {
+ field: "StockQuantity",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.StockQuantity"]",
+ //integer format
+ format: "{0:0}",
+ width: 100
+ }, {
+ field: "ManageInventoryMethod",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.ManageInventoryMethod"]",
+ width: 150,
+ editor: function (container, options) {
+ $("<input data-bind='value:ManageInventoryMethod' />")
+ .attr("id", "ddl_ManageInventoryMethod")
+ .appendTo(container)
+ .kendoDropDownList({
+ dataSource: allInventoryMethod,
+ dataTextField: "Name",
+ dataValueField: "Name",
+ template: "<span data-id='${data.id}'>${data.Name}</span>",
+ select: function (e) {
+ var product = _grid.dataItem($(e.sender.element).closest("tr"));
+ product.ManageInventoryMethodId = e.dataItem.Id;
+ }
+ });
+ }
+ },{
+ field: "Published",
+ title: "@Loc["Admin.Catalog.BulkEdit.Fields.Published"]",
+ width: 90
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ width: 100
+ }
+ ]
+ }).data("kendoGrid");
+ });
+ </script>
+
+ <script>
+
+ $(document).ready(function () {
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BundleProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BundleProductAddPopup.cshtml
new file mode 100644
index 000000000..02395a9ff
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/BundleProductAddPopup.cshtml
@@ -0,0 +1,206 @@
+@model ProductModel.AddBundleProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.BundleProducts.AddNew"];
+}
+<form id="BundleProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="BundleProductAddPopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.BundleProducts.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#BundleProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshBundleProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BundleProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Create.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Create.cshtml
new file mode 100644
index 000000000..0ff5e79e4
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Create.cshtml
@@ -0,0 +1,37 @@
+@model ProductModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.AddNew"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="Create" method="post" id="product-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.AddNew"]
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Products.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <vc:admin-widget widget-zone="product_details_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/CrossSellProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/CrossSellProductAddPopup.cshtml
new file mode 100644
index 000000000..28a4c1a9b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/CrossSellProductAddPopup.cshtml
@@ -0,0 +1,214 @@
+@model ProductModel.AddCrossSellProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.CrossSells.AddNew"];
+}
+<form id="CrossSellProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="CrossSellProductAddPopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.CrossSells.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#CrossSellProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshCrossSellProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("CrossSellProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ title: "@Loc["Admin.Common.Check"]",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Edit.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Edit.cshtml
new file mode 100644
index 000000000..9a1a7e6bd
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Edit.cshtml
@@ -0,0 +1,100 @@
+@model ProductModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.EditProductDetails"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="Edit" method="post" id="product-form">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.EditProductDetails"] - @Model.Name
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Catalog.Products.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="button" onclick="window.open('@Url.RouteUrl("Product", new { Model.SeName })','_blank');" class="btn purple">
+ <i class="fa fa-eye"></i>
+ @Loc["Admin.Common.Preview"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <button type="button" name="copyproduct" class="btn blue" id="copyproduct">
+ <i class="fa fa-clone"></i>
+ @Loc["Admin.Catalog.Products.Copy"]
+ </button>
+ <span id="product-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="product_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdate" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+</form>
+
+<admin-delete-confirmation button-id="product-delete"/>
+<div id="copyproduct-window" style="display:none;">
+ <form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="CopyProduct" method="post">
+
+ <input asp-for="CopyProductModel.Id" type="hidden"/>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="CopyProductModel.Name" class="control-label col-8 col-md-4 col-sm-4"/>
+ <div class="col-4 col-md-8 col-sm-8">
+ <admin-input asp-for="CopyProductModel.Name"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CopyProductModel.Published" class="control-label col-8 col-md-4 col-sm-4"/>
+ <div class="col-4 col-md-8 col-sm-8">
+ <admin-input asp-for="CopyProductModel.Published"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CopyProductModel.CopyImages" class="control-label col-8 col-md-4 col-sm-4"/>
+ <div class="col-4 col-md-8 col-sm-8">
+ <admin-input asp-for="CopyProductModel.CopyImages"/>
+ </div>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="offset-md-3 offset-sm-3 col-md-6 col-sm-6">
+ <input type="submit" class="btn green" value="@Loc["Admin.Catalog.Products.Copy"]"/>
+ </div>
+ </div>
+ </div>
+ </form>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#copyproduct").click(function (e) {
+ e.preventDefault();
+ var window = $("#copyproduct-window");
+ if (!window.data("kendoWindow")) {
+ window.kendoWindow({
+ modal: true,
+ width: "400px",
+ title: "@Loc["Admin.Catalog.Products.Copy"]",
+ actions: ["Close"]
+ });
+ }
+ window.data('kendoWindow').center().open();
+ });
+ });
+ </script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/List.cshtml
new file mode 100644
index 000000000..c306d856f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/List.cshtml
@@ -0,0 +1,316 @@
+@model ProductListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.Manage"];
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="List" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.Manage"]
+ </div>
+ <div class="actions btn-group btn-group-devided util-btn-margin-bottom-5">
+ <a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green">
+ <i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span>
+ </a>
+ <vc:admin-widget widget-zone="product_list_buttons" additional-data="null"/>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-8 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchPublishedId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchPublishedId" asp-items="Model.AvailablePublishedOptions"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchWarehouseId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchWarehouseId" asp-items="Model.AvailableWarehouses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="GoDirectlyToSku" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <div class="input-group" style="text-align:left">
+ <admin-input asp-for="GoDirectlyToSku"/>
+ <span class="input-group-append">
+ <input type="submit" id="go-to-product-by-sku" asp-action="GoToSku" name="go-to-product-by-sku" class="btn default" value="@Loc["Admin.Common.Go"]"/>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchIncludeSubCategories" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="SearchIncludeSubCategories"/>
+ <div class="control__indicator"></div>
+ </label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="clearfix"></div>
+ <div class="x_content">
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('.extend-collapse').hide();
+ $('.filter-text-open').hide();
+ $('.filter-extend-button').click(function () {
+ $('.extend-collapse').toggle("slow");
+ $('.filter-text-open').toggle();
+ $('.filter-text-close').toggle();
+ });
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true,
+ requestStart: function () {
+ kendo.ui.progress($('#products-grid'), true);
+ },
+ requestEnd: function () {
+ kendo.ui.progress($('#products-grid'), false);
+
+ },
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ dataBound: onDataBound,
+ columns: [
+ {
+ field: "Id",
+ headerTemplate: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox mt-NoMargin'><input id='mastercheckbox' type='checkbox'/><div class='control__indicator control__indicator_custom mt-top2 rtlabel'></div></label>",
+ template: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox mt-NoMargin'><input type='checkbox' value='#=Id#' class='checkboxGroups'/><div class='control__indicator control__indicator_custom mt-top2'></div></label>",
+ width: 50
+ },
+ {
+ field: "PictureThumbnailUrl",
+ title: "@Loc["Admin.Catalog.Products.Fields.PictureThumbnailUrl"]",
+ template: '<a class="k-link" href="Edit/#=Id#"><img src="#=PictureThumbnailUrl#" /></a>',
+ width: 92
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]",
+ encoded: false,
+ template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ width: 270
+ }, {
+ field: "Sku",
+ title: "@Loc["Admin.Catalog.Products.Fields.Sku"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ width: 80
+ }, {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.Products.Fields.Price"]",
+ headerAttributes: { style: "text-align:right" },
+ attributes: { style: "text-align:right" },
+ width: 100,
+ //if not a grouped product, then display
+ template: "# if(ProductTypeId != @((int)ProductType.GroupedProduct)) {# #:Price# #} #"
+ }, {
+ field: "StockQuantityStr",
+ title: "@Loc["Admin.Catalog.Products.Fields.StockQuantity"]",
+ headerAttributes: { style: "text-align:right" },
+ attributes: { style: "text-align:right" },
+ minScreenWidth: 750,
+ width: 80
+ }, {
+ field: "ProductTypeName",
+ title: "@Loc["Admin.Catalog.Products.Fields.ProductType"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ width: 100,
+ minScreenWidth: 1050
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 85,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }
+ ]
+ });
+
+ });
+ </script>
+
+ <script>
+
+ var selectedIds = [];
+
+ $(document).ready(function () {
+
+ //search button
+ $('#search-products').click(function () {
+ //search
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1);
+ $('.checkboxGroups').prop('checked', false).change();
+ selectedIds = [];
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.GoDirectlyToSku)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#go-to-product-by-sku").click();
+ return false;
+ }
+ });
+
+ $('#mastercheckbox').click(function () {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function (e) {
+ var $check = $(this);
+ if ($check.is(":checked") == true) {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked == -1) {
+ selectedIds.push($check.val());
+ }
+ }
+ else {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked > -1) {
+ selectedIds = $.grep(selectedIds, function (item, index) {
+ return item != $check.val();
+ });
+ }
+ }
+ updateMasterCheckbox();
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchIncludeSubCategories: $('#@Html.IdFor(model => model.SearchIncludeSubCategories)').is(':checked'),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchWarehouseId: $('#SearchWarehouseId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val(),
+ SearchPublishedId: $('#SearchPublishedId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function onDataBound(e) {
+ $('#products-grid input[type=checkbox][id!=mastercheckbox]').each(function () {
+ var currentId = $(this).val();
+ var checked = jQuery.inArray(currentId, selectedIds);
+ $(this).prop('checked', checked > -1);
+ });
+
+ updateMasterCheckbox();
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Additional.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Additional.cshtml
new file mode 100644
index 000000000..fe8689d29
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Additional.cshtml
@@ -0,0 +1,252 @@
+@using Grand.Domain.Media
+@model ProductModel
+@{
+ ViewData["DownloadType"] = DownloadType.Product;
+ ViewData["ReferenceId"] = Model.Id;
+}
+<vc:admin-widget widget-zone="product_details_additional_top" additional-data="Model"/>
+<div class="form-horizontal" id="group-order">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrderCategory"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrderCategory"/>
+ <span asp-validation-for="DisplayOrderCategory"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrderBrand"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrderBrand"/>
+ <span asp-validation-for="DisplayOrderBrand"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrderCollection"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrderCollection"/>
+ <span asp-validation-for="DisplayOrderCollection"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OnSale"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OnSale"/>
+ <span asp-validation-for="OnSale"></span>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="form-horizontal" id="group-giftvoucher">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="IsGiftVoucher"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsGiftVoucher"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsGiftVoucher"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlGiftVoucherType">
+ <admin-label asp-for="GiftVoucherTypeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="GiftVoucherTypeId" asp-items="EnumTranslationService.ToSelectList((GiftVoucherType)Model.GiftVoucherTypeId)"/>
+ <span asp-validation-for="GiftVoucherTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlOverriddenGiftVoucherAmount">
+ <admin-label asp-for="OverGiftAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OverGiftAmount"/>
+ <span asp-validation-for="OverGiftAmount"></span>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="form-horizontal" id="group-downloads">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="IsDownload"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsDownload"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsDownload"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDownloadFile">
+ <admin-label asp-for="DownloadId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DownloadId"/>
+ <span asp-validation-for="DownloadId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlUnlimitedDownloads">
+ <admin-label asp-for="UnlimitedDownloads"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="UnlimitedDownloads"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="UnlimitedDownloads"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMaxNumberOfDownloads">
+ <admin-label asp-for="MaxNumberOfDownloads"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MaxNumberOfDownloads"/>
+ <span asp-validation-for="MaxNumberOfDownloads"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDownloadExpirationDays">
+ <admin-label asp-for="DownloadExpirationDays"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DownloadExpirationDays"/>
+ <span asp-validation-for="DownloadExpirationDays"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDownloadActivationType">
+ <admin-label asp-for="DownloadActivationTypeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="DownloadActivationTypeId" asp-items="EnumTranslationService.ToSelectList((DownloadActivationType)Model.DownloadActivationTypeId)"/>
+ <span asp-validation-for="DownloadActivationTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlHasUserAgreement">
+ <admin-label asp-for="HasUserAgreement"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="HasUserAgreement"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="HasUserAgreement"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlUserAgreementText">
+ <admin-label asp-for="UserAgreementText"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="UserAgreementText"></admin-textarea>
+ <span asp-validation-for="UserAgreementText"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlHasSampleDownload">
+ <admin-label asp-for="HasSampleDownload"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="HasSampleDownload"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="HasSampleDownload"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlSampleDownloadFile">
+ <admin-label asp-for="SampleDownloadId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SampleDownloadId"/>
+ <span asp-validation-for="SampleDownloadId"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="form-horizontal" id="group-recurring">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="IsRecurring"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsRecurring"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsRecurring"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlCycleLength">
+ <admin-label asp-for="RecurringCycleLength"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="RecurringCycleLength"/>
+ <span asp-validation-for="RecurringCycleLength"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlCyclePeriod">
+ <admin-label asp-for="RecurringCyclePeriodId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="RecurringCyclePeriodId" asp-items="EnumTranslationService.ToSelectList((RecurringCyclePeriod)Model.RecurringCyclePeriodId)"/>
+ <span asp-validation-for="RecurringCyclePeriodId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlTotalCycles">
+ <admin-label asp-for="RecurringTotalCycles"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="RecurringTotalCycles"/>
+ <span asp-validation-for="RecurringTotalCycles"></span>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="form-horizontal" id="group-required-other-products">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="RequireOtherProducts"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="RequireOtherProducts"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="RequireOtherProducts"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlRequiredProductIds">
+ <admin-label asp-for="RequiredProductIds"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="RequiredProductIds"/>
+ <span asp-validation-for="RequiredProductIds"></span>
+ <span id="required-products-check-progress" style="display: none;" class="please-wait">@Loc["Common.Wait..."]</span>
+ <a id="btnAddNewRequiredProduct"
+ href="@(Url.Action("RequiredProductAddPopup", "Product", new { btnId = "btnRefreshRequiredProducts", productIdsInput = "RequiredProductIds", area = Constants.AreaStore }))"
+ class="k-button">
+ @Loc["Admin.Catalog.Products.Fields.RequiredProductIds.AddNew"]
+ </a>
+ <input type="submit" id="btnRefreshRequiredProducts" style="display: none"/>
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewRequiredProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $('#btnRefreshRequiredProducts').click(function () {
+ loadRequiredProductFriendlyNames();
+ return false;
+ });
+ });
+ </script>
+ <span id="required-product-names" class="required-product-names"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlAutomaticallyAddRequiredProducts">
+ <admin-label asp-for="AutoAddRequiredProducts"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AutoAddRequiredProducts"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AutoAddRequiredProducts"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:admin-widget widget-zone="product_details_additional_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.AssociatedProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.AssociatedProducts.cshtml
new file mode 100644
index 000000000..59ee84ad2
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.AssociatedProducts.cshtml
@@ -0,0 +1,142 @@
+@model ProductModel
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="note note-info">
+ <p>@Loc["Admin.Catalog.Products.AssociatedProducts.Note2"]</p>
+ </div>
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_associated_products_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="associatedproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewAssociatedProduct" href="@(Url.Action("AssociatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshAssociatedProducts", formId = "product-form", area = Constants.AreaStore }))" class="k-button">
+ @Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"]
+ </a>
+ <input type="submit" id="btnRefreshAssociatedProducts" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="product_details_associated_products_bottom" additional-data="Model"/>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewAssociatedProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#associatedproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("AssociatedProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("AssociatedProductUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("AssociatedProductDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductName: {editable: false, type: "string" },
+ DisplayOrder: {editable: true, type: "number" },
+ ProductId: { editable: false, type: "string" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Catalog.Products.AssociatedProducts.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(ProductName)#</a>'
+ }, {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.AssociatedProducts.Fields.DisplayOrder"]",
+ //integer format
+ format: "{0:0}",
+ width: 150
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 300
+ }]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshAssociatedProducts').click(function () {
+ //refresh grid
+ var grid = $("#associatedproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ @Loc["Admin.Catalog.Products.AssociatedProducts.SaveBeforeEdit"]
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
new file mode 100644
index 000000000..f831e021f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
@@ -0,0 +1,96 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <input asp-for="AuctionEnded" type="hidden"/>
+
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_bids_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="bids-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_bids_bottom" additional-data="Model"/>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $("#bids-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListBids", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken,
+ }, destroy: {
+ url: "@Html.Raw(Url.Action("BidDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ ProductId: "ProductId"
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Date",
+ title: "@Loc["Admin.Catalog.Products.Bids.Date"]",
+ width: 200,
+ type: "date",
+ template: "#= kendo.toString(kendo.parseDate(Date, 'yyyy-MM-dd'), 'MM/dd/yyyy h:mm tt') #"
+ }, {
+ field: "CustomerId",
+ title: "@Loc["Admin.Catalog.Products.Bids.CustomerId"]",
+ width: 200,
+ template: '# if(Email) {# <a href="@Url.Action("Edit", "Customer")/#=CustomerId#">#=Email#</a> #} #'
+ }, {
+ field: "Amount",
+ title: "@Loc["Admin.Catalog.Products.Bids.Amount"]",
+ width: 200
+ }, {
+ field: "OrderId",
+ title: "@Loc["Admin.Catalog.Products.Bids.OrderId"]",
+ width: 200,
+ template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a> #} #'
+ }, {
+ command: [{
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 100
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Bids.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.BundleProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.BundleProducts.cshtml
new file mode 100644
index 000000000..82728fbe1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.BundleProducts.cshtml
@@ -0,0 +1,149 @@
+@model ProductModel
+
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_bundle_products_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="bundleproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewBundleProduct" href="@(Url.Action("BundleProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshBundleProducts", formId = "product-form", area = Constants.AreaStore }))" class="k-button">
+ @Loc["Admin.Catalog.Products.BundleProducts.AddNew"]
+ </a>
+ <input type="submit" id="btnRefreshBundleProducts" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="product_details_bundle_products_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewBundleProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#bundleproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BundleProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("BundleProductUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("BundleProductDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductName: { editable: false, type: "string" },
+ DisplayOrder: {editable: true, type: "number" },
+ Quantity: { editable: true, type: "number" },
+ ProductId: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Catalog.Products.BundleProducts.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>',
+ },{
+ field: "Quantity",
+ title: "@Loc["Admin.Catalog.Products.BundleProducts.Fields.Quantity"]",
+ format: "{0:0}",
+ },{
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.BundleProducts.Fields.DisplayOrder"]",
+ format: "{0:0}",
+ width: 120,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ minScreenWidth: 750,
+
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }]
+ }]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshBundleProducts').click(function () {
+ //refresh grid
+ var grid = $("#bundleproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.BundleProducts.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Calendar.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Calendar.cshtml
new file mode 100644
index 000000000..d99b5a800
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Calendar.cshtml
@@ -0,0 +1,376 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <input type="hidden" asp-for="CalendarModel.ProductId"/>
+
+ <vc:admin-widget widget-zone="product_details_calendar_top" additional-data="Model"/>
+ <div class="form-horizontal">
+ <h2>@Loc["Admin.Catalog.Products.Calendar.Calendarconfiguration"]</h2>
+ <div class="form-body">
+ <div class="form-group">
+ <div class="form-group">
+ <admin-label asp-for="CalendarModel.StartDate"/>
+ <div class="col-md-3 col-sm-3">
+ <admin-input asp-for="CalendarModel.StartDate"/>
+ </div>
+ <div class="col-md-6" id="pnlStartTime">
+ <label class="col-md-3 control-label">@Loc["Admin.Catalog.Products.Fields.Calendar.StartTime"]</label>
+ <div class="col-md-3 col-sm-3">
+ <admin-input asp-for="CalendarModel.StartTime"/>
+ </div>
+ </div>
+
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CalendarModel.EndDate"/>
+ <div class="col-md-3 col-sm-3">
+ <admin-input asp-for="CalendarModel.EndDate"/>
+ </div>
+ <div class="col-md-6" id="pnlEndTime">
+ <label class="col-md-3 control-label">@Loc["Admin.Catalog.Products.Fields.Calendar.EndTime"]</label>
+ <div class="col-md-3 col-sm-3">
+ <admin-input asp-for="CalendarModel.EndTime"/>
+ </div>
+ </div>
+ </div>
+ <div class="form-group" id="pnlIncludeBothDates">
+ <admin-label asp-for="CalendarModel.IncBothDate"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="CalendarModel.IncBothDate"/>
+ <div class="control__indicator"></div>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CalendarModel.Interval"/>
+ <div class="col-md-9 col-sm-9">
+ <span id="pnlInterval">
+ <admin-input asp-for="CalendarModel.Interval"/>
+ </span>
+ <admin-select asp-for="CalendarModel.IntervalUnit" asp-items="EnumTranslationService.ToSelectList((IntervalUnit)Model.CalendarModel.IntervalUnit)" class="form-control input-xsmall" style="height: 30px;padding: 0px; margin-bottom: 3px; margin-top: 3px; "/>
+ </div>
+ </div>
+ <div class="form-group" id="pnlQuantity">
+ <admin-label asp-for="CalendarModel.Quantity"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CalendarModel.Quantity"/>
+ </div>
+ </div>
+
+ <div class="form-group" id="pnlResource">
+ <admin-label asp-for="CalendarModel.Resource"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CalendarModel.Resource"/>
+ </div>
+ </div>
+
+ <div class="form-group" id="pnlParameter">
+ <admin-label asp-for="CalendarModel.Parameter"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CalendarModel.Parameter"/>
+ </div>
+ </div>
+ <div class="portlet">
+ <div class="x_title">
+ <div class="caption">@Loc["Admin.Catalog.Products.Calendar.WeekDay"]</div>
+ </div>
+ <div class="x_content">
+ <div class="form-group">
+ <div class="mt-checkbox-inline ">
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Monday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Monday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Tuesday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Tuesday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Wednesday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Wednesday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Thursday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Thursday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Friday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Friday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Saturday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Saturday"]
+ <div class="control__indicator"></div>
+ </label>
+ <label class="mt-checkbox control control-checkbox">
+ <admin-input asp-for="CalendarModel.Sunday"/>
+ @Loc["Admin.Catalog.Products.Fields.Calendar.Sunday"]
+ <div class="control__indicator"></div>
+ </label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="panel panel-default">
+ <div class="panel-footer">
+ <button id="generateCalendar" type="button" class="btn btn-primary">@Loc["Admin.Catalog.Products.Calendar.Generatecalendar"]</button>
+ <button id="clearOld" type="button" class="btn btn-secondary" style="margin-left:10px">@Loc["Admin.Catalog.Products.Calendar.Clearold"]</button>
+ <button id="clearCalendar" type="button" class="btn btn-danger" style="margin-left:10px">@Loc["Admin.Catalog.Products.Calendar.Clearcalendar"]</button>
+ </div>
+ <div class="panel-body">
+ <div id="reservations-grid"></div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_calendar_bottom" additional-data="Model"/>
+
+ <script>
+ $(document).ready(function () {
+ function toggleInternalType() {
+ var selectedInternalTypeId = $("#@Html.IdFor(model => model.CalendarModel.IntervalUnit)").val();
+ if (selectedInternalTypeId == @(((int)IntervalUnit.Day).ToString())) {
+ $("#pnlStartTime").hide();
+ $("#pnlEndTime").hide();
+ $("#pnlResource").show();
+ $("#pnlIncludeBothDates").show();
+ $("#pnlParameter").hide();
+ $("#pnlQuantity").hide();
+ $("#pnlInterval").hide();
+ $("#@Html.IdFor(model => model.CalendarModel.Interval)").data("kendoNumericTextBox").value(1);
+ } else {
+ $("#pnlStartTime").show();
+ $("#pnlEndTime").show();
+ $("#pnlResource").hide();
+ $("#pnlIncludeBothDates").hide();
+ $("#pnlParameter").show();
+ $("#pnlQuantity").show();
+ $("#pnlInterval").show();
+ $("#@Html.IdFor(model => model.CalendarModel.Interval)").data("kendoNumericTextBox").value(0);
+ }
+
+ }
+ toggleInternalType();
+ $("#@Html.IdFor(model => model.CalendarModel.IntervalUnit)").change(toggleInternalType);
+
+
+ $("#generateCalendar").click(function () {
+
+ var datepickerFrom = $("#@Html.IdFor(model => model.CalendarModel.StartDate)").data("kendoDatePicker");
+ var dateFrom = datepickerFrom.value();
+ dateFrom = kendo.toString(dateFrom, "@CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern");
+
+ var datepickerTo = $("#@Html.IdFor(model => model.CalendarModel.EndDate)").data("kendoDatePicker");
+ var dateTo = datepickerTo.value();
+ dateTo = kendo.toString(dateTo, "@CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern");
+
+ var timeFrom = $("#@Html.IdFor(model => model.CalendarModel.StartTime)").data("kendoTimePicker");
+ var hourFrom = timeFrom.value();
+ hourFrom = kendo.toString(hourFrom, "HH:mm");
+
+ var timeTo = $("#@Html.IdFor(model => model.CalendarModel.EndTime)").data("kendoTimePicker");
+ var hourTo = timeTo.value();
+ hourTo = kendo.toString(hourTo, "HH:mm");
+
+ var interval = $("#@Html.IdFor(model => model.CalendarModel.Interval)").val();
+ var intervalUnit = $("#@Html.IdFor(model => model.CalendarModel.IntervalUnit)").val();
+ var incBothDate = $("#@Html.IdFor(model => model.CalendarModel.IncBothDate)").prop("checked");
+ var quantity = $("#@Html.IdFor(model => model.CalendarModel.Quantity)").val();
+ var monday = $("#@Html.IdFor(model => model.CalendarModel.Monday)").prop("checked");
+ var tuesday = $("#@Html.IdFor(model => model.CalendarModel.Tuesday)").prop("checked");
+ var wednesday = $("#@Html.IdFor(model => model.CalendarModel.Wednesday)").prop("checked");
+ var thursday = $("#@Html.IdFor(model => model.CalendarModel.Thursday)").prop("checked");
+ var friday = $("#@Html.IdFor(model => model.CalendarModel.Friday)").prop("checked");
+ var saturday = $("#@Html.IdFor(model => model.CalendarModel.Saturday)").prop("checked");
+ var sunday = $("#@Html.IdFor(model => model.CalendarModel.Sunday)").prop("checked");
+ var resource = $("#@Html.IdFor(model => model.CalendarModel.Resource)").val()
+ var parameter = $("#@Html.IdFor(model => model.CalendarModel.Parameter)").val()
+
+ var postData = {
+ productId: '@(Model.Id)',
+ StartDate: dateFrom,
+ StartTime: hourFrom,
+ EndDate: dateTo,
+ EndTime: hourTo,
+ Interval: interval,
+ IntervalUnit: intervalUnit,
+ IncBothDate: incBothDate,
+ Quantity: quantity,
+ Monday: monday,
+ Tuesday: tuesday,
+ Wednesday: wednesday,
+ Thursday: thursday,
+ Friday: friday,
+ Saturday: saturday,
+ Sunday: sunday,
+ Resource: resource,
+ Parameter: parameter
+ };
+
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("GenerateCalendar", "Product", new { area = Constants.AreaStore }))",
+ dataType: 'json',
+ data: postData,
+ success: function (data) {
+ if (data.success) {
+ var grid = $("#reservations-grid").data('kendoGrid');
+ grid.dataSource.read();
+ }
+ else {
+ alert(data.errors);
+ }
+ },
+ error: function () {
+ alert('Error');
+ }
+ });
+ });
+
+ $("#clearCalendar").click(function () {
+ if (confirm('@Loc["Admin.Common.AreYouSure"]')) {
+ var postData = {
+ productId: '@(Model.Id)'
+ };
+
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("ClearCalendar", "Product", new { area = Constants.AreaStore }))",
+ dataType: 'json',
+ data: postData,
+ success: function (data) {
+ var grid = $("#reservations-grid").data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function () {
+ alert('Error');
+ }
+ });
+ }
+ });
+
+ $("#clearOld").click(function () {
+ var postData = {
+ productId: '@(Model.Id)'
+ };
+
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("ClearOld", "Product", new { area = Constants.AreaStore }))",
+ dataType: 'json',
+ data: postData,
+ success: function (data) {
+ var grid = $("#reservations-grid").data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function () {
+ alert('Error');
+ }
+ });
+ });
+ });
+
+
+ $(document).ready(function () {
+
+ $("#reservations-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListReservations", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken,
+ }, destroy: {
+ url: "@Html.Raw(Url.Action("ProductReservationDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ ProductId: "ProductId"
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Date",
+ title: "@Loc["Admin.Catalog.Products.Calendar.Date"]",
+ width: 200,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "Resource",
+ title: "@Loc["Admin.Catalog.Products.Calendar.Resource"]",
+ width: 200
+ }, {
+ field: "Parameter",
+ title: "@Loc["Admin.Catalog.Products.Calendar.Parameter"]",
+ width: 200
+ }, {
+ field: "Duration",
+ title: "@Loc["Admin.Catalog.Products.Calendar.Duration"]",
+ width: 200
+ }, {
+ field: "OrderId",
+ title: "@Loc["Admin.Catalog.Products.Calendar.OrderId"]",
+ width: 200,
+ template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a> #} #'
+ }, {
+ command: [{
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 100
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Calendar.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Categories.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Categories.cshtml
new file mode 100644
index 000000000..82c8ca020
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Categories.cshtml
@@ -0,0 +1,170 @@
+@model ProductModel
+
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_categories_top" additional-data="Model"/>
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.Categories.Fields.Category"]
+ </div>
+ <div class="panel-body">
+ <div id="productcategories-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_categories_bottom" additional-data="Model"/>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $("#productcategories-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductCategoryList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ create: {
+ url: "@Html.Raw(Url.Action("ProductCategoryInsert", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductCategoryUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductCategoryDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Category: { editable: true, type: "string" },
+ CategoryId: { editable: true, type: "string" },
+ IsFeaturedProduct: { editable: true, type: "boolean" },
+ DisplayOrder: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
+ edit: function(e) {
+ if (e.model.isNew()) {
+ e.model.CategoryId = "";
+ }
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CategoryId",
+ title: "@Loc["Admin.Catalog.Products.Categories.Fields.Category"]",
+ width: 200,
+ editor: categoryDropDownEditor,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Category", new { area = Constants.AreaStore })/#=CategoryId#">#:Category#</a>'
+ },
+ {
+ field: "IsFeaturedProduct",
+ title: "@Loc["Admin.Catalog.Products.Categories.Fields.IsFeaturedProduct"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsFeaturedProduct) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.Categories.Fields.DisplayOrder"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ //integer format
+ format: "{0:0}"
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
+ });
+
+ function categoryDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CategoryId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autobind: false,
+ optionLabel: "Select category...",
+ filter: "startswith",
+ filtering: function (e) {
+ var filter = e.filter;
+ if (!filter.value) {
+ //prevent filtering if the filter does not value
+ e.preventDefault();
+ }
+ },
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("Category", "Search", new { area = Constants.AreaStore }))"
+ }
+ },
+ schema: {
+ data: "Data"
+ },
+ serverFiltering: true
+ },
+ dataTextField: "Name",
+ dataValueField: "Id",
+ });
+ }
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Categories.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Collections.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Collections.cshtml
new file mode 100644
index 000000000..932bdf443
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Collections.cshtml
@@ -0,0 +1,170 @@
+@model ProductModel
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_collections_top" additional-data="Model"/>
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.Collections.Fields.Collection"]
+ </div>
+ <div class="panel-body">
+ <div id="productcollections-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_collections_bottom" additional-data="Model"/>
+ </div>
+
+
+ <script>
+ $(document).ready(function () {
+ $("#productcollections-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductCollectionList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ create: {
+ url: "@Html.Raw(Url.Action("ProductCollectionInsert", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductCollectionUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductCollectionDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Collection: { editable: true, type: "string" },
+ CollectionId: { editable: true, type: "string" },
+ IsFeaturedProduct: { editable: true, type: "boolean" },
+ DisplayOrder: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
+ edit: function(e) {
+ if (e.model.isNew()) {
+ e.model.CollectionId = "";
+ }
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CollectionId",
+ title: "@Loc["Admin.Catalog.Products.Collections.Fields.Collection"]",
+ width: 200,
+ editor: collectionDropDownEditor,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Collection", new { area = Constants.AreaStore })/#=CollectionId#">#:Collection#</a>'
+ },
+ {
+ field: "IsFeaturedProduct",
+ title: "@Loc["Admin.Catalog.Products.Collections.Fields.IsFeaturedProduct"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsFeaturedProduct) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.Collections.Fields.DisplayOrder"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ //integer format
+ format: "{0:0}"
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
+ });
+
+ function collectionDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CollectionId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autobind: false,
+ optionLabel: "Select collection...",
+ filter: "startswith",
+ filtering: function (e) {
+ var filter = e.filter;
+ if (!filter.value) {
+ //prevent filtering if the filter does not value
+ e.preventDefault();
+ }
+ },
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("Collection", "Search", new { area = Constants.AreaStore }))"
+ }
+ },
+ schema: {
+ data: "Data"
+ },
+ serverFiltering: true
+ },
+ dataTextField: "Name",
+ dataValueField: "Id",
+ });
+ }
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Collections.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.CrossSells.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.CrossSells.cshtml
new file mode 100644
index 000000000..c25a78ffb
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.CrossSells.cshtml
@@ -0,0 +1,116 @@
+@model ProductModel
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_cross_sells_top" additional-data="Model"/>
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.CrossSells"]
+ </div>
+ <div class="panel-body">
+ <div id="crosssellproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewCrossSellProduct" href="@(Url.Action("CrossSellProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCrossSellProducts", formId = "product-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.CrossSells.AddNew"]</a>
+ <input type="submit" id="btnRefreshCrossSellProducts" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="product_details_cross_sells_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewCrossSellProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#crosssellproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("CrossSellProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("CrossSellProductDelete", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductId: { editable: false, type: "string" },
+ Product2Name: { editable: false, type: "string" },
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "Product2Name",
+ title: "@Loc["Admin.Catalog.Products.CrossSells.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Product2Name)#</a>',
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ }
+ ]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshCrossSellProducts').click(function () {
+ //refresh grid
+ var grid = $("#crosssellproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.CrossSells.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Discounts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Discounts.cshtml
new file mode 100644
index 000000000..a15fb8b3d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Discounts.cshtml
@@ -0,0 +1,25 @@
+@model ProductModel
+<vc:admin-widget widget-zone="product_details_discounts_top" additional-data="Model"/>
+@if (Model.AvailableDiscounts is { Count: > 0 })
+{
+ <div class="mt-checkbox-list">
+ @foreach (var discount in Model.AvailableDiscounts)
+ {
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <input type="checkbox" name="SelectedDiscountIds" value="@discount.Id"
+ @if (Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))
+ {
+ <text> checked="checked" </text>
+ }/>@discount.Name
+ <div class="control__indicator"></div>
+ </label>
+ }
+ </div>
+}
+else
+{
+ <div class="note note-info">
+ @Html.Raw(Loc["Admin.Catalog.Collections.Discounts.NoDiscounts"])
+ </div>
+}
+<vc:admin-widget widget-zone="product_details_discounts_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Documents.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Documents.cshtml
new file mode 100644
index 000000000..f042cd910
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Documents.cshtml
@@ -0,0 +1,71 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="product-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { reference = (int)Reference.Product, ObjectId = Model.Id, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="product_details_documents_bottom" additional-data="Model"/>
+</div>
+
+<script>
+$(document).ready(function () {
+ $("#product-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Product, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+});
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Info.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Info.cshtml
new file mode 100644
index 000000000..b2f0be591
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Info.cshtml
@@ -0,0 +1,742 @@
+@using System.Text.Encodings.Web
+@using Grand.Business.Core.Interfaces.Catalog.Products
+@using Microsoft.AspNetCore.Mvc.Razor
+@using Constants = Grand.SharedUIResources.Constants
+@model ProductModel
+@inject IProductTagService productTagService
+@{
+ //resources for product tags input
+ <link rel="stylesheet" type="text/css" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.tag-editor.css"/>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.caret.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/tagEditor/jquery.tag-editor.min.js"></script>
+}
+<script>
+ $(document).ready(function() {
+
+ $("#@Html.IdFor(model => model.ShowOnHomePage)").click(toggleShowOnHomePage);
+ $("#@Html.IdFor(model => model.BestSeller)").click(toggleShowOnHomePage);
+ $("#@Html.IdFor(model => model.ProductTypeId)").change(toggleProductType);
+ $("#@Html.IdFor(model => model.RequireOtherProducts)").click(toggleRequireOtherProducts);
+ $("#@Html.IdFor(model => model.AvailableForPreOrder)").click(togglePreOrder);
+ $("#@Html.IdFor(model => model.IsGiftVoucher)").click(toggleGiftVoucher);
+ $("#@Html.IdFor(model => model.EnteredPrice)").click(toggleEnteredPrice);
+ $("#@Html.IdFor(model => model.BasepriceEnabled)").click(toggleBasepriceEnabled);
+ $("#@Html.IdFor(model => model.IsDownload)").click(toggleDownloadableProduct);
+ $("#@Html.IdFor(model => model.UnlimitedDownloads)").click(toggleDownloadableProduct);
+ $("#@Html.IdFor(model => model.HasSampleDownload)").click(toggleDownloadableProduct);
+ $("#@Html.IdFor(model => model.HasUserAgreement)").click(toggleDownloadableProduct);
+ $("#@Html.IdFor(model => model.IsRecurring)").click(toggleRecurring);
+ $("#@Html.IdFor(model => model.IsShipEnabled)").click(toggleShipping);
+ $("#@Html.IdFor(model => model.IsTaxExempt)").click(toggleTax);
+ $("#@Html.IdFor(model => model.ManageInventoryMethodId)").change(toggleManageStock);
+ $("#@Html.IdFor(model => model.UseMultipleWarehouses)").click(toggleManageStock);
+ $("#@Html.IdFor(model => model.BackorderModeId)").change(toggleManageStock);
+ $("#@Html.IdFor(model => model.StockAvailability)").click(toggleManageStock);
+ $("#@Html.IdFor(model => model.MarkAsNew)").click(toggleMarkAsNew);
+
+ toggleShowOnHomePage();
+ toggleProductType();
+ togglePreOrder();
+ toggleRequireOtherProducts();
+ toggleGiftVoucher();
+ toggleEnteredPrice();
+ toggleBasepriceEnabled();
+ toggleDownloadableProduct();
+ toggleRecurring();
+ toggleShipping();
+ toggleTax();
+ toggleManageStock();
+ toggleMarkAsNew();
+ });
+
+ function toggleShowOnHomePage() {
+ if ($('#@Html.IdFor(model => model.ShowOnHomePage)').is(':checked')) {
+ $('#pnlDisplayOrder').show();
+ } else {
+ $('#pnlDisplayOrder').hide();
+ }
+ if ($('#@Html.IdFor(model => model.BestSeller)').is(':checked')) {
+ $('#pnlDisplayOrder').show();
+ }
+ }
+
+ function toggleProductType() {
+ var selectedProductTypeId = $("#@Html.IdFor(model => model.ProductTypeId)").val();
+ if (selectedProductTypeId == @(((int)ProductType.SimpleProduct).ToString())) {
+ $('#group-required-other-products').show();
+ $('#group-giftvoucher').show();
+ $('#group-downloads').show();
+ $('#group-recurring').show();
+ $('#group-shipping').show();
+ $('#group-tax').show();
+ $('#pnlStartPrice').hide();
+ $('#tab-associated-products').hide();
+ $('#tab-price-product').show();
+ $('#tab-inventory-product').show();
+ $('#tab-attributes-product').show();
+ $('#tab-purchased-product').show();
+ $('#tab-calendar').hide();
+ $('#tab-bundle-products').hide();
+ $('#tab-bids').hide();
+ } else if (selectedProductTypeId == @(((int)ProductType.GroupedProduct).ToString())) {
+ $('#group-required-other-products').hide();
+ $('#group-giftvoucher').hide();
+ $('#group-downloads').hide();
+ $('#group-recurring').hide();
+ $('#group-shipping').hide();
+ $('#group-tax').hide();
+ $('#pnlStartPrice').hide();
+ $('#tab-associated-products').show();
+ $('#tab-price-product').hide();
+ $('#tab-inventory-product').hide();
+ $('#tab-attributes-product').hide();
+ $('#tab-purchased-product').hide();
+ $('#tab-calendar').hide();
+ $('#tab-bundle-products').hide();
+ $('#tab-bids').hide();
+ } else if (selectedProductTypeId == @(((int)ProductType.Reservation).ToString())){
+ $('#group-required-other-products').show();
+ $('#group-giftvoucher').show();
+ $('#group-downloads').show();
+ $('#group-shipping').show();
+ $('#group-tax').show();
+ $('#pnlStartPrice').hide();
+ $('#group-recurring').hide();
+ $('#tab-associated-products').hide();
+ $('#tab-price-product').show();
+ $('#tab-inventory-product').show();
+ $('#tab-attributes-product').show();
+ $('#tab-purchased-product').show();
+ $('#tab-calendar').show();
+ $('#tab-bundle-products').hide();
+ $('#tab-bids').hide();
+ $("#@Html.IdFor(model => model.ManageInventoryMethodId)").val("0");
+ toggleManageStock();
+ $("#@Html.IdFor(model => model.IsShipEnabled)").prop("checked", false);
+ $("#@Html.IdFor(model => model.NotReturnable)").prop("checked", true);
+ $("#@Html.IdFor(model => model.IsRecurring)").prop("checked", false);
+ toggleShipping();
+ $('#tab-inventory-product').hide();
+ } else if (selectedProductTypeId == @(((int)ProductType.BundledProduct).ToString())){
+ $('#group-required-other-products').hide();
+ $('#group-giftvoucher').hide();
+ $('#group-downloads').show();
+ $('#group-recurring').hide();
+ $('#group-shipping').show();
+ $('#group-tax').show();
+ $('#pnlStartPrice').hide();
+ $('#tab-associated-products').hide();
+ $('#tab-price-product').show();
+ $('#tab-inventory-product').show();
+ $('#tab-attributes-product').show();
+ $('#tab-purchased-product').show();
+ $('#tab-calendar').hide();
+ $('#tab-bundle-products').show();
+ $('#tab-bids').hide();
+ $("#@Html.IdFor(model => model.IsRecurring)").prop("checked", false);
+ } else if (selectedProductTypeId == @(((int)ProductType.Auction).ToString())){
+ $('#tab-bids').show();
+ $('#tab-calendar').hide();
+ $('#tab-bundle-products').hide();
+ $('#tab-attributes-product').hide();
+ $('#group-required-other-products').hide();
+ $('#group-recurring').hide();
+ $('#pnlStartPrice').show();
+ $('#tab-associated-products').hide();
+ $("#@Html.IdFor(model => model.IsRecurring)").prop("checked", false);
+ }
+ }
+
+ function togglePreOrder() {
+ if ($('#@Html.IdFor(model => model.AvailableForPreOrder)').is(':checked')) {
+ $('#pnlPreOrderDateTime').show();
+ } else {
+ $('#pnlPreOrderDateTime').hide();
+ }
+ }
+
+ function toggleRequireOtherProducts() {
+ if ($('#@Html.IdFor(model => model.RequireOtherProducts)').is(':checked')) {
+ $('#pnlRequiredProductIds').show();
+ $('#pnlAutomaticallyAddRequiredProducts').show();
+ } else {
+ $('#pnlRequiredProductIds').hide();
+ $('#pnlAutomaticallyAddRequiredProducts').hide();
+ }
+ }
+
+ function toggleGiftVoucher() {
+ if ($('#@Html.IdFor(model => model.IsGiftVoucher)').is(':checked')) {
+ $('#pnlGiftVoucherType').show();
+ $('#pnlOverriddenGiftVoucherAmount').show();
+ } else {
+ $('#pnlGiftVoucherType').hide();
+ $('#pnlOverriddenGiftVoucherAmount').hide();
+ }
+ }
+
+ function toggleEnteredPrice() {
+ if ($('#@Html.IdFor(model => model.EnteredPrice)').is(':checked')) {
+ $('#pnlMinEnteredPrice').show();
+ $('#pnlMaxEnteredPrice').show();
+ } else {
+ $('#pnlMinEnteredPrice').hide();
+ $('#pnlMaxEnteredPrice').hide();
+ }
+ }
+
+ function toggleBasepriceEnabled() {
+ if ($('#@Html.IdFor(model => model.BasepriceEnabled)').is(':checked')) {
+ $('#pnlBasepriceAmount').show();
+ $('#pnlBasepriceUnit').show();
+ $('#pnlBasepriceBaseAmount').show();
+ $('#pnlBasepriceBaseUnit').show();
+ } else {
+ $('#pnlBasepriceAmount').hide();
+ $('#pnlBasepriceUnit').hide();
+ $('#pnlBasepriceBaseAmount').hide();
+ $('#pnlBasepriceBaseUnit').hide();
+ }
+ }
+
+ function toggleDownloadableProduct() {
+ if ($('#@Html.IdFor(model => model.IsDownload)').is(':checked')) {
+
+ $('#pnlDownloadFile').show();
+ $('#pnlUnlimitedDownloads').show();
+ if ($('#@Html.IdFor(model => model.UnlimitedDownloads)').is(':checked')) {
+ $('#pnlMaxNumberOfDownloads').hide();
+ } else {
+ $('#pnlMaxNumberOfDownloads').show();
+ }
+ $('#pnlDownloadExpirationDays').show();
+ $('#pnlDownloadActivationType').show();
+
+ $('#pnlHasUserAgreement').show();
+ if ($('#@Html.IdFor(model => model.HasUserAgreement)').is(':checked')) {
+ $('#pnlUserAgreementText').show();
+ } else {
+ $('#pnlUserAgreementText').hide();
+ }
+
+ $('#pnlHasSampleDownload').show();
+
+ if ($('#@Html.IdFor(model => model.HasSampleDownload)').is(':checked')) {
+ $('#pnlSampleDownloadFile').show();
+ } else {
+ $('#pnlSampleDownloadFile').hide();
+ }
+ } else {
+ $('#pnlDownloadFile').hide();
+ $('#pnlUnlimitedDownloads').hide();
+ $('#pnlMaxNumberOfDownloads').hide();
+ $('#pnlDownloadExpirationDays').hide();
+ $('#pnlDownloadActivationType').hide();
+ $('#pnlHasUserAgreement').hide();
+ $('#pnlUserAgreementText').hide();
+ $('#pnlHasSampleDownload').hide();
+ $('#pnlSampleDownloadFile').hide();
+ }
+ }
+
+ function toggleShipping() {
+ if ($('#@Html.IdFor(model => model.IsShipEnabled)').is(':checked')) {
+ $('#pnlFreeShipping').show();
+ $('#pnlShipSeparately').show();
+ $('#pnlAdditionalShippingCharge').show();
+ $('#pnlWeight').show();
+ $('#pnlLength').show();
+ $('#pnlWidth').show();
+ $('#pnlHeight').show();
+ $('#pnlDeliveryDate').show();
+ } else {
+ $('#pnlFreeShipping').hide();
+ $('#pnlShipSeparately').hide();
+ $('#pnlAdditionalShippingCharge').hide();
+ $('#pnlWeight').hide();
+ $('#pnlLength').hide();
+ $('#pnlWidth').hide();
+ $('#pnlHeight').hide();
+ $('#pnlDeliveryDate').hide();
+ }
+ }
+
+ function toggleRecurring() {
+ if ($('#@Html.IdFor(model => model.IsRecurring)').is(':checked')) {
+ $('#pnlCycleLength').show();
+ $('#pnlCyclePeriod').show();
+ $('#pnlTotalCycles').show();
+ } else {
+ $('#pnlCycleLength').hide();
+ $('#pnlCyclePeriod').hide();
+ $('#pnlTotalCycles').hide();
+ }
+ }
+
+
+ function toggleTax() {
+ if ($('#@Html.IdFor(model => model.IsTaxExempt)').is(':checked')) {
+ $('#pnlTaxCategory').hide();
+ } else {
+ $('#pnlTaxCategory').show();
+ }
+ }
+
+ function toggleManageStock() {
+ var selectedManageInventoryMethodId = $("#@Html.IdFor(model => model.ManageInventoryMethodId)").val();
+ if (selectedManageInventoryMethodId == @(((int)ManageInventoryMethod.DontManageStock).ToString())) {
+ $('#pnlUseMultipleWarehouses').hide();
+ $('#pnlWarehouse').show();
+ $('#pnlMultipleWarehouses').hide();
+ $('#pnlStockQuantity').hide();
+ $('#pnlReservedQuantity').hide();
+ $('#pnlDisplayStockAvailability').hide();
+ $('#pnlDisplayStockQuantity').hide();
+ $('#pnlMinStockQuantity').hide();
+ $('#pnlLowStockActivity').hide();
+ $('#pnlNotifyForQuantityBelow').hide();
+ $('#pnlAllowOutOfStockSubscriptions').hide();
+ $('#pnlBackorders').hide();
+ } else if (selectedManageInventoryMethodId == @(((int)ManageInventoryMethod.ManageStockByBundleProducts).ToString())) {
+ $('#pnlWarehouse').hide();
+ $('#pnlUseMultipleWarehouses').hide();
+ $('#pnlMultipleWarehouses').hide();
+ $('#pnlStockQuantity').hide();
+ $('#pnlReservedQuantity').hide();
+ $('#pnlDisplayStockAvailability').hide();
+ $('#pnlDisplayStockQuantity').hide();
+ $('#pnlMinStockQuantity').hide();
+ $('#pnlLowStockActivity').hide();
+ $('#pnlNotifyForQuantityBelow').hide();
+ $('#pnlAllowOutOfStockSubscriptions').hide();
+ $('#pnlBackorders').hide();
+ }else if (selectedManageInventoryMethodId == @(((int)ManageInventoryMethod.ManageStock).ToString())) {
+ $('#pnlUseMultipleWarehouses').show();
+
+ if ($('#@Html.IdFor(model => model.UseMultipleWarehouses)').is(':checked')) {
+ $('#pnlWarehouse').hide();
+ $('#pnlMultipleWarehouses').show();
+ $('#pnlStockQuantity').hide();
+ $('#pnlReservedQuantity').hide();
+
+ } else {
+ $('#pnlWarehouse').show();
+ $('#pnlMultipleWarehouses').hide();
+ $('#pnlStockQuantity').show();
+ $('#pnlReservedQuantity').show();
+ }
+
+ $('#pnlDisplayStockAvailability').show();
+ if ($('#@Html.IdFor(model => model.StockAvailability)').is(':checked')) {
+ $('#pnlDisplayStockQuantity').show();
+ } else {
+ $('#pnlDisplayStockQuantity').hide();
+ }
+
+ $('#pnlMinStockQuantity').show();
+ $('#pnlLowStockActivity').show();
+ $('#pnlNotifyForQuantityBelow').show();
+ $('#pnlBackorders').show();
+ var selectedBackorderModeId = $("#@Html.IdFor(model => model.BackorderModeId)").val();
+ if (selectedBackorderModeId == @(((int)BackorderMode.NoBackorders).ToString())) {
+ //no backorders
+ $('#pnlAllowOutOfStockSubscriptions').show();
+ } else {
+ //backorders are enabled
+ $('#pnlAllowOutOfStockSubscriptions').hide();
+ }
+ } else if (selectedManageInventoryMethodId == @(((int)ManageInventoryMethod.ManageStockByAttributes).ToString())) {
+ $('#pnlUseMultipleWarehouses').show();
+ $('#pnlMultipleWarehouses').hide();
+ $('#pnlStockQuantity').hide();
+ $('#pnlReservedQuantity').hide();
+ $('#pnlMinStockQuantity').show();
+ $('#pnlLowStockActivity').show();
+ $('#pnlNotifyForQuantityBelow').show();
+ $('#pnlBackorders').show();
+ if ($('#@Html.IdFor(model => model.UseMultipleWarehouses)').is(':checked')) {
+ $('#pnlWarehouse').hide();
+ } else {
+ $('#pnlWarehouse').show();
+ }
+ $('#pnlDisplayStockAvailability').show();
+ if ($('#@Html.IdFor(model => model.StockAvailability)').is(':checked')) {
+ $('#pnlDisplayStockQuantity').show();
+ } else {
+ $('#pnlDisplayStockQuantity').hide();
+ }
+ var selectedBackorderModeId = $("#@Html.IdFor(model => model.BackorderModeId)").val();
+ if (selectedBackorderModeId == @(((int)BackorderMode.NoBackorders).ToString())) {
+ //no backorders
+ $('#pnlAllowOutOfStockSubscriptions').show();
+ } else {
+ //backorders are enabled
+ $('#pnlAllowOutOfStockSubscriptions').hide();
+ }
+
+ } else {
+ if ($('#@Html.IdFor(model => model.UseMultipleWarehouses)').is(':checked')) {
+ $('#pnlWarehouse').hide();
+ } else {
+ $('#pnlWarehouse').show();
+ }
+ $('#pnlMultipleWarehouses').hide();
+ $('#pnlStockQuantity').hide();
+ $('#pnlReservedQuantity').hide();
+ $('#pnlDisplayStockAvailability').show();
+ if ($('#@Html.IdFor(model => model.StockAvailability)').is(':checked')) {
+ $('#pnlDisplayStockQuantity').show();
+ } else {
+ $('#pnlDisplayStockQuantity').hide();
+ }
+ $('#pnlMinStockQuantity').hide();
+ $('#pnlLowStockActivity').hide();
+ $('#pnlNotifyForQuantityBelow').hide();
+ $('#pnlAllowOutOfStockSubscriptions').hide();
+ $('#pnlBackorders').hide();
+ }
+ }
+
+ function toggleMarkAsNew() {
+ if ($('#@Html.IdFor(model => model.MarkAsNew)').is(':checked')) {
+ $('#pnlMarkAsNewStartDateTime').show();
+ $('#pnlMarkAsNewEndDateTime').show();
+ } else {
+ $('#pnlMarkAsNewStartDateTime').hide();
+ $('#pnlMarkAsNewEndDateTime').hide();
+ }
+ }
+
+ @{
+ var productTags = await productTagService.GetAllProductTags();
+ var productTagsSb = new StringBuilder();
+ productTagsSb.Append("var initialProductTags = [");
+ for (var i = 0; i < productTags.Count; i++)
+ {
+ var tag = productTags[i];
+ productTagsSb.Append("'");
+ productTagsSb.Append(JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(tag.Name) ? "" : tag.Name));
+ productTagsSb.Append("'");
+ if (i != productTags.Count - 1)
+ {
+ productTagsSb.Append(",");
+ }
+ }
+
+ productTagsSb.Append("]");
+ }
+ //tags
+ $(document).ready(function () {
+ @Html.Raw(productTagsSb.ToString())
+ $("#@Html.IdFor(model => model.ProductTags)").tagEditor({
+ autocomplete: {
+ delay: 0,
+ position: { collision: 'flip' },
+ source: initialProductTags
+ },
+ delimiter: ',',
+ placeholder: 'Enter tags ...'
+ });
+ });
+
+
+ //required product friendly names
+ $(document).ready(function () {
+ loadRequiredProductFriendlyNames();
+ });
+ $(document).ready(function () {
+ $('#@Html.IdFor(model => model.RequiredProductIds)')
+ .data('timeout', null)
+ .keyup(function() {
+ clearTimeout($(this).data('timeout'));
+ //one second timeout
+ $(this).data('timeout', setTimeout(loadRequiredProductFriendlyNames, 1000));
+ });
+ });
+ function loadRequiredProductFriendlyNames() {
+ var inputValue = $('#@Html.IdFor(model => model.RequiredProductIds)').val();
+ if (inputValue) {
+ //load friendly names
+ $('#required-products-check-progress').show();
+
+ var postData = {
+ productIds: inputValue
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: 'POST',
+ url: '@Url.Action("LoadProductFriendlyNames", "Product", new { area = Grand.Web.Store.Extensions.Constants.AreaStore })',
+ data: postData,
+ dataType: 'json',
+ success: function(data) {
+ $('#required-products-check-progress').hide();
+ $('#required-product-names').text(data.Text);
+ },
+ failure: function () {
+ $('#required-products-check-progress').hide();
+ $('#required-product-names').text('');
+ }
+ });
+ } else {
+ $('#required-product-names').text('');
+ }
+ }
+
+</script>
+<vc:admin-widget widget-zone="product_details_info_column_left_top" additional-data="Model"/>
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="ProductTypeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ProductTypeId" asp-items="EnumTranslationService.ToSelectList((ProductType)Model.ProductTypeId)"/>
+ <span asp-validation-for="ProductTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="VisibleIndividually"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="VisibleIndividually"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="VisibleIndividually"></span>
+ </div>
+ </div>
+ @if (!string.IsNullOrEmpty(Model.Id) && !string.IsNullOrEmpty(Model.AssociatedToProductId) && !string.IsNullOrEmpty(Model.AssociatedToProductName))
+ {
+ <div class="form-group">
+ <admin-label asp-for="AssociatedToProductId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">
+ @Html.ActionLink(Model.AssociatedToProductName, "Edit", "Product", new { id = Model.AssociatedToProductId }, new { })
+ </label>
+ </div>
+ </div>
+ }
+ <div class="form-group">
+ <admin-label asp-for="ProductLayoutId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ProductLayoutId" asp-items="Model.AvailableProductLayouts"/>
+ <span asp-validation-for="ProductLayoutId"></span>
+ </div>
+ </div>
+ </div>
+
+ @{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Name"/>
+ <span asp-validation-for="@Model.Locales[item].Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].ShortDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="@Model.Locales[item].ShortDescription"></admin-textarea>
+ <span asp-validation-for="@Model.Locales[item].ShortDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].FullDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].FullDescription" asp-template="Editor"/>
+ <span asp-validation-for="@Model.Locales[item].FullDescription"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+ }
+
+ <localized-editor localized-template="@template" name="product-info-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShortDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="ShortDescription"></admin-textarea>
+ <span asp-validation-for="ShortDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="FullDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="FullDescription" asp-template="Editor"/>
+ <span asp-validation-for="FullDescription"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Flag"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Flag"/>
+ <span asp-validation-for="Flag"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AdminComment"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="AdminComment"></admin-textarea>
+ <span asp-validation-for="AdminComment"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BrandId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BrandId"/>
+ <span asp-validation-for="BrandId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnHomePage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnHomePage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnHomePage"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDisplayOrder">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BestSeller"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="BestSeller"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="BestSeller"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AllowCustomerReviews"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowCustomerReviews"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowCustomerReviews"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ProductTags"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ProductTags"/>
+ <span asp-validation-for="ProductTags"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Sku"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Sku"/>
+ <span asp-validation-for="Sku"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Mpn"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Mpn"/>
+ <span asp-validation-for="Mpn"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Gtin"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Gtin"/>
+ <span asp-validation-for="Gtin"></span>
+ </div>
+ </div>
+
+ </div>
+</div>
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AvailableStartDateTime"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AvailableStartDateTime"/>
+ <span asp-validation-for="AvailableStartDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AvailableEndDateTime"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AvailableEndDateTime"/>
+ <span asp-validation-for="AvailableEndDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MarkAsNew"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="MarkAsNew"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="MarkAsNew"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMarkAsNewStartDateTime">
+ <admin-label asp-for="MarkAsNewStartDateTime"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MarkAsNewStartDateTime"/>
+ <span asp-validation-for="MarkAsNewStartDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMarkAsNewEndDateTime">
+ <admin-label asp-for="MarkAsNewEndDateTime"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MarkAsNewEndDateTime"/>
+ <span asp-validation-for="MarkAsNewEndDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Published"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="Published"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="Published"></span>
+ </div>
+ </div>
+ @if (Model.CreatedOn.HasValue)
+ {
+ <div class="form-group">
+ <admin-label asp-for="CreatedOn"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.CreatedOn.Value.ToString("F")</label>
+ </div>
+ </div>
+ }
+ @if (Model.UpdatedOn.HasValue)
+ {
+ <div class="form-group">
+ <admin-label asp-for="UpdatedOn"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.UpdatedOn.Value.ToString("F")</label>
+ </div>
+ </div>
+ }
+ </div>
+</div>
+<vc:admin-widget widget-zone="product_details_info_column_left_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Inventory.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Inventory.cshtml
new file mode 100644
index 000000000..fc89e14d6
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Inventory.cshtml
@@ -0,0 +1,278 @@
+@model ProductModel
+<vc:admin-widget widget-zone="product_details_inventory_top" additional-data="Model"/>
+<div class="form-horizontal portlet bg-inverse form-fit" id="group-inventory">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="ManageInventoryMethodId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ManageInventoryMethodId" asp-items="EnumTranslationService.ToSelectList((ManageInventoryMethod)Model.ManageInventoryMethodId)"/>
+ <span asp-validation-for="ManageInventoryMethodId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlUseMultipleWarehouses">
+ <admin-label asp-for="UseMultipleWarehouses"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="UseMultipleWarehouses"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="UseMultipleWarehouses"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlWarehouse">
+ <admin-label asp-for="WarehouseId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="WarehouseId" asp-items="Model.AvailableWarehouses"/>
+ <span asp-validation-for="WarehouseId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMultipleWarehouses">
+ <admin-label asp-for="ProductWarehouseInventoryModels"/>
+ <div class="col-md-9 col-sm-9">
+ @if (Model.ProductWarehouseInventoryModels.Count > 0)
+ {
+ <table style="width: 600px; border-collapse: collapse;">
+ <thead>
+ <tr>
+ <th>
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.WarehouseUsed"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.StockQuantity"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.ReservedQuantity"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @for (var i = 0; i < Model.ProductWarehouseInventoryModels.Count; i++)
+ {
+ var item = Model.ProductWarehouseInventoryModels[i];
+ <tr>
+ <td style="width: 40%;">
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.WarehouseName (@item.WarehouseCode)
+ <input asp-for="@Model.ProductWarehouseInventoryModels[i].WarehouseId" type="hidden"/>
+ </div>
+ </td>
+ <td align="center" style="width: 10%;">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="@Model.ProductWarehouseInventoryModels[i].WarehouseUsed"/>
+ <div class="control__indicator"></div>
+ </label>
+ <td align="center" style="width: 20%;">
+ <admin-input asp-for="@Model.ProductWarehouseInventoryModels[i].StockQuantity"/>
+ </td>
+ <td align="center" style="width: 20%;">
+ <admin-input asp-for="@Model.ProductWarehouseInventoryModels[i].ReservedQuantity"/>
+ </td>
+
+ </tr>
+ }
+ </tbody>
+ </table>
+ <p>
+ <em>@Loc["Admin.Catalog.Products.ProductWarehouseInventory.Description1"]</em>
+ </p>
+ <p>
+ <em>@Loc["Admin.Catalog.Products.ProductWarehouseInventory.Description2"]</em>
+ </p>
+ <p>
+ <em>@Loc["Admin.Catalog.Products.ProductWarehouseInventory.Description3"]</em>
+ </p>
+ }
+ else
+ {
+ @Loc["Admin.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse.NotDefined"]
+ }
+ </div>
+ </div>
+ <div class="form-group" id="pnlStockQuantity">
+ <admin-label asp-for="StockQuantity"/>
+ <div class="col-md-9 col-sm-9 form-inline">
+ <admin-input asp-for="StockQuantity"/>
+ <span asp-validation-for="StockQuantity"></span>
+ <span>
+ <admin-select asp-for="UnitId" asp-items="Model.AvailableUnits" class="form-control input-xsmall"/>
+ </span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlReservedQuantity">
+ <admin-label asp-for="ReservedQuantity"/>
+ <div class="col-md-9 col-sm-9 form-inline">
+ <admin-input asp-for="ReservedQuantity"/>
+ <span asp-validation-for="ReservedQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDisplayStockAvailability">
+ <admin-label asp-for="StockAvailability"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="StockAvailability"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="StockAvailability"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDisplayStockQuantity">
+ <admin-label asp-for="DisplayStockQuantity"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="DisplayStockQuantity"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="DisplayStockQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMinStockQuantity">
+ <admin-label asp-for="MinStockQuantity"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MinStockQuantity"/>
+ <span asp-validation-for="MinStockQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlLowStockActivity">
+ <admin-label asp-for="LowStockActivityId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="LowStockActivityId" asp-items="EnumTranslationService.ToSelectList((LowStockActivity)Model.LowStockActivityId)"/>
+ <span asp-validation-for="LowStockActivityId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlNotifyForQuantityBelow">
+ <admin-label asp-for="NotifyAdminForQuantityBelow"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="NotifyAdminForQuantityBelow"/>
+ <span asp-validation-for="NotifyAdminForQuantityBelow"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlBackorders">
+ <admin-label asp-for="BackorderModeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BackorderModeId" asp-items="EnumTranslationService.ToSelectList((BackorderMode)Model.BackorderModeId)"/>
+ <span asp-validation-for="BackorderModeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlAllowOutOfStockSubscriptions">
+ <admin-label asp-for="AllowOutOfStockSubscriptions"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowOutOfStockSubscriptions"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowOutOfStockSubscriptions"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderMinimumQuantity"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OrderMinimumQuantity"/>
+ <span asp-validation-for="OrderMinimumQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OrderMaximumQuantity"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OrderMaximumQuantity"/>
+ <span asp-validation-for="OrderMaximumQuantity"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AllowedQuantities"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AllowedQuantities"/>
+ <span asp-validation-for="AllowedQuantities"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="NotReturnable"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="NotReturnable"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="NotReturnable"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="form-horizontal portlet bg-inverse form-fit" id="group-shipping">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="IsShipEnabled"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsShipEnabled"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsShipEnabled"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlFreeShipping">
+ <admin-label asp-for="IsFreeShipping"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsFreeShipping"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsFreeShipping"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlShipSeparately">
+ <admin-label asp-for="ShipSeparately"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShipSeparately"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShipSeparately"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlAdditionalShippingCharge">
+ <admin-label asp-for="AdditionalShippingCharge"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AdditionalShippingCharge"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="AdditionalShippingCharge"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlWeight">
+ <admin-label asp-for="Weight"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Weight"/> [@Model.BaseWeightIn]
+ <span asp-validation-for="Weight"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlLength">
+ <admin-label asp-for="Length"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Length"/> [@Model.BaseDimensionIn]
+ <span asp-validation-for="Length"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlWidth">
+ <admin-label asp-for="Width"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Width"/> [@Model.BaseDimensionIn]
+ <span asp-validation-for="Width"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlHeight">
+ <admin-label asp-for="Height"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Height"/> [@Model.BaseDimensionIn]
+ <span asp-validation-for="Height"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlDeliveryDate">
+ <admin-label asp-for="DeliveryDateId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="DeliveryDateId" asp-items="Model.AvailableDeliveryDates"/>
+ <span asp-validation-for="DeliveryDateId"></span>
+ </div>
+ </div>
+ </div>
+</div>
+<vc:admin-widget widget-zone="product_details_inventory_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Pictures.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Pictures.cshtml
new file mode 100644
index 000000000..068149512
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Pictures.cshtml
@@ -0,0 +1,165 @@
+@model ProductModel
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_pictures_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="productpictures-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_pictures_bottom" additional-data="Model"/>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $("#productpictures-grid").kendoGrid({
+ dataBound: function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductPictureList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductPictureDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ PictureUrl: {editable: false, type: "string" },
+ DisplayOrder: {editable: true, type: "number" },
+ IsDefault: { editable: true, type: "boolean" },
+ AltAttribute: {editable: true, type: "string" },
+ TitleAttribute: {editable: true, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "PictureUrl",
+ title: "@Loc["Admin.Catalog.Products.Pictures.Fields.Picture"]",
+ template: "<a class='k-link editpicture' href=\"@Url.Action("ProductPicturePopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshProductPictures&formId=product-form\"><img alt='#=PictureId#' src='#=PictureUrl#' width='150' /></a>",
+ width: 165
+ },
+ {
+ field: "IsDefault",
+ title: "@Loc["Admin.Catalog.Products.Pictures.Fields.IsDefault"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsDefault) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.Pictures.Fields.DisplayOrder"]",
+ minScreenWidth: 750,
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ format: "{0:0}",
+ }, {
+ field: "AltAttribute",
+ minScreenWidth: 500,
+ title: "@Loc["Admin.Catalog.Products.Pictures.Fields.OverrideAltAttribute"]",
+ }, {
+ field: "TitleAttribute",
+ title: "@Loc["Admin.Catalog.Products.Pictures.Fields.OverrideTitleAttribute"]",
+ minScreenWidth: 500,
+ }, {
+ command: [{
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
+ });
+</script>
+
+ <p>
+ <strong>@Loc["Admin.Catalog.Products.Pictures.AddNew"]</strong>
+ </p>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ @{
+ ViewData["Reference"] = "Product";
+ ViewData["ObjectId"] = Model.Id;
+ ViewData["Endpoint"] = Url.Action("ProductPictureAdd", "Product", new { area = Constants.AreaStore });
+ ViewData["Click"] = "btnRefreshProductPictures";
+ }
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AddPictureModel.PictureId"/>
+ <span asp-validation-for="AddPictureModel.PictureId"></span>
+ </div>
+ <input type="submit" id="btnRefreshProductPictures" style="display: none"/>
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshProductPictures').click(function () {
+ //refresh grid
+ var grid = $("#productpictures-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+ </div>
+ </div>
+ </div>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Pictures.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Prices.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Prices.cshtml
new file mode 100644
index 000000000..27d95349a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Prices.cshtml
@@ -0,0 +1,386 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+<vc:admin-widget widget-zone="product_details_prices_top" additional-data="Model"/>
+<div class="form-horizontal portlet bg-inverse form-fit" id="group-prices">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Price"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Price"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="Price"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <partial name="Partials/CreateOrUpdate.ProductPrices" model="Model"/>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="OldPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="OldPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="OldPrice"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CatalogPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CatalogPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="CatalogPrice"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlStartPrice">
+ <admin-label asp-for="StartPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="StartPrice"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ProductCost"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ProductCost"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="ProductCost"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisableBuyButton"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="DisableBuyButton"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="DisableBuyButton"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisableWishlistButton"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="DisableWishlistButton"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="DisableWishlistButton"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AvailableForPreOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AvailableForPreOrder"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AvailableForPreOrder"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlPreOrderDateTime">
+ <admin-label asp-for="PreOrderDateTime"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PreOrderDateTime"/>
+ <span asp-validation-for="PreOrderDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CallForPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="CallForPrice"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="CallForPrice"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EnteredPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="EnteredPrice"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="EnteredPrice"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMinEnteredPrice">
+ <admin-label asp-for="MinEnteredPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MinEnteredPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="MinEnteredPrice"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlMaxEnteredPrice">
+ <admin-label asp-for="MaxEnteredPrice"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MaxEnteredPrice"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="MaxEnteredPrice"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BasepriceEnabled"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="BasepriceEnabled"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="BasepriceEnabled"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlBasepriceAmount">
+ <admin-label asp-for="BasepriceAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BasepriceAmount"/>
+ <span asp-validation-for="BasepriceAmount"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlBasepriceUnit">
+ <admin-label asp-for="BasepriceUnitId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BasepriceUnitId" asp-items="Model.AvailableBasepriceUnits"/>
+ <span asp-validation-for="BasepriceUnitId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlBasepriceBaseAmount">
+ <admin-label asp-for="BasepriceBaseAmount"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="BasepriceBaseAmount"/>
+ <span asp-validation-for="BasepriceBaseAmount"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlBasepriceBaseUnit">
+ <admin-label asp-for="BasepriceBaseUnitId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BasepriceBaseUnitId" asp-items="Model.AvailableBasepriceBaseUnits"/>
+ <span asp-validation-for="BasepriceBaseUnitId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IsTaxExempt"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsTaxExempt"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsTaxExempt"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlTaxCategory">
+ <admin-label asp-for="TaxCategoryId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="TaxCategoryId" asp-items="Model.AvailableTaxCategories"/>
+ <span asp-validation-for="TaxCategoryId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlIsTelecommunicationsOrBroadcastingOrElectronicServices">
+ <admin-label asp-for="IsTele"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox white-bg">
+ <admin-input asp-for="IsTele"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsTele"></span>
+ </div>
+ </div>
+
+ </div>
+</div>
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.TierPrices"]
+ </div>
+ <div class="panel-body">
+ <div id="tierprices-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewTierPrice" href="@(Url.Action("TierPriceCreatePopup", "Product", new { productId = Model.Id, btnId = "btnRefreshTierPrices", formId = "product-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.TierPrices.AddNew"]</a>
+ <input type="submit" id="btnRefreshTierPrices" style="display: none"/>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewTierPrice').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#tierprices-grid").kendoGrid({
+ dataBound: function () {
+ $('.tierpriceedit').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("TierPriceList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("TierPriceDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ parameterMap: function (data, operation) {
+ if (operation === "destroy")
+ {
+ return {
+ id: data.Id,
+ productId: data.ProductId,
+ __RequestVerificationToken: data.__RequestVerificationToken
+ };
+ }
+ return data;
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductId: { editable: false, type: "string" },
+ Store: { editable: true, type: "string" },
+ StoreId: { editable: true, type: "string" },
+ CustomerGroup: { editable: true, type: "string" },
+ CustomerGroupId: { editable: true, type: "string" },
+ Quantity: { editable: true, type: "number" },
+ Price: { editable: true, type: "number" },
+ StartDateTime: { editable: false, type: "date" },
+ EndDateTime: { editable: false, type: "date" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ @if (!adminAreaSettings.HideStoreColumn)
+ {
+ <text>
+ {
+ field: "StoreId",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.Store"]",
+ template: "#:Store#"
+ },
+ </text>
+ }
+ {
+ field: "CustomerGroupId",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.CustomerGroup"]",
+ template: "#:CustomerGroup#"
+ },
+ {
+ field: "Quantity",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.Quantity"]",
+ //integer format
+ format: "{0:0}"
+ }, {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.Price"]",
+ template: "#:Price# [#:CurrencyCode#]"
+ }, {
+ field: "StartDateTime",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.StartDateTime"]",
+ format: "{0:G}"
+ }, {
+ field: "EndDateTime",
+ title: "@Loc["Admin.Catalog.Products.TierPrices.Fields.EndDateTime"]",
+ format: "{0:G}"
+ }, {
+ field: "Id",
+ title: "@Loc["Admin.Common.Edit"]",
+ template: "<a class='tierpriceedit' href=\"@Url.Action("TierPriceEditPopup", "Product", new { area = Constants.AreaStore })/#=Id#?productId=@(Model.Id)&btnId=btnRefreshTierPrices&formId=product-form\" class=\"k-button\"><span class=\"k-icon k-i-edit\"></span>&nbsp;@Loc["Admin.Common.Edit"]</a>"
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]"
+ }]
+ });
+ });
+
+ $(document).ready(function () {
+ $('#btnRefreshTierPrices').click(function () {
+ $("#tierprices-grid").data('kendoGrid').dataSource.read();
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.TierPrices.SaveBeforeEdit"]
+ </div>
+}
+
+
+@if (Model.AvailableDiscounts is { Count: > 0 })
+{
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.AvailableDiscounts"]
+ </div>
+ <div class="panel-body">
+ <div class="mt-checkbox-list">
+ @foreach (var discount in Model.AvailableDiscounts)
+ {
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <input type="checkbox" name="SelectedDiscountIds" value="@discount.Id"
+ @if (Model.SelectedDiscountIds != null && Model.SelectedDiscountIds.Contains(discount.Id))
+ {
+ <text> checked="checked" </text>
+ }/>@discount.Name
+ <div class="control__indicator"></div>
+ </label>
+ }
+ </div>
+ </div>
+ </div>
+}
+else
+{
+ <div class="note note-info">
+ @Html.Raw(Loc["Admin.Catalog.Collections.Discounts.NoDiscounts"])
+ </div>
+}
+<vc:admin-widget widget-zone="product_details_prices_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml
new file mode 100644
index 000000000..078c62814
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml
@@ -0,0 +1,231 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="note note-info">
+ <p>
+ <strong>@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Description"]</strong>
+ </p>
+ <p>
+ @Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Description2"]
+ </p>
+</div>
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_product_attributes_combinations_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="attributecombinations-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewCombination" href="@(Url.Action("AttributeCombinationPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCombinations", formId = "product-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddNew"]</a>
+ <button type="submit" id="btnGenerateAllCombinations" class="k-button"><span class="k-icon k-i-style-builder"></span>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.GenerateAll"]</button>
+ <button type="submit" id="btnClearAllCombinations" class="k-button"><span class="k-icon k-i-cut"></span>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.ClearAll"]</button>
+ <input type="submit" id="btnRefreshCombinations" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="product_details_product_attributes_combinations_bottom" additional-data="Model"/>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $('#btnAddNewCombination').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#attributecombinations-grid").kendoGrid({
+ dataBound: function () {
+ $('.editcombinationlink').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Attributes: { editable: false, type: "string" },
+ Warnings: { editable: false, type: "string" },
+ StockQuantity: { editable: true, type: "number" },
+ AllowOutOfStockOrders: { editable: true, type: "boolean" },
+ Sku: { editable: true, type: "string" },
+ Mpn: { editable: true, type: "string" },
+ Gtin: { editable: true, type: "string" },
+ OverriddenPrice: { editable: true, type: "number" },
+ NotifyAdminForQuantityBelow: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if (e.type == "update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "Attributes",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Attributes"]",
+ encoded: false,
+ template: "<a class='k-link editcombinationlink' href=\"@Url.Action("AttributeCombinationPopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshCombinations&formId=product-form\">#=Attributes#<br /> # if(Warnings !== null) {# <span style=\"color: red\">#=Warnings#</span> #} #</a>"
+ }, {
+ field: "StockQuantity",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.StockQuantity"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ //integer format
+ format: "{0:0}"
+ }, {
+ field: "AllowOutOfStockOrders",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.AllowOutOfStockOrders"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(AllowOutOfStockOrders) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "Sku",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Sku"]",
+ }, {
+ field: "OverriddenPrice",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.OverriddenPrice"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ editor: function (container, options) {
+ $('<input name="' + options.field + '"/>')
+ .appendTo(container)
+ .kendoNumericTextBox({
+ format: "{0:n4}",
+ decimals: 4
+ });
+ }
+ },
+ {
+ command: [
+ {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }
+ ],
+ width: 50
+ }
+ ]
+ });
+ });
+</script>
+
+<script>
+ $(document).ready(function () {
+ //refresh button
+ $('#btnRefreshCombinations').click(function () {
+ //refresh grid
+ var grid = $("#attributecombinations-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+
+
+ //generate combinations
+ $('#btnGenerateAllCombinations').click(function () {
+ if (confirm('@Loc["Admin.Common.AreYouSure"]')) {
+
+ var postData = {
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: 'POST',
+ url: '@Url.Action("GenerateAllAttributeCombinations", "Product", new { productId = Model.Id, area = Constants.AreaStore })',
+ data: postData,
+ dataType: 'json',
+ success: function(data) {
+ //refresh grid
+ var grid = $("#attributecombinations-grid").data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert('Error while generating attribute combinations');
+ }
+ });
+ }
+ return false;
+ });
+
+ //clear combinations
+ $('#btnClearAllCombinations').click(function () {
+ if (confirm('@Loc["Admin.Common.AreYouSure"]')) {
+
+ var postData = {
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: 'POST',
+ url: '@Url.Action("ClearAllAttributeCombinations", "Product", new { productId = Model.Id, area = Constants.AreaStore })',
+ data: postData,
+ dataType: 'json',
+ success: function(data) {
+ //refresh grid
+ var grid = $("#attributecombinations-grid").data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert('Error while clearing attribute combinations');
+ }
+ });
+ }
+ return false;
+ });
+
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributes.cshtml
new file mode 100644
index 000000000..1588b30f5
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.TabAttributes.cshtml
@@ -0,0 +1,273 @@
+@model ProductModel
+
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_product_attributes_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="productattributemappings-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_product_attributes_bottom" additional-data="Model"/>
+ <div class="panel-footer">
+ <a id="btnAddNewAttributes" href="@(Url.Action("ProductAttributeMappingPopup", "Product", new { productId = Model.Id, area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AddNew"]</a>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $('#btnAddNewAttributes').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#productattributemappings-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAttributeMappingList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductAttributeMappingDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductAttribute: { editable: true, type: "string" },
+ ProductAttributeId: { editable: true, type: "string" },
+ TextPrompt: { editable: true, type: "string" },
+ IsRequired: { editable: true, type: "boolean" },
+ AttributeControlType: { editable: true, type: "string" },
+ AttributeControlTypeId: { editable: true, type: "number" },
+ DisplayOrder: { editable: true, type: "number" },
+ ShouldHaveValues: { editable: false, type: "boolean" },
+ TotalValues: { editable: false, type: "number" },
+ ValidationRulesAllowed: { editable: false, type: "boolean" },
+ ConditionAllowed: { editable: false, type: "boolean" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ //values grid
+ detailInit: detailInit,
+ dataBound: function () {
+ var data = this.dataSource.data();
+ $.each(data, function (i, row) {
+ if (row.get("AttributeControlTypeId") == "4" || row.get("AttributeControlTypeId") == "10"
+ || row.get("AttributeControlTypeId") == "30") {
+ $('tr[data-uid="' + row.uid + '"] ').find(".k-hierarchy-cell a").remove();;
+ }
+ });
+ $('.btnMagnificPopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "ProductAttributeId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.Attribute"]",
+ width: 190,
+ template: "<a class='k-link btnMagnificPopup' href='@Url.Action("ProductAttributeMappingPopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#'>#=kendo.htmlEncode(ProductAttribute)#<br /></a>"
+ }, {
+ field: "TextPrompt",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.TextPrompt"]",
+ width: 120
+ }, {
+ field: "IsRequired",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.IsRequired"]",
+ width: 50,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsRequired) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ },
+ {
+ field: "AttributeControlTypeId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.AttributeControlType"]",
+ width: 140,
+ template: "#:AttributeControlType# <br> # if(ValidationRulesAllowed) {# <a class='btnMagnificPopup' href='@Url.Action("ProductAttributeValidationRulesPopup", "Product", new { area = Constants.AreaStore })/#=Id#?&productId=@(Model.Id)&btnId=btnRefreshProductAttributes&formId=product-form'>@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.Link"]</a><br />#=ValidationRulesString# #} #"
+ },
+ {
+ field: "ConditionAllowed",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition"]",
+ width: 80,
+ template: "# if(ConditionAllowed) {# <a class='btnMagnificPopup' href='@Url.Action("ProductAttributeConditionPopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#&btnId=btnRefreshProductAttributes&formId=product-form\'>@Loc["Admin.Common.Edit"]</a><br /> #} #"
+ },
+ {
+ command: [
+ {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }
+ ],
+ width: 50
+ }
+ ]
+ });
+ });
+ function detailInit(e) {
+ $("<div data-name='productattributevalue' data-id='" + e.data.id+"' />").appendTo(e.detailCell).kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAttributeValueList", "Product", new { area = Constants.AreaStore }))?productAttributeMappingId=" + e.data.Id + "&[email protected]",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductAttributeValueDelete", "Product", new { area = Constants.AreaStore }))?pam=" + e.data.Id + "&[email protected]",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+
+ dataBound: function () {
+ $('.btnProductAttributeValueEditPopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ $('.mfp-wrap').attr("data-id", $('.btnProductAttributeValueEditPopup.active').data("id"));
+ if (document.querySelector('.mfp-wrap').dataset.prodid !== undefined) {
+ var id = document.querySelector('.mfp-wrap').dataset.prodid;
+ var name = document.querySelector('.mfp-wrap').dataset.prodname;
+ $('#AttributeValueTypeId').val('10').change();
+ $('#AssociatedProductId').val(id);
+ $('#associate-product-name').html(name);
+ }
+ },
+ close: function () {
+ $('.mfp-wrap').removeAttr('data-prodid');
+ $('.mfp-wrap').removeAttr('data-prodname');
+ $('.btnProductAttributeValueEditPopup.active').removeClass('active');
+ $('#AttributeValueTypeId').val('0').change();
+ }
+ }
+ });
+ },
+ toolbar: [
+ {
+ template: "<a class='k-button btnProductAttributeValueEditPopup' data-id='" + e.data.Id + "' onclick=\"this.classList.add('active')\" href='@Url.Action("ProductAttributeValueCreatePopup", "Product", new { area = Constants.AreaStore })/?productAttributeMappingId=" + e.data.Id + "&[email protected]&formId=product-form&btnId=btnRefreshProductAttributesValues'>@Loc["Admin.Common.AddNew"]</a>"
+ }
+ ],
+ scrollable: false,
+ sortable: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ columns: [
+ {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name"]",
+ template: "<a class='k-link btnProductAttributeValueEditPopup' data-id='#=Id#' onclick=\"this.classList.add('active')\" href='@Url.Action("ProductAttributeValueEditPopup", "Product", new { area = Constants.AreaStore })/#=Id#?productId=@(Model.Id)&productAttributeMappingId=" + e.data.Id + "&btnId=btnRefreshProductAttributesValues&formId=product-form'>#=Name#</a>"
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]"
+ }
+ ]
+ });
+ }
+</script>
+<input type="submit" id="btnRefreshProductAttributes" style="display: none"/>
+<input type="button" id="btnRefreshProductAttributesValues" style="display: none"/>
+<script>
+ $(document).ready(function () {
+ $('#btnRefreshProductAttributes').click(function () {
+ //refresh grid
+ var grid = $("#productattributemappings-grid").data('kendoGrid');
+ grid.dataSource.read();
+ //return false to don't reload a page
+ return false;
+ });
+ $('#btnRefreshProductAttributesValues').click(function (e) {
+ //refresh grid value
+ var dataid = $(this).attr("data-id");
+ var grid = $('[data-id="' + dataid + '"]').data('kendoGrid');
+ grid.dataSource.read();
+ //return false to don't reload a page
+ return false;
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.cshtml
new file mode 100644
index 000000000..44c495ef9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductAttributes.cshtml
@@ -0,0 +1,38 @@
+@model ProductModel
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ if (Model.AvailableProductAttributes.Count > 0)
+ {
+ <admin-tabstrip name="productattribute-edit">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.ProductAttributes.Attributes"]" tab-index="100" class="k-state-active">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.ProductAttributes.TabAttributes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations"]" tab-index="101">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.ProductAttributes.TabAttributeCombinations" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="product_details_attribute_details_tabs" additional-data="Model"/>
+ </items>
+ </admin-tabstrip>
+ }
+ else
+ {
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.ProductAttributes.NoAttributesAvailable"]
+ </div>
+ }
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.ProductAttributes.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductPrices.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductPrices.cshtml
new file mode 100644
index 000000000..3a2355db7
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.ProductPrices.cshtml
@@ -0,0 +1,147 @@
+@using Grand.Business.Core.Interfaces.Common.Directory
+@model ProductModel
+@inject ICurrencyService currencyService
+@{
+ var currencies = await currencyService.GetAllCurrencies();
+ var defaultCurrency = await currencyService.GetPrimaryStoreCurrency();
+ currencies = currencies.Where(x => x.Id != defaultCurrency.Id).ToList();
+}
+@if (!string.IsNullOrEmpty(Model.Id) && currencies.Count > 0)
+{
+ if (currencies.Count > 0)
+ {
+ <div class="panel panel-default">
+ <div class="panel-body">
+ <div id="productprices-grid"></div>
+ </div>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $("#productprices-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductPriceList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ create: {
+ url: "@Html.Raw(Url.Action("ProductPriceInsert", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductPriceUpdate", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductPriceDelete", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ CurrencyCode: { editable: true, type: "string" },
+ Price: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CurrencyCode",
+ title: "@Loc["Admin.Catalog.Products.ProductPrices.Fields.CurrencyCode"]",
+ width: 200,
+ editor: currencyDropDownEditor,
+ template: '#:CurrencyCode#'
+ },
+ {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.Products.ProductPrices.Fields.Price"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ format: "{0:n2}"
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
+ });
+
+ //local datasource
+ var allCurrencies = [
+ @for (var i = 0; i < currencies.Count; i++)
+ {
+ var currencyItem = currencies[i];
+ <text>
+ {
+ Id: '@(currencyItem.CurrencyCode)',
+ Name: "@(currencyItem.CurrencyCode)"
+ }
+ </text>
+ if (i != currencies.Count - 1)
+ {
+ <text>,</text>
+ }
+ }
+ ];
+
+ function currencyDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CurrencyCode"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autoBind: true,
+ dataSource: allCurrencies
+ });
+ }
+ </script>
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.PurchasedWithOrders.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.PurchasedWithOrders.cshtml
new file mode 100644
index 000000000..3b94ef6c1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.PurchasedWithOrders.cshtml
@@ -0,0 +1,94 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_purchased_with_orders_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="purchased-with-orders-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_purchased_with_orders_bottom" additional-data="Model"/>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#purchased-with-orders-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("PurchasedWithOrders", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "OrderNumber",
+ title: "@Loc["Admin.Orders.Fields.ID"]",
+ width: 80,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=Id#">#=OrderNumber#</a>',
+ }, {
+ field: "CustomerEmail",
+ title: "@Loc["Admin.Orders.Fields.CustomerEmail"]",
+ width: 200,
+ minScreenWidth: 500,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:CustomerEmail#</a>'
+ },
+ {
+ field: "OrderStatus",
+ title: "@Loc["Admin.Orders.Fields.OrderStatus"]",
+ width: 100,
+ minScreenWidth: 500,
+ template: '<h4><span class="label label-' +
+ '# if(OrderStatusId == 10) {#warning #} #' +
+ '# if(OrderStatusId == 20) {#info #} #' +
+ '# if(OrderStatusId == 25) {#info #} #' +
+ '# if(OrderStatusId == 30) {#success #} #' +
+ '# if(OrderStatusId == 40) {#danger #} #' +
+ '">#=OrderStatus#</span></h4>'
+ },
+ {
+ field: "PaymentStatus",
+ title: "@Loc["Admin.Orders.Fields.PaymentStatus"]",
+ width: 100,
+ minScreenWidth: 500,
+ },
+ {
+ field: "ShippingStatus",
+ title: "@Loc["Admin.Orders.Fields.ShippingStatus"]",
+ width: 100,
+ minScreenWidth: 500,
+ },
+ {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.Fields.CreatedOn"]",
+ width: 150,
+ type: "date",
+ format: "{0:G}"
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Recommended.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Recommended.cshtml
new file mode 100644
index 000000000..d061a6519
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Recommended.cshtml
@@ -0,0 +1,116 @@
+@model ProductModel
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_recommended_top" additional-data="Model"/>
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.Recommended"]
+ </div>
+ <div class="panel-body">
+ <div id="recommendedproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewRecommendedProduct" href="@(Url.Action("RecommendedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRecommendedProducts", formId = "product-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.Recommended.AddNew"]</a>
+ <input type="submit" id="btnRefreshRecommendedProducts" style="display: none"/>
+ </div>
+ <vc:admin-widget widget-zone="product_details_recommended_bottom" additional-data="Model"/>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewRecommendedProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#recommendedproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("RecommendedProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("RecommendedProductDelete", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ ProductId: { editable: false, type: "string" },
+ Product2Name: { editable: false, type: "string" },
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "Product2Name",
+ title: "@Loc["Admin.Catalog.Products.Recommended.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Product2Name)#</a>',
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ }
+ ]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshRecommendedProducts').click(function () {
+ //refresh grid
+ var grid = $("#recommendedproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.Recommended.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.RelatedProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.RelatedProducts.cshtml
new file mode 100644
index 000000000..2f81db741
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.RelatedProducts.cshtml
@@ -0,0 +1,142 @@
+@model ProductModel
+
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.RelatedProducts"]
+ </div>
+ <div class="panel-body">
+ <div id="relatedproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewRelatedProduct" href="@(Url.Action("RelatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRelatedProducts", formId = "product-form", area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.RelatedProducts.AddNew"]</a>
+ <input type="submit" id="btnRefreshRelatedProducts" style="display: none"/>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewRelatedProduct').magnificPopup({
+ type: 'ajax',
+ midClick: true,
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#relatedproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("RelatedProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("RelatedProductUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("RelatedProductDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Product2Name: { editable: false, type: "string" },
+ DisplayOrder: {editable: true, type: "number" },
+ ProductId2: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Product2Name",
+ title: "@Loc["Admin.Catalog.Products.RelatedProducts.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',
+ }, {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.RelatedProducts.Fields.DisplayOrder"]",
+ //integer format
+ format: "{0:0}",
+ width: 120,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }]
+ }]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshRelatedProducts').click(function () {
+ //refresh grid
+ var grid = $("#relatedproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.RelatedProducts.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Reviews.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Reviews.cshtml
new file mode 100644
index 000000000..51f45a66f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Reviews.cshtml
@@ -0,0 +1,86 @@
+@model ProductModel
+@inject AdminAreaSettings adminAreaSettings
+
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_reviews_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="reviews-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_reviews_bottom" additional-data="Model"/>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#reviews-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("Reviews", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CustomerId",
+ title: "@Loc["Admin.Catalog.ProductReviews.Fields.Customer"]",
+ width: 200,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:CustomerInfo#</a>',
+ minScreenWidth: 750,
+ },
+ {
+ field: "Title",
+ title: "@Loc["Admin.Catalog.ProductReviews.Fields.Title"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "ProductReview", new { area = Constants.AreaStore })/#=Id#">#:Title#</a>',
+ width: 280,
+ },
+ {
+ field: "Rating",
+ title: "@Loc["Admin.Catalog.ProductReviews.Fields.Rating"]",
+ width: 60,
+ minScreenWidth: 500,
+ },
+ {
+ field: "IsApproved",
+ title: "@Loc["Admin.Catalog.ProductReviews.Fields.IsApproved"]",
+ width: 80,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(IsApproved) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #',
+ minScreenWidth: 500,
+ },
+ {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.Fields.CreatedOn"]",
+ width: 150,
+ type: "date",
+ format: "{0:G}",
+ minScreenWidth: 500,
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SEO.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SEO.cshtml
new file mode 100644
index 000000000..509467fe0
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SEO.cshtml
@@ -0,0 +1,74 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model ProductModel
+<vc:admin-widget widget-zone="product_details_seo_top" additional-data="Model"/>
+
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaKeywords"/>
+ <span asp-validation-for="@Model.Locales[item].MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="@Model.Locales[item].MetaDescription"></admin-textarea>
+ <span asp-validation-for="@Model.Locales[item].MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].MetaTitle"/>
+ <span asp-validation-for="@Model.Locales[item].MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].SeName"/>
+ <span asp-validation-for="@Model.Locales[item].SeName"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+
+<div class="form-horizontal">
+ <localized-editor localized-template="@template" name="product-seo-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="MetaKeywords"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaKeywords"/>
+ <span asp-validation-for="MetaKeywords"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaDescription"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="MetaDescription"></admin-textarea>
+ <span asp-validation-for="MetaDescription"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="MetaTitle"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="MetaTitle"/>
+ <span asp-validation-for="MetaTitle"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SeName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SeName"/>
+ <span asp-validation-for="SeName"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+</div>
+<vc:admin-widget widget-zone="product_details_seo_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml
new file mode 100644
index 000000000..511a2fe09
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml
@@ -0,0 +1,142 @@
+@model ProductModel
+
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ @Loc["Admin.Catalog.Products.SimilarProducts"]
+ </div>
+ <div class="panel-body">
+ <div id="similarproducts-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaStore })) " class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]</a>
+ <input type="submit" id="btnRefreshSimilarProducts" style="display: none"/>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnAddNewSimilarProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ $("#similarproducts-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("SimilarProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("SimilarProductUpdate", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("SimilarProductDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Product2Name: { editable: false, type: "string" },
+ DisplayOrder: {editable: true, type: "number" },
+ ProductId2: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function(e) {
+ if(e.type=="update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Product2Name",
+ title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.Product"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',
+ }, {
+ field: "DisplayOrder",
+ title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.DisplayOrder"]",
+ //integer format
+ format: "{0:0}",
+ width: 120,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ }, {
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }]
+ }]
+ });
+ });
+ </script>
+
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshSimilarProducts').click(function () {
+ //refresh grid
+ var grid = $("#similarproducts-grid").data('kendoGrid');
+ grid.dataSource.read();
+
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.SimilarProducts.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SpecificationAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SpecificationAttributes.cshtml
new file mode 100644
index 000000000..21805ad8f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SpecificationAttributes.cshtml
@@ -0,0 +1,159 @@
+@model ProductModel
+
+@if (!string.IsNullOrEmpty(Model.Id))
+{
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="product_details_specification_attribute_details_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="specificationattributes-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_specification_attribute_details_bottom" additional-data="Model"/>
+ <div class="panel-footer">
+ <a id="btnAddNewSpecification" href="@(Url.Action("ProductSpecAttrPopup", "Product", new { productId = Model.Id, area = Constants.AreaStore }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.SpecificationAttributes.AddButton"]</a>
+ </div>
+ </div>
+
+ <script>
+ $(document).ready(function () {
+
+ $('#btnAddNewSpecification').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+
+ $("#specificationattributes-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductSpecAttrList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductSpecAttrDelete", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ AttributeTypeName: { editable: false, type: "string" },
+ AttributeTypeId: { editable: false, type: "int" },
+ AttributeName: { editable: false, type: "string" },
+ ValueRaw: { editable: false, type: "string" },
+ AllowFiltering: { editable: false, type: "boolean" },
+ ShowOnProductPage: { editable: false, type: "boolean" },
+ DisplayOrder: { editable: false, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ autoBind: false,
+ dataBound: function () {
+ var data = this.dataSource.data();
+ $('.btnMagnificPopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "AttributeTypeName",
+ title: "@Loc["Admin.Catalog.Products.SpecificationAttributes.Fields.AttributeType"]",
+ template: "<a class='k-link btnMagnificPopup' href='@Url.Action("ProductSpecAttrPopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&id=#=Id#'>#=kendo.htmlEncode(AttributeTypeName)#</a>"
+ }, {
+ field: "ValueRaw",
+ encoded: false,
+ title: "@Loc["Admin.Catalog.Products.SpecificationAttributes.Fields.Value"]",
+ template: "<a class='k-link btnMagnificPopup' href='@Url.Action("ProductSpecAttrPopup", "Product", new { area = Constants.AreaStore })/?productId=@(Model.Id)&id=#=Id#'>#=kendo.htmlEncode(AttributeName)# : #=ValueRaw# </a>"
+ }, {
+ field: "AllowFiltering",
+ title: "@Loc["Admin.Catalog.Products.SpecificationAttributes.Fields.AllowFiltering"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(AllowFiltering) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "ShowOnProductPage",
+ title: "@Loc["Admin.Catalog.Products.SpecificationAttributes.Fields.ShowOnProductPage"]",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(ShowOnProductPage) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ command: [
+ {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }
+ ]
+ }]
+ });
+ });
+ </script>
+ <input type="submit" id="btnRefreshProductSpec" style="display: none"/>
+ <script>
+ $(document).ready(function () {
+ $('#btnRefreshProductSpec').click(function () {
+ //refresh grid
+ var grid = $("#specificationattributes-grid").data('kendoGrid');
+ grid.dataSource.read();
+ //return false to don't reload a page
+ return false;
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.SpecificationAttributes.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.cshtml
new file mode 100644
index 000000000..51140f456
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.cshtml
@@ -0,0 +1,153 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model ProductModel
+@inject IPermissionService permissionService
+@{
+ //has "Manage Documents" permission?
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<input asp-for="Ticks" type="hidden"/>
+<admin-tabstrip name="product-edit" SetTabPos="true" BindGrid="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Info" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Prices"]" tab-index="1" id="tab-price-product">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Prices" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Additional"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Additional" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.SEO"]" tab-index="3">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.SEO" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Pictures"]" tab-index="4">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Pictures" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Mappings"]" tab-index="5">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Categories" model="Model"/>
+ <partial name="Partials/CreateOrUpdate.Collections" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Inventory"]" tab-index="6" id="tab-inventory-product">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Inventory" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.SpecificationAttributes"]" tab-index="7">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.SpecificationAttributes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.ProductAttributes"]" tab-index="8" id="tab-attributes-product">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.ProductAttributes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.BundleProducts"]" tab-index="9" id="tab-bundle-products">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.BundleProducts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Calendar"]" tab-index="10" id="tab-calendar">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Calendar" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Bids"]" tab-index="11" id="tab-bids">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Bids" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.LinkedProducts"]" tab-index="12">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.RelatedProducts" model="Model"/>
+ <partial name="Partials/CreateOrUpdate.CrossSells" model="Model"/>
+ <partial name="Partials/CreateOrUpdate.SimilarProducts" model="Model"/>
+ <partial name="Partials/CreateOrUpdate.Recommended" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.AssociatedProducts"]" tab-index="13" id="tab-associated-products">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.AssociatedProducts" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (!string.IsNullOrEmpty(Model.Id))
+ {
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.PurchasedWithOrders"]" tab-index="14" id="tab-purchased-product">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.PurchasedWithOrders" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Reviews"]" tab-index="15">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Reviews" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Catalog.Products.Documents"]" tab-index="16">
+ <content>
+ <div>
+ <partial name="Partials/CreateOrUpdate.Documents" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="17">
+ <content>
+ <div>
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <vc:admin-widget widget-zone="product_details_tabs" additional-data="Model"/>
+ </items>
+</admin-tabstrip>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateProductAttributeValue.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateProductAttributeValue.cshtml
new file mode 100644
index 000000000..6b635414f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateProductAttributeValue.cshtml
@@ -0,0 +1,223 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model ProductModel.ProductAttributeValueModel
+
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<input asp-for="ProductAttributeMappingId" type="hidden"/>
+<input asp-for="DisplayColorSquaresRgb" type="hidden"/>
+<input asp-for="DisplayImageSquaresPicture" type="hidden"/>
+
+
+<script>
+ $(document).ready(function () {
+
+ $("#@Html.IdFor(model => model.AttributeValueTypeId)").change(toggleProductType);
+
+ toggleProductType();
+ });
+
+ $('#btnAssociateProductToAttributeValuePopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ midClick: true,
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+
+ function toggleProductType() {
+ var selectedProductTypeId = $("#@Html.IdFor(model => model.AttributeValueTypeId)").val();
+ if (selectedProductTypeId == @(((int)AttributeValueType.Simple).ToString())) {
+ $('#group-associated-product').hide();
+ $('#group-quantity').hide();
+ $('#group-weight-adjustment').show();
+ $('#group-cost').show();
+ } else if (selectedProductTypeId == @(((int)AttributeValueType.AssociatedToProduct).ToString())) {
+ $('#group-associated-product').show();
+ $('#group-quantity').show();
+ $('#group-weight-adjustment').hide();
+ $('#group-cost').hide();
+ }
+ }
+</script>
+<!-- #region languages template -->
+@{
+ Func<int, HelperResult>
+ template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].Name" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].Name"/>
+ <span asp-validation-for="@Model.Locales[item].Name"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+}
+<!-- #endregion -->
+
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AttributeValueTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="AttributeValueTypeId" asp-items="EnumTranslationService.ToSelectList(Model.AttributeValueTypeId)"/>
+ <span asp-validation-for="AttributeValueTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="group-associated-product">
+ <admin-label asp-for="AssociatedProductId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <input asp-for="AssociatedProductId" type="hidden"/>
+ <span id="associate-product-name">@Model.AssociatedProductName</span>
+ <span asp-validation-for="AssociatedProductId"></span>
+ <a id="btnAssociateProductToAttributeValuePopup" href="@(Url.Action("AssociateProductToAttributeValuePopup", "Product", new { productIdInput = Html.IdFor(model => model.AssociatedProductId), productNameInput = "associate-product-name", area = Constants.AreaStore }))" class="k-button">
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"]
+ </a>
+ </div>
+ </div>
+ <div class="form-group" id="group-quantity">
+ <admin-label asp-for="Quantity" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Quantity"/>
+ <span asp-validation-for="Quantity"></span>
+ </div>
+ </div>
+ </div>
+
+ <localized-editor localized-template="@template" name="productattributevalue-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Name" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+
+ <div class="form-body">
+ @if (Model.DisplayColorSquaresRgb)
+ {
+ <div class="form-group">
+ <admin-label asp-for="ColorSquaresRgb" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ColorSquaresRgb"/>
+ <div id="color-picker"></div>
+ <script>
+ $(document).ready(function(){
+ $('#color-picker').farbtastic('#@Html.IdFor(model => model.ColorSquaresRgb)');
+ });
+ </script>
+ <span asp-validation-for="ColorSquaresRgb"></span>
+ </div>
+ </div>
+ }
+ @if (Model.DisplayImageSquaresPicture)
+ {
+ <div class="form-group">
+ @{
+ ViewData["Reference"] = "Product";
+ ViewData["ObjectId"] = Model.ProductId;
+ }
+ <admin-label asp-for="ImageSquaresPictureId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ImageSquaresPictureId"/>
+ <span asp-validation-for="ImageSquaresPictureId"></span>
+ </div>
+ </div>
+ }
+ <div class="form-group" id="group-price-adjustment">
+ <admin-label asp-for="PriceAdjustment" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PriceAdjustment"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="PriceAdjustment"></span>
+ </div>
+ </div>
+ <div class="form-group" id="group-weight-adjustment">
+ <admin-label asp-for="WeightAdjustment" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="WeightAdjustment"/>
+ <span asp-validation-for="WeightAdjustment"></span>
+ </div>
+ </div>
+ <div class="form-group" id="group-cost">
+ <admin-label asp-for="Cost" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Cost"/> [@Model.PrimaryStoreCurrencyCode]
+ <span asp-validation-for="Cost"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IsPreSelected" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsPreSelected"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsPreSelected"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PictureId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <ul style="list-style: none;">
+ <li style="float: left; width: 110px;">
+ <p style="float: left; padding-top: 20px;">
+ <input type="radio" name="@Html.NameFor(x => x.PictureId)" value="0" id="id_image_0"
+ @if (!string.IsNullOrEmpty(Model.PictureId))
+ {
+ <text> checked="checked" </text>
+ }>
+ </p>
+ <p style="float: left; padding-top: 20px;">
+ <label for="id_image_0">
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Picture.NoPicture"]
+ </label>
+ </p>
+ </li>
+ @foreach (var picture in Model.ProductPictureModels)
+ {
+ <li style="float: left; width: 110px;">
+ <p style="float: left; padding-top: 20px;">
+ <input type="radio" name="@Html.NameFor(x => x.PictureId)" value="@picture.PictureId" id="[email protected]"
+ @if (picture.PictureId == Model.PictureId)
+ {
+ <text> checked="checked" </text>
+ }>
+ </p>
+ <p style="float: left;">
+ <label for="[email protected]">
+ <img src="@picture.PictureUrl" alt="" title="" width="75">
+ </label>
+ </p>
+ </li>
+ }
+ </ul>
+ <span asp-validation-for="PictureId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <vc:admin-widget widget-zone="product_details_attribute_value_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateTierPrice.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateTierPrice.cshtml
new file mode 100644
index 000000000..628574efb
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdateTierPrice.cshtml
@@ -0,0 +1,69 @@
+@model ProductModel.TierPriceModel
+
+<div asp-validation-summary="All"></div>
+<input asp-for="Id" type="hidden"/>
+<input asp-for="ProductId" type="hidden"/>
+
+<div class="form-horizontal">
+ <vc:admin-widget widget-zone="product_details_tier_price_top" additional-data="Model"/>
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="Quantity" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Quantity"/>
+ <span asp-validation-for="Quantity"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Price" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Price"/>
+ <span asp-validation-for="Price"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CurrencyCode" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="CurrencyCode" asp-items="Model.AvailableCurrencies"/>
+ <span asp-validation-for="CurrencyCode"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="StoreId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="StoreId" asp-items="Model.AvailableStores"/>
+ <span asp-validation-for="StoreId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="CustomerGroupId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="CustomerGroupId" asp-items="Model.AvailableCustomerGroups"/>
+ <span asp-validation-for="CustomerGroupId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="StartDateTime" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDateTime"/>
+ <span asp-validation-for="StartDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDateTime" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDateTime"/>
+ <span asp-validation-for="EndDateTime"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <vc:admin-widget widget-zone="product_details_tier_price_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <vc:admin-widget widget-zone="product_details_tier_price_bottom" additional-data="Model"/>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/ProductAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/ProductAttributes.cshtml
new file mode 100644
index 000000000..09b543f61
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/ProductAttributes.cshtml
@@ -0,0 +1,96 @@
+@model IList<ProductAttributeCombinationModel.ProductAttributeModel>
+@if (Model.Count > 0)
+{
+ <div class="form-group">
+ @foreach (var attribute in Model)
+ {
+ var controlId = $"attributes[{attribute.Id}]";
+ var textPrompt = !string.IsNullOrEmpty(attribute.TextPrompt) ? attribute.TextPrompt : attribute.Name;
+ <div class="form-group">
+ <div class="col-md-3 col-sm-3">
+ @if (attribute.IsRequired)
+ {
+ <span class="required">*</span>
+ }
+ <label class="control-label">@textPrompt</label>
+ </div>
+ <div class="col-md-9 col-sm-9">
+ @switch (attribute.AttributeControlType)
+ {
+ case AttributeControlType.DropdownList:
+ {
+ <select name="@(controlId)" id="@(controlId)" class="form-control">
+ @if (!attribute.IsRequired)
+ {
+ <option value="">---</option>
+ }
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <option selected="@attributeValue.IsPreSelected" value="@attributeValue.Id">
+ @attributeValue.Name
+ </option>
+ }
+ </select>
+ }
+ break;
+ case AttributeControlType.RadioList:
+ case AttributeControlType.ColorSquares:
+ case AttributeControlType.ImageSquares:
+ {
+ foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <label>
+ <input id="@(controlId)" type="radio" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected"/>
+ @attributeValue.Name
+ </label>
+ </div>
+ }
+ }
+ break;
+ case AttributeControlType.Checkboxes:
+ case AttributeControlType.ReadonlyCheckboxes:
+ {
+ foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <label>
+ <input id="@(controlId)" type="checkbox" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected" @(attribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ? Html.Raw(" disabled=\"disabled\"") : null)/>
+ @attributeValue.Name
+ </label>
+ </div>
+ }
+ }
+ break;
+ case AttributeControlType.TextBox:
+ {
+ <input name="@(controlId)" type="text" id="@(controlId)" class="form-control"/>
+ }
+ break;
+ case AttributeControlType.MultilineTextbox:
+ {
+ <textarea cols="20" id="@(controlId)" name="@(controlId)" rows="2" class="form-control"></textarea>
+ }
+ break;
+ case AttributeControlType.Datepicker:
+ {
+ <date-picker-dropdown control-day="@(controlId + "_day")"
+ control-month="@(controlId + "_month")"
+ control-year="@(controlId + "_year")"
+ begin-year="@(DateTime.Now.Year)"
+ end-year="@(DateTime.Now.Year + 1)"
+ PartialViewName="Partials/DateDropDowns"
+ class="col-12 input-group"/>
+ }
+ break;
+ case AttributeControlType.FileUpload:
+ {
+ <input type="file" id="@(controlId)" name="@(controlId)" class="form-control"/>
+ }
+ break;
+ }
+ </div>
+ </div>
+ }
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeConditionPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeConditionPopup.cshtml
new file mode 100644
index 000000000..52e99442d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeConditionPopup.cshtml
@@ -0,0 +1,205 @@
+@model ProductAttributeConditionModel
+@{
+ Layout = "";
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition"];
+}
+<form id="ProductAttributeConditionPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductAttributeConditionPopup" enctype="multipart/form-data" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-productAttributeMappingId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductAttributeMappingId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <div asp-validation-summary="All"></div>
+ <input asp-for="ProductId" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition"]
+ </div>
+ </div>
+ <div class="note note-info">
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition.Description"]
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="EnableCondition" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="EnableCondition"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="EnableCondition"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlAttributes">
+ @if (Model.ProductAttributes.Count > 0)
+ {
+ var attributesList = new List<SelectListItem>();
+ foreach (var attribute in Model.ProductAttributes)
+ {
+ attributesList.Add(new SelectListItem { Text = attribute.Name, Value = attribute.Id });
+ }
+
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group" id="pnlBasepriceUnit">
+ <admin-label asp-for="SelectedProductAttributeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SelectedProductAttributeId" asp-items="@(attributesList)"/>
+ <script>
+
+ $("#@Html.IdFor(model => model.SelectedProductAttributeId)").change(toggleProductAttributes);
+
+ toggleProductAttributes();
+
+
+ function toggleProductAttributes() {
+ var selectedProductAttributeId = $("#@Html.IdFor(model => model.SelectedProductAttributeId)").val();
+ $('[id^="pnl_attribute_values_"]').hide();
+ $('#pnl_attribute_values_' + selectedProductAttributeId).show();
+ }
+ </script>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 col-md-3"></label>
+ <div class="col-md-9 col-sm-9">
+ @foreach (var attribute in Model.ProductAttributes)
+ {
+ var controlId = $"attributes[{attribute.Id}]";
+ <div id="@($"pnl_attribute_values_{attribute.Id}")">
+ @switch (attribute.AttributeControlType)
+ {
+ case AttributeControlType.DropdownList:
+ {
+ <select class="form-control" name="@(controlId)" id="@(controlId)">
+ @if (!attribute.IsRequired)
+ {
+ <option value="">---</option>
+ }
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <option selected="@attributeValue.IsPreSelected" value="@attributeValue.Id">
+ @attributeValue.Name
+ </option>
+ }
+ </select>
+ }
+ break;
+ case AttributeControlType.RadioList:
+ case AttributeControlType.ColorSquares:
+ case AttributeControlType.ImageSquares:
+ {
+ <ul style="list-style-type: none;">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <li>
+ <input id="@(controlId)" type="radio" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected"/>
+ <label for="@(controlId)">@attributeValue.Name</label>
+ </li>
+ }
+ </ul>
+ }
+ break;
+ case AttributeControlType.Checkboxes:
+ {
+ <ul style="list-style-type: none;">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <li>
+ <input id="@(controlId)" type="checkbox" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected" @(attribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ? Html.Raw(" disabled=\"disabled\"") : null)/>
+ <label for="@(controlId)">@attributeValue.Name</label>
+ </li>
+ }
+ </ul>
+ }
+ break;
+ case AttributeControlType.ReadonlyCheckboxes:
+ case AttributeControlType.TextBox:
+ case AttributeControlType.MultilineTextbox:
+ case AttributeControlType.Datepicker:
+ case AttributeControlType.FileUpload:
+ default:
+ break;
+ }
+ </div>
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+ }
+ else
+ {
+ <div class="note note-info">No attribute exists that could be used as condition</div>
+ }
+ </div>
+ <div class="form-actions">
+ <div class="row">
+ <div class="offset-md-3 offset-sm-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeConditionPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function toggleEnableCondition() {
+ if ($('#@Html.IdFor(model => model.EnableCondition)').is(':checked')) {
+ $('#pnlAttributes').show();
+ } else {
+ $('#pnlAttributes').hide();
+ }
+ }
+
+ $("#@Html.IdFor(model => model.EnableCondition)").click(toggleEnableCondition);
+
+ toggleEnableCondition();
+ </script>
+
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeMappingPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeMappingPopup.cshtml
new file mode 100644
index 000000000..d64dad535
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeMappingPopup.cshtml
@@ -0,0 +1,139 @@
+@model ProductModel.ProductAttributeMappingModel
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Details"];
+}
+<form id="ProductAttributeMappingPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductAttributeMappingPopup" enctype="multipart/form-data" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-productAttributeMappingId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductAttributeMappingId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <div asp-validation-summary="All"></div>
+ <input asp-for="ProductId" type="hidden"/>
+ <input asp-for="Id" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @if (string.IsNullOrEmpty(Model.Id))
+ {
+ <text> @Loc["Admin.Catalog.Products.ProductAttributes.AddNew"]</text>
+ }
+ else
+ {
+ <text>@Loc["Admin.Catalog.Products.ProductAttributes.Edit"]</text>
+ }
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="ProductAttribute"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ProductAttributeId" asp-items="Model.AvailableProductAttribute"/>
+ <span asp-validation-for="ProductAttributeId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TextPrompt"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="TextPrompt"/>
+ <span asp-validation-for="TextPrompt"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IsRequired" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsRequired"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsRequired"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnCatalogPage" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnCatalogPage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnCatalogPage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AttributeControlType"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="AttributeControlTypeId" asp-items="EnumTranslationService.ToSelectList(Model.AttributeControlTypeId, valuesToExclude: [(int)AttributeControlType.Hidden])"/>
+ <span asp-validation-for="AttributeControlTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Combination" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="Combination"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="Combination"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeMappingPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValidationRulesPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValidationRulesPopup.cshtml
new file mode 100644
index 000000000..b2a17d0c7
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValidationRulesPopup.cshtml
@@ -0,0 +1,111 @@
+@model ProductModel.ProductAttributeMappingModel
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules"];
+
+ var attributeControlType = Model.AttributeControlTypeId;
+}
+<form id="ProductAttributeValidationRulesPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductAttributeValidationRulesPopup" enctype="multipart/form-data" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group" @(attributeControlType != AttributeControlType.TextBox && attributeControlType != AttributeControlType.MultilineTextbox ? Html.Raw("style='display: none;'") : null)>
+ <admin-label asp-for="ValidationMinLength" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ValidationMinLength"/>
+ <span asp-validation-for="ValidationMinLength"></span>
+ </div>
+ </div>
+ <div class="form-group" @(attributeControlType != AttributeControlType.TextBox && attributeControlType != AttributeControlType.MultilineTextbox ? Html.Raw("style='display: none;'") : null)>
+ <admin-label asp-for="ValidationMaxLength" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ValidationMaxLength"/>
+ <span asp-validation-for="ValidationMaxLength"></span>
+ </div>
+ </div>
+ <div class="form-group" @(attributeControlType != AttributeControlType.FileUpload ? Html.Raw("style='display: none;'") : null)>
+ <admin-label asp-for="ValidationFileAllowedExtensions" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ValidationFileAllowedExtensions"/>
+ <span asp-validation-for="ValidationFileAllowedExtensions"></span>
+ </div>
+ </div>
+ <div class="form-group" @(attributeControlType != AttributeControlType.FileUpload ? Html.Raw("style='display: none;'") : null)>
+ <admin-label asp-for="ValidationFileMaximumSize" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ValidationFileMaximumSize"/>
+ <span asp-validation-for="ValidationFileMaximumSize"></span>
+ </div>
+ </div>
+ <div class="form-group" @(attributeControlType != AttributeControlType.TextBox && attributeControlType != AttributeControlType.MultilineTextbox ? Html.Raw("style='display: none;'") : null)>
+ <admin-label asp-for="DefaultValue" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DefaultValue"/>
+ <span asp-validation-for="DefaultValue"></span>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="row">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ @if (!Model.ValidationRulesAllowed)
+ {
+ <div class="note note-danger">This attribute type cannot have validation rules</div>
+ }
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeValidationRulesPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueCreatePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueCreatePopup.cshtml
new file mode 100644
index 000000000..73afd065a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueCreatePopup.cshtml
@@ -0,0 +1,59 @@
+@model ProductModel.ProductAttributeValueModel
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.AddNew"];
+}
+<form id="ProductAttributeValueCreatePopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductAttributeValueCreatePopup" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-productAttributeMappingId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductAttributeMappingId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdateProductAttributeValue" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ $("#ProductAttributeValueCreatePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ $.magnificPopup.instance.close();
+ $('#btnRefreshProductAttributesValues').attr('data-id', '@Model.ProductAttributeMappingId');
+ $('#btnRefreshProductAttributesValues').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueEditPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueEditPopup.cshtml
new file mode 100644
index 000000000..c5ad07ff7
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductAttributeValueEditPopup.cshtml
@@ -0,0 +1,60 @@
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.EditValueDetails"];
+}
+@model ProductModel.ProductAttributeValueModel
+<form id="ProductAttributeValueEditPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductAttributeValueEditPopup" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-productAttributeMappingId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductAttributeMappingId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.EditValueDetails"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdateProductAttributeValue" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeValueEditPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributesValues').attr('data-id', '@Model.ProductAttributeMappingId');
+ $('#btnRefreshProductAttributesValues').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductPicturePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductPicturePopup.cshtml
new file mode 100644
index 000000000..e2d9be7d1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductPicturePopup.cshtml
@@ -0,0 +1,152 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model ProductModel.ProductPictureModel
+@{
+ Layout = "";
+}
+<form id="ProductPicturePopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="ProductPicturePopup" enctype="multipart/form-data" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-Id="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <!-- #region languages template -->
+ @{
+ Func<int, HelperResult> template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].AltAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].AltAttribute"/>
+ <span asp-validation-for="@Model.Locales[item].AltAttribute"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].TitleAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].TitleAttribute"/>
+ <span asp-validation-for="@Model.Locales[item].TitleAttribute"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+ }
+
+ <div asp-validation-summary="All"></div>
+ <input asp-for="ProductId" type="hidden"/>
+ <input asp-for="Id" type="hidden"/>
+ <input asp-for="PictureUrl" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ <text> @Loc["Admin.Catalog.Products.Pictures.Details"]</text>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="PictureUrl"/>
+ <div class="col-md-9 col-sm-9">
+ <a href="@Model.PictureUrl" target="_blank">
+ <img src="@Model.PictureUrl" width="150"/>
+ </a>
+ </div>
+ </div>
+ <localized-editor localized-template="template" name="productpicturevalue-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AltAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AltAttribute"/>
+ <span asp-validation-for="AltAttribute"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TitleAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="TitleAttribute"/>
+ <span asp-validation-for="TitleAttribute"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="IsDefault"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="IsDefault"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="IsDefault"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="Style"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Style"/>
+ <span asp-validation-for="Style"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExtraField"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExtraField"/>
+ <span asp-validation-for="ExtraField"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductPicturePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductPictures').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductSpecAttrPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductSpecAttrPopup.cshtml
new file mode 100644
index 000000000..3d27fb777
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/ProductSpecAttrPopup.cshtml
@@ -0,0 +1,201 @@
+@model ProductModel.AddProductSpecificationAttributeModel
+@{
+ Layout = "";
+}
+<form id="ProductSpecificationPopup" asp-area="@Constants.AreaStore"
+ asp-controller="Product" asp-action="ProductSpecAttrPopup"
+ enctype="multipart/form-data" method="post"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-Id="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])">
+
+ <div asp-validation-summary="All"></div>
+ <input asp-for="ProductId" type="hidden"/>
+ <input asp-for="Id" type="hidden"/>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @if (string.IsNullOrEmpty(Model.Id))
+ {
+ <text> @Loc["Admin.Catalog.Products.SpecificationAttributes.AddNew"]</text>
+ }
+ else
+ {
+ <text>@Loc["Admin.Catalog.Products.SpecificationAttributes.Edit"]</text>
+ }
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AttributeTypeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="AttributeTypeId" asp-items="EnumTranslationService.ToSelectList(Model.AttributeTypeId)"/>
+ <span asp-validation-for="AttributeTypeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="disableOnCustom">
+ <admin-label asp-for="SpecificationAttributeId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SpecificationAttributeId" asp-items="Model.AvailableAttributes"/>
+ <span asp-validation-for="SpecificationAttributeId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlSpecificationAttributeOptionId">
+ <admin-label asp-for="SpecificationAttributeOptionId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SpecificationAttributeOptionId" asp-items="Model.AvailableOptions"/>
+ <span asp-validation-for="SpecificationAttributeOptionId"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlCustomName">
+ <admin-label asp-for="CustomName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CustomName"/>
+ <span asp-validation-for="CustomName"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlCustomValue">
+ <admin-label asp-for="CustomValue"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="CustomValue"/>
+ <span asp-validation-for="CustomValue"></span>
+ </div>
+ </div>
+ <div class="form-group" id="pnlAllowFiltering">
+ <admin-label asp-for="AllowFiltering"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AllowFiltering"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AllowFiltering"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShowOnProductPage"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="ShowOnProductPage"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="ShowOnProductPage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DisplayOrder"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder"/>
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductSpecificationPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductSpec').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ $("#@Html.IdFor(model => model.SpecificationAttributeId)").change(function() {
+ var selectedAttributeId = $(this).val();
+ $.ajax({
+ cache: false,
+ type: "GET",
+ url: "@(Url.Action("GetOptionsByAttributeId", "Product", new { area = Constants.AreaStore }))",
+ data: { "attributeId": selectedAttributeId },
+ success: function (data) {
+ var ddlSpecOptions = $("#@Html.IdFor(model => model.SpecificationAttributeOptionId)");
+ ddlSpecOptions.html('');
+ $.each(data, function (id, option) {
+ var selected = '';
+ if ('@Model.SpecificationAttributeOptionId' == option.id) {
+ selected = ' selected '
+ }
+ ddlSpecOptions.append($('<option ' + selected+'></option>').val(option.id).html(kendo.htmlEncode(option.name)));
+ });
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert('Failed to retrieve specification options.');
+ }
+ });
+ });
+
+ $(document).ready(function() {
+ $("#@Html.IdFor(model => model.AttributeTypeId)").change(toggleAttributeType);
+ $("#@Html.IdFor(model => model.SpecificationAttributeId)").change();
+ toggleAttributeType();
+ });
+
+
+ function toggleAttributeType() {
+ var selectedTypeId = $("#@Html.IdFor(model => model.AttributeTypeId)").val();
+ if (selectedTypeId == @(((int)SpecificationAttributeType.Option).ToString())) {
+ $('#pnlSpecificationAttributeOptionId').show();
+ $('#pnlCustomValue').hide();
+ $('#pnlCustomName').hide();
+ $('#disableOnCustom').show();
+ $('#pnlAllowFiltering').show();
+ } else if (selectedTypeId == @(((int)SpecificationAttributeType.CustomText).ToString())) {
+ $('#pnlSpecificationAttributeOptionId').hide();
+ $('#pnlCustomName').show();
+ $('#pnlCustomValue').show();
+ $('#disableOnCustom').hide();
+ $('#pnlAllowFiltering').hide();
+ } else if (selectedTypeId == @(((int)SpecificationAttributeType.CustomHtmlText).ToString())) {
+ $('#pnlSpecificationAttributeOptionId').hide();
+ $('#pnlCustomName').show();
+ $('#pnlCustomValue').show();
+ $('#disableOnCustom').hide();
+ $('#pnlAllowFiltering').hide();
+ } else if (selectedTypeId == @(((int)SpecificationAttributeType.Hyperlink).ToString())) {
+ $('#pnlSpecificationAttributeOptionId').hide();
+ $('#pnlCustomName').show();
+ $('#pnlCustomValue').show();
+ $('#disableOnCustom').hide();
+ $('#pnlAllowFiltering').hide();
+ }
+ }
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RecommendedProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RecommendedProductAddPopup.cshtml
new file mode 100644
index 000000000..8cb2f5a15
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RecommendedProductAddPopup.cshtml
@@ -0,0 +1,209 @@
+@model ProductModel.AddRecommendedProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.Recommended.AddNew"];
+}
+<form id="RecommendedProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="RecommendedProductAddPopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.Recommended.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#RecommendedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshRecommendedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("RecommendedProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ title: "@Loc["Admin.Common.Check"]",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+</script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RelatedProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RelatedProductAddPopup.cshtml
new file mode 100644
index 000000000..0604e40e4
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RelatedProductAddPopup.cshtml
@@ -0,0 +1,212 @@
+@model ProductModel.AddRelatedProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.RelatedProducts.AddNew"];
+}
+<form id="RelatedProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="RelatedProductAddPopup"
+ asp-route-productId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["productId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.RelatedProducts.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#RelatedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshRelatedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("RelatedProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RequiredProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RequiredProductAddPopup.cshtml
new file mode 100644
index 000000000..dbcd9502e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/RequiredProductAddPopup.cshtml
@@ -0,0 +1,172 @@
+@model ProductModel.AddRequiredProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.Fields.RequiredProductIds.Choose"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.Fields.RequiredProductIds.Choose"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function selectRequiredProduct(productid) {
+ try {
+ var currentValue = document.getElementById('@(Context.Request.Query["productIdsInput"])').value;
+ if (currentValue) {
+ //add comma
+ document.getElementById('@(Context.Request.Query["productIdsInput"])').value += ', ';
+ }
+ document.getElementById('@(Context.Request.Query["productIdsInput"])').value += productid;
+ document.getElementById('@(Context.Request.Query["btnId"])').click();
+ }
+ catch (e){}
+ $.magnificPopup.instance.close();
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("RequiredProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Name",
+ title: "@Loc["Admin.Common.Select"]",
+ width: 50,
+ template: '<input type="button" value="@Loc["Admin.Common.Select"]" onclick="selectRequiredProduct(\'#=Id#\')" class="k-button" />'
+ },{
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ </script>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/SimilarProductAddPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/SimilarProductAddPopup.cshtml
new file mode 100644
index 000000000..b58a4ff3c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/SimilarProductAddPopup.cshtml
@@ -0,0 +1,210 @@
+@model ProductModel.AddSimilarProductModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ Layout = "";
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.SimilarProducts.AddNew"];
+}
+<form id="SimilarProductAddPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="SimilarProductAddPopup"
+ asp-route-productId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["productId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label"/>
+ <admin-input asp-for="SearchProductName"/>
+ </div>
+ </div>
+ <div class="col-md-auto col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#SimilarProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshSimilarProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("SimilarProductAddPopupList", "Product", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<input id='mastercheckbox' type='checkbox'/>",
+ headerAttributes: { style: "text-align:center" },
+ template: "<input type='checkbox' name='SelectedProductIds' value='#=Id#' class='checkboxGroups' />",
+ attributes: { style: "text-align:center" },
+ width: 50
+ }, {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+
+ $('#search-products').click(function () {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ //clear selected checkboxes
+ $('.checkboxGroups').prop('checked', false).change();
+ return false;
+ });
+
+ $("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-products").click();
+ return false;
+ }
+ });
+
+ //wire up checkboxes
+ $('#mastercheckbox').click(function() {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
+ updateMasterCheckbox();
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceCreatePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceCreatePopup.cshtml
new file mode 100644
index 000000000..f56e53cdc
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceCreatePopup.cshtml
@@ -0,0 +1,61 @@
+@model ProductModel.TierPriceModel
+
+@{
+ Layout = "";
+
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.AddNew"];
+}
+
+<form id="TierPriceCreatePopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="TierPriceCreatePopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.TierPrices.AddNew"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdateTierPrice" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#TierPriceCreatePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ $('#btnRefreshTierPrices').click();
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml
new file mode 100644
index 000000000..c27cac08c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml
@@ -0,0 +1,61 @@
+@model ProductModel.TierPriceModel
+
+@{
+ Layout = "";
+
+ //page title
+ ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.Edit"];
+}
+
+<form id="TierPriceEditPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="TierPriceEditPopup"
+ asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
+ asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
+ asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cube"></i>
+ @Loc["Admin.Catalog.Products.TierPrices.Edit"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <partial name="Partials/CreateOrUpdateTierPrice" model="Model"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#TierPriceEditPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshTierPrices').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByAmount.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByAmount.cshtml
new file mode 100644
index 000000000..4d3c28e11
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByAmount.cshtml
@@ -0,0 +1,57 @@
+@{
+ var gridPageSize = 5;
+}
+<div id="bestsellers-byamount-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#bestsellers-byamount-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BestsellersBriefReportByAmountList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(gridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.Name"]"
+ }, {
+ field: "TotalQuantity",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalQuantity"]"
+ }, {
+ field: "TotalAmount",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalAmount"]"
+ }, {
+ field: "ProductId",
+ title: "@Loc["Admin.Common.View"]",
+ width: 100,
+ template: '<a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a>'
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByQuantity.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByQuantity.cshtml
new file mode 100644
index 000000000..7c748dab2
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersBriefReportByQuantity.cshtml
@@ -0,0 +1,57 @@
+@{
+ var gridPageSize = 5;
+}
+<div id="bestsellers-byquantity-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#bestsellers-byquantity-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BestsellersBriefReportByQuantityList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(gridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.Name"]"
+ }, {
+ field: "TotalQuantity",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalQuantity"]"
+ }, {
+ field: "TotalAmount",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalAmount"]"
+ }, {
+ field: "ProductId",
+ title: "@Loc["Admin.Common.View"]",
+ width: 100,
+ template: '<a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a>'
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersReport.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersReport.cshtml
new file mode 100644
index 000000000..70ee88585
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/BestsellersReport.cshtml
@@ -0,0 +1,164 @@
+@model BestsellersReportModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Reports.Bestsellers"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-list-alt"></i>
+ @Loc["Admin.Reports.Bestsellers"]
+ </div>
+
+ </div>
+ <div class="x_content form">
+ <vc:admin-widget widget-zone="bestsellers_report" additional-data="Model"/>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="x_content">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="OrderStatusId" class="control-label"/>
+ <admin-select asp-for="OrderStatusId" asp-items="Model.AvailableOrderStatuses"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-salesreport">
+ <i class="fa fa-search"></i> @Loc["Admin.Reports.Bestsellers.RunReport"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="StartDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentStatusId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentStatusId" asp-items="Model.AvailablePaymentStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="BillingCountryId" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="BillingCountryId" asp-items="Model.AvailableCountries"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="x_content">
+ <div id="salesreport-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $("#salesreport-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BestsellersReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>'
+ }, {
+ field: "TotalQuantity",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalQuantity"]"
+ },{
+ field: "TotalAmount",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalAmount"]"
+ }]
+ });
+ });
+</script>
+<script>
+
+ $(document).ready(function () {
+
+ $('#search-salesreport').click(function () {
+ var grid = $('#salesreport-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ });
+
+ function additionalData() {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ OrderStatusId: $('#OrderStatusId').val(),
+ PaymentStatusId: $('#PaymentStatusId').val(),
+ BillingCountryId: $('#BillingCountryId').val(),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/CountryReport.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/CountryReport.cshtml
new file mode 100644
index 000000000..59a405ff8
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/CountryReport.cshtml
@@ -0,0 +1,153 @@
+@model CountryReportModel
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Reports.Country"];
+}
+
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-list-alt"></i>
+ @Loc["Admin.Reports.Country"]
+ </div>
+
+ </div>
+ <div class="x_content form">
+ <vc:admin-widget widget-zone="country_report" additional-data="Model"/>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="x_content">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="StartDate" class="control-label"/>
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="EndDate" class="control-label"/>
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-countryreport">
+ <i class="fa fa-search"></i> @Loc["Admin.Reports.Country.RunReport"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="OrderStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="OrderStatusId" asp-items="Model.AvailableOrderStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentStatusId" asp-items="Model.AvailablePaymentStatuses"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="countryreport-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+<script>
+ $(document).ready(function () {
+ $("#countryreport-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("CountryReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ scrollable: false,
+ columns: [{
+ field: "CountryName",
+ title: "@Loc["Admin.Reports.Country.Fields.CountryName"]"
+ }, {
+ field: "TotalOrders",
+ title: "@Loc["Admin.Reports.Country.Fields.TotalOrders"]"
+ },{
+ field: "SumOrders",
+ title: "@Loc["Admin.Reports.Country.Fields.SumOrders"]"
+ }]
+ });
+ });
+ </script>
+
+<script>
+
+ $(document).ready(function () {
+
+ $('#search-countryreport').click(function () {
+ var grid = $('#countryreport-grid').data('kendoGrid');
+ grid.dataSource.read();
+ return false;
+ });
+
+ });
+
+ function additionalData() {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ OrderStatusId: $('#OrderStatusId').val(),
+ PaymentStatusId: $('#PaymentStatusId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ </script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Customer.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Customer.cshtml
new file mode 100644
index 000000000..65d565978
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Customer.cshtml
@@ -0,0 +1,53 @@
+@model CustomerReportsModel
+
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Reports.Customers"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-bar-chart-o"></i>
+ @Loc["Admin.Reports.Customers"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="x_content">
+ <admin-tabstrip name="customer-reports">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Reports.Customers.BestBy.BestByOrderTotal"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/Customer.TabBestByOrderTotal" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Reports.Customers.BestBy.BestByNumberOfOrders"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/Customer.TabBestByNumberOfOrders" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Reports.Customers.RegisteredCustomers"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/Customer.TabRegisteredCustomers" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="reports_details_tabs" additional-data="Model"/>
+ </items>
+ </admin-tabstrip>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/LowStockReport.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/LowStockReport.cshtml
new file mode 100644
index 000000000..b72473b8e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/LowStockReport.cshtml
@@ -0,0 +1,88 @@
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Reports.LowStockReport"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Reports.LowStockReport"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="x_content">
+ <div id="products-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ $(document).ready(function() {
+ $("#products-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("LowStockReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "Name",
+ title: "@Loc["Admin.Catalog.Products.Fields.Name"]",
+ width: 300,
+ //if not a grouped product, then display
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=Id#">#:Name# # if(Attributes !== null) {# <br /><i> #=Attributes# </i> #} #</a>',
+ }, {
+ field: "ManageInventoryMethod",
+ title: "@Loc["Admin.Catalog.Products.Fields.ManageInventoryMethod"]",
+ width: 150
+ }, {
+ field: "StockQuantity",
+ title: "@Loc["Admin.Catalog.Products.Fields.StockQuantity"]",
+ width: 100
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Catalog.Products.Fields.Published"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }
+ ]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/NeverSoldReport.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/NeverSoldReport.cshtml
new file mode 100644
index 000000000..6b36f72ce
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/NeverSoldReport.cshtml
@@ -0,0 +1,125 @@
+@model NeverSoldReportModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Reports.NeverSold"];
+}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption level-caption">
+ <i class="fa fa-list-alt"></i>
+ @Loc["Admin.Reports.NeverSold"]
+ </div>
+ </div>
+ <div class="x_content form">
+ <vc:admin-widget widget-zone="never_sold_report" additional-data="Model"/>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="x_content">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="row align-items-end mb-3">
+ <div class="col-md-3 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="StartDate" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/>
+ <admin-input asp-for="StartDate" class="w-100"/>
+ </div>
+ </div>
+ <div class="col-md-3 col-sm-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="EndDate" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/>
+ <admin-input asp-for="EndDate" class="w-100"/>
+ </div>
+ </div>
+ <div class="col-md-5 col-sm-12 col-12 mt-md-0 mt-3">
+ <div class="form-actions">
+ <button class="btn btn-success filter-submit" id="search-neversoldreport">
+ <i class="fa fa-search"></i> @Loc["Admin.Reports.NeverSold.RunReport"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="neversoldreport-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+<script>
+ $(document).ready(function () {
+ $("#neversoldreport-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("NeverSoldReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.NeverSold.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=kendo.htmlEncode(ProductName)#</a>'
+ }]
+ });
+ });
+</script>
+<script>
+
+ $(document).ready(function () {
+
+ $('#search-neversoldreport').click(function () {
+ var grid = $('#neversoldreport-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ });
+
+ function additionalData() {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByNumberOfOrders.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByNumberOfOrders.cshtml
new file mode 100644
index 000000000..bcf131ac1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByNumberOfOrders.cshtml
@@ -0,0 +1,11 @@
+@model CustomerReportsModel
+@{
+ var dataDictAttributes = new ViewDataDictionary(ViewData)
+ {
+ TemplateInfo =
+ {
+ HtmlFieldPrefix = "bestbynumberoforders"
+ }
+ };
+ <partial name="Partials/ReportBestCustomersByNumberOfOrders" model="Model.BestCustomersByOrderTotal" view-data="dataDictAttributes"/>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByOrderTotal.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByOrderTotal.cshtml
new file mode 100644
index 000000000..1cfd5ef1b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabBestByOrderTotal.cshtml
@@ -0,0 +1,11 @@
+@model CustomerReportsModel
+@{
+ var dataDictAttributes = new ViewDataDictionary(ViewData)
+ {
+ TemplateInfo =
+ {
+ HtmlFieldPrefix = "bestbyordertotal"
+ }
+ };
+ <partial name="Partials/ReportBestCustomersByOrderTotal" model="Model.BestCustomersByOrderTotal" view-data="dataDictAttributes"/>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabRegisteredCustomers.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabRegisteredCustomers.cshtml
new file mode 100644
index 000000000..283ad7c75
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/Customer.TabRegisteredCustomers.cshtml
@@ -0,0 +1,4 @@
+@model CustomerReportsModel
+@{
+ @await Component.InvokeAsync("StoreCustomerReportRegistered")
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByNumberOfOrders.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByNumberOfOrders.cshtml
new file mode 100644
index 000000000..81e9b0fc6
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByNumberOfOrders.cshtml
@@ -0,0 +1,135 @@
+@model BestCustomersReportModel
+@inject AdminAreaSettings adminAreaSettings
+
+<vc:admin-widget widget-zone="customer_details_report_by_number_of_orders_top" additional-data="Model"/>
+<div class="popup-window">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="StartDate" class="control-label"/>
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="EndDate" class="control-label"/>
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-best-customers-numberoforders-grid">
+ <i class="fa fa-search"></i> @Loc["Admin.Reports.Customers.RunReport"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="OrderStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="OrderStatusId" asp-items="Model.AvailableOrderStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentStatusId" asp-items="Model.AvailablePaymentStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShippingStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ShippingStatusId" asp-items="Model.AvailableShippingStatuses"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="best-customers-numberoforders-grid"></div>
+</div>
+<vc:admin-widget widget-zone="customer_details_report_by_number_of_orders_bottom" additional-data="Model"/>
+<script>
+$(document).ready(function () {
+ $("#best-customers-numberoforders-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ReportBestCustomersByNumberOfOrdersList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: bestCustomersNumberOfOrdersAdditionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CustomerName",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.Customer"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:CustomerName#</a>',
+ }, {
+ field: "OrderTotal",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.OrderTotal"]"
+ }, {
+ field: "OrderCount",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.OrderCount"]"
+ }]
+ });
+});
+</script>
+<script>
+$(document).ready(function () {
+
+ $('#search-best-customers-numberoforders-grid').click(function () {
+ var grid = $('#best-customers-numberoforders-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+});
+function bestCustomersNumberOfOrdersAdditionalData(e) {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ OrderStatusId: $('#@Html.IdFor(model => model.OrderStatusId)').val(),
+ PaymentStatusId: $('#@Html.IdFor(model => model.PaymentStatusId)').val(),
+ ShippingStatusId: $('#@Html.IdFor(model => model.ShippingStatusId)').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+}
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByOrderTotal.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByOrderTotal.cshtml
new file mode 100644
index 000000000..704730d7b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Reports/Partials/ReportBestCustomersByOrderTotal.cshtml
@@ -0,0 +1,134 @@
+@model BestCustomersReportModel
+@inject AdminAreaSettings adminAreaSettings
+<vc:admin-widget widget-zone="customer_details_report_by_order_total_top" additional-data="Model"/>
+<div class="popup-window">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="StartDate" class="control-label"/>
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="EndDate" class="control-label"/>
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-best-customers-ordertotal">
+ <i class="fa fa-search"></i> @Loc["Admin.Reports.Customers.RunReport"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="OrderStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="OrderStatusId" asp-items="Model.AvailableOrderStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="PaymentStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="PaymentStatusId" asp-items="Model.AvailablePaymentStatuses"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShippingStatusId" class="control-label col-md-3 col-sm-3"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="ShippingStatusId" asp-items="Model.AvailableShippingStatuses"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="best-customers-ordertotal-grid"></div>
+</div>
+<vc:admin-widget widget-zone="customer_details_report_by_order_total_bottom" additional-data="Model"/>
+<script>
+ $(document).ready(function () {
+ $("#best-customers-ordertotal-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ReportBestCustomersByOrderTotalList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: bestCustomersOrderTotalAdditionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CustomerName",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.Customer"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:CustomerName#</a>',
+ }, {
+ field: "OrderTotal",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.OrderTotal"]"
+ }, {
+ field: "OrderCount",
+ title: "@Loc["Admin.Reports.Customers.BestBy.Fields.OrderCount"]"
+ }]
+ });
+ });
+</script>
+<script>
+ $(document).ready(function () {
+
+ $('#search-best-customers-ordertotal').click(function () {
+ var grid = $('#best-customers-ordertotal-grid').data('kendoGrid');
+ grid.dataSource.page(1); //new search. Set page size to 1
+ //grid.dataSource.read(); we already loaded the grid above using "page" function
+ return false;
+ });
+
+ });
+ function bestCustomersOrderTotalAdditionalData(e) {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ OrderStatusId: $('#@Html.IdFor(model => model.OrderStatusId)').val(),
+ PaymentStatusId: $('#@Html.IdFor(model => model.PaymentStatusId)').val(),
+ ShippingStatusId: $('#@Html.IdFor(model => model.ShippingStatusId)').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByAmount/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByAmount/Default.cshtml
new file mode 100644
index 000000000..4088e0f9e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByAmount/Default.cshtml
@@ -0,0 +1,53 @@
+@{
+ var gridPageSize = 5;
+}
+<div id="bestsellers-byamount-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#bestsellers-byamount-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BestsellersBriefReportByAmountList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(gridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=ProductName#</a>',
+ }, {
+ field: "TotalQuantity",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalQuantity"]"
+ }, {
+ field: "TotalAmount",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalAmount"]"
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByQuantity/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByQuantity/Default.cshtml
new file mode 100644
index 000000000..989fe7624
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreBestsellersBriefReportByQuantity/Default.cshtml
@@ -0,0 +1,54 @@
+@{
+ var gridPageSize = 5;
+}
+<div id="bestsellers-byquantity-grid"></div>
+
+<script>
+ $(document).ready(function () {
+ $("#bestsellers-byquantity-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("BestsellersBriefReportByQuantityList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(gridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "ProductName",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { area = Constants.AreaStore })/#=ProductId#">#=ProductName#</a>',
+ }, {
+ field: "TotalQuantity",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalQuantity"]"
+ }, {
+ field: "TotalAmount",
+ title: "@Loc["Admin.Reports.Bestsellers.Fields.TotalAmount"]"
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportRegistered/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportRegistered/Default.cshtml
new file mode 100644
index 000000000..5c5973185
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportRegistered/Default.cshtml
@@ -0,0 +1,49 @@
+<div id="registered-customers-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#registered-customers-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ReportRegisteredCustomersList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Period",
+ title: "@Loc["Admin.Reports.Customers.RegisteredCustomers.Fields.Period"]"
+ }, {
+ field: "Customers",
+ title: "@Loc["Admin.Reports.Customers.RegisteredCustomers.Fields.Customers"]",
+ width: 50
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportTimeChart/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportTimeChart/Default.cshtml
new file mode 100644
index 000000000..ed636a601
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreCustomerReportTimeChart/Default.cshtml
@@ -0,0 +1,130 @@
+<div>
+ <canvas id="canvasReportCustomerTimeChart"></canvas>
+</div>
+
+<script src="@(Grand.SharedUIResources.Constants.WwwRoot)/administration/chart.min.js" type="text/javascript"></script>
+<script>
+ $(document).ready(function () {
+ initReportCustomerTimeChart(true);
+ $("#DarkLight").change(function () {
+ initReportCustomerTimeChart(true);
+ });
+ });
+
+
+ function initReportCustomerTimeChart(first) {
+ function additionalData() {
+ var data = {
+ startDate: $('#dashboard-report-range').data('daterangepicker').startDate.format('YYYY-MM-DD'),
+ endDate: $('#dashboard-report-range').data('daterangepicker').endDate.format('YYYY-MM-DD'),
+ };
+
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ var add = additionalData();
+
+ $.ajax({
+ type: "POST",
+ url: "@Html.Raw(Url.Action("ReportCustomerTimeChart", "Reports", new { area = Constants.AreaStore }))",
+ dataType: "json",
+ data: add,
+ success: function (data) {
+
+ var chartData = {
+ labels: [],
+ datasets: [{
+ type: 'bar',
+ label: 'Registered users',
+ yAxisID: 'L',
+ backgroundColor: 'rgba(75, 192, 192, 0.6)',
+ borderColor: 'rgb(75, 192, 192)',
+ data: [],
+ borderWidth: 2
+ }]
+ };
+
+ for (var i = 0; i < data.Data.length; i++) {
+ chartData.labels[i] = data.Data[i].Time;
+ chartData.datasets[0].data[i] = data.Data[i].Registered;
+ }
+
+
+ var ctx = document.getElementById('canvasReportCustomerTimeChart').getContext('2d');
+
+ if (first) {
+ if ($('#DarkLight').is(':checked')) {
+ window.myReportCustomerTimeChart = new Chart(ctx, {
+ type: 'bar',
+ data: chartData,
+ options: {
+ responsive: true,
+ title: {
+ display: true,
+ text: 'Number of registered customers in time',
+ fontColor: 'white'
+ },
+ legend: {
+ labels: {
+ fontColor: 'white'
+ }
+ },
+ tooltips: {
+ mode: 'index',
+ intersect: true
+ }, scales: {
+ yAxes: [{
+ id: 'L',
+ type: 'linear',
+ position: 'left',
+ gridLines: {
+ color: 'rgb(255,255,255)'
+ },
+ ticks: {
+ min: 0,
+ stepSize: 1,
+ fontColor: 'rgb(255,255,255)'
+ },
+ }]
+ }
+ }
+ });
+ } else {
+ window.myReportCustomerTimeChart = new Chart(ctx, {
+ type: 'bar',
+ data: chartData,
+ options: {
+ responsive: true,
+ title: {
+ display: true,
+ text: 'Number of registered customers in time'
+ },
+ tooltips: {
+ mode: 'index',
+ intersect: true
+ }, scales: {
+ yAxes: [{
+ id: 'L',
+ type: 'linear',
+ position: 'left',
+ ticks: {
+ min: 0,
+ stepSize: 1
+ },
+ }]
+ }
+ }
+ });
+ }
+ } else {
+ window.myReportCustomerTimeChart.data = chartData;
+ window.myReportCustomerTimeChart.update();
+ }
+ },
+ error: function () {
+ alert('error');
+ }
+ });
+ }
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreLatestOrder/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreLatestOrder/Default.cshtml
new file mode 100644
index 000000000..bcd27226d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreLatestOrder/Default.cshtml
@@ -0,0 +1,112 @@
+@inject AdminAreaSettings adminAreaSettings
+
+<div id="latest-orders-grid"></div>
+
+<script>
+ $(document).ready(function () {
+ $("#latest-orders-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("OrderList", "Order", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ requestEnd: function (e) {
+ if (e.type == "read") {
+ var response = e.response;
+ if (response) {
+ //store extra data
+ reportAggregates = e.response["ExtraData"];
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: 5,
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [5,10,15]
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [
+ {
+ field: "OrderNumber",
+ title: "@Loc["Admin.Orders.Fields.Id"]",
+ width: 50,
+ template: '<a class="k-link" href="Store/Order/Edit/#=Id#">#=OrderNumber#</a>',
+ },
+ {
+ field: "CustomerEmail",
+ title: "@Loc["Admin.Orders.Fields.Customer"]",
+ width: 300,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#=CustomerFullName# (#=CustomerEmail#)</a>'
+ },
+ @if (!adminAreaSettings.HideStoreColumn)
+ {
+ <text>
+ {
+ field: "StoreName",
+ title: "@Loc["Admin.Orders.Fields.Store"]",
+ width: 200,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ },
+ </text>
+ }
+ {
+ field: "PaymentStatus",
+ title: "@Loc["Admin.Orders.Fields.PaymentStatus"]",
+ width: 120,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ },
+ {
+ field: "OrderTotal",
+ title: "@Loc["Admin.Orders.Fields.OrderTotal"]",
+ width: 200,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" }
+ },
+ {
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.Fields.CreatedOn"]",
+ width: 200,
+ type: "date",
+ format: "{0:G}",
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ }
+ ]
+ } );
+
+
+ function additionalData() {
+ var data = {
+ startdate: $('#dashboard-report-range').data('daterangepicker').startDate.format('YYYY-MM-DD'),
+ endDate: $('#dashboard-report-range').data('daterangepicker').endDate.format('YYYY-MM-DD'),
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ });
+
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderAverageReport/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderAverageReport/Default.cshtml
new file mode 100644
index 000000000..bd569f259
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderAverageReport/Default.cshtml
@@ -0,0 +1,60 @@
+<div id="average-order-report-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#average-order-report-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("OrderAverageReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "OrderStatus",
+ title: "@Loc["Admin.Reports.Average.OrderStatus"]"
+ }, {
+ field: "SumTodayOrders",
+ title: "@Loc["Admin.Reports.Average.SumTodayOrders"]"
+ }, {
+ field: "SumThisWeekOrders",
+ title: "@Loc["Admin.Reports.Average.SumThisWeekOrders"]"
+ }, {
+ field: "SumThisMonthOrders",
+ title: "@Loc["Admin.Reports.Average.SumThisMonthOrders"]"
+ }, {
+ field: "SumThisYearOrders",
+ title: "@Loc["Admin.Reports.Average.SumThisYearOrders"]"
+ }, {
+ field: "SumAllTimeOrders",
+ title: "@Loc["Admin.Reports.Average.SumAllTimeOrders"]"
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderIncompleteReport/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderIncompleteReport/Default.cshtml
new file mode 100644
index 000000000..75c9738d2
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderIncompleteReport/Default.cshtml
@@ -0,0 +1,52 @@
+<div id="incomplete-order-report-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#incomplete-order-report-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("OrderIncompleteReportList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Item",
+ title: "@Loc["Admin.Reports.Incomplete.Item"]",
+ template: '<a class="k-link" href="#=ViewLink#">#=Item#</a>',
+ }, {
+ field: "Total",
+ title: "@Loc["Admin.Reports.Incomplete.Total"]",
+ }, {
+ field: "Count",
+ title: "@Loc["Admin.Reports.Incomplete.Count"]"
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderPeriodReport/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderPeriodReport/Default.cshtml
new file mode 100644
index 000000000..87e716437
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderPeriodReport/Default.cshtml
@@ -0,0 +1,53 @@
+<div id="order-period-grid"></div>
+<script>
+ $(document).ready(function () {
+ $("#order-period-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ReportOrderPeriodList", "Reports", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Period",
+ title: "@Loc["Admin.Reports.Period.Name"]"
+ }, {
+ field: "Count",
+ title: "@Loc["Admin.Reports.Period.Count"]",
+ width: 50
+ }, {
+ field: "Amount",
+ title: "@Loc["Admin.Reports.Period.Amount"]",
+ width: 150
+ }]
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderTimeChart/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderTimeChart/Default.cshtml
new file mode 100644
index 000000000..3b242683c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreOrderTimeChart/Default.cshtml
@@ -0,0 +1,153 @@
+<div class="col-12 text-center" style="height:50px;position:relative">
+ <span style="position: absolute;bottom: 0;left:0;right:0;">
+ <strong>
+ Orders summary
+ </strong>
+ </span>
+</div>
+
+<div>
+ <canvas id="canvasReportOrderTimeChart"></canvas>
+</div>
+
+<script src="@(Grand.SharedUIResources.Constants.WwwRoot)/administration/chart.min.js" type="text/javascript"></script>
+<script>
+ $(document).ready(function () {
+ initReportOrderTimeChart(true);
+ $("#DarkLight").change(function () {
+ initReportOrderTimeChart(true);
+ });
+ });
+
+ function initReportOrderTimeChart(first) {
+ function additionalData() {
+ var data = {
+ startDate: $('#dashboard-report-range').data('daterangepicker').startDate.format('YYYY-MM-DD'),
+ endDate: $('#dashboard-report-range').data('daterangepicker').endDate.format('YYYY-MM-DD'),
+ };
+
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ var add = additionalData();
+
+ $.ajax({
+ type: "POST",
+ url: "@Html.Raw(Url.Action("ReportOrderTimeChart", "Reports", new { area = Constants.AreaStore }))",
+ dataType: "json",
+ data: add,
+ success: function (data) {
+ var chartData = {
+ labels: [],
+ datasets: [{
+ type: 'line',
+ label: 'Number of orders',
+ yAxisID: 'R',
+ borderColor: 'rgb(54, 162, 235)',
+ borderWidth: 2,
+ fill: false,
+ data: []
+ }, {
+ type: 'bar',
+ label: 'Total sum',
+ yAxisID: 'L',
+ backgroundColor: 'rgba(255, 159, 64, 0.6)',
+ borderColor: 'rgb(255, 159, 64)',
+ data: [],
+ borderWidth: 2
+ }]
+ };
+
+ for (var i = 0; i < data.Data.length; i++) {
+ chartData.labels[i] = data.Data[i].Time;
+ chartData.datasets[0].data[i] = data.Data[i].TotalOrders;
+ chartData.datasets[1].data[i] = data.Data[i].SumOrders;
+ }
+ var ctx = document.getElementById('canvasReportOrderTimeChart').getContext('2d');
+ if (first) {
+ if ($('#DarkLight').is(':checked')) {
+ window.myReportOrderTimeChart = new Chart(ctx, {
+ type: 'bar',
+ data: chartData,
+ options: {
+ responsive: true,
+ legend: {
+ labels: {
+ fontColor: 'white'
+ }
+ },
+ tooltips: {
+ mode: 'index',
+ intersect: true
+ }, scales: {
+ yAxes: [{
+ id: 'L',
+ type: 'linear',
+ position: 'left',
+ gridLines: {
+ color: 'rgb(255,255,255)'
+ },
+ ticks: {
+ min: 0,
+ fontColor: 'rgb(255,255,255)',
+ },
+ }, {
+ id: 'R',
+ type: 'linear',
+ position: 'right',
+ gridLines: {
+ display: false,
+ },
+ ticks: {
+ min: 0,
+ fontColor: 'rgb(255,255,255)',
+ },
+ }]
+ }
+ }
+ });
+ } else {
+ window.myReportOrderTimeChart = new Chart(ctx, {
+ type: 'bar',
+ data: chartData,
+ options: {
+ responsive: true,
+ tooltips: {
+ mode: 'index',
+ intersect: true
+ }, scales: {
+ yAxes: [{
+ id: 'L',
+ type: 'linear',
+ position: 'left',
+ ticks: {
+ min: 0,
+ },
+ }, {
+ id: 'R',
+ type: 'linear',
+ position: 'right',
+ gridLines: {
+ display: false
+ },
+ ticks: {
+ min: 0,
+ },
+ }]
+ }
+ }
+ });
+ }
+ } else {
+ window.myReportOrderTimeChart.data = chartData;
+ window.myReportOrderTimeChart.update();
+ }
+
+ },
+ error: function () {
+ alert('error');
+ }
+ });
+ }
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StorePage/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StorePage/Default.cshtml
new file mode 100644
index 000000000..556fcf2b2
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StorePage/Default.cshtml
@@ -0,0 +1,12 @@
+@model Grand.Web.Store.Models.Common.StorePortalModel
+
+<div class="card">
+ <div class="card-title">
+ <div class="h3 text-center">
+ @Model.Title
+ </div>
+ </div>
+ <div class="card-body">
+ @Html.Raw(Model.Body)
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreWidget/Default.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreWidget/Default.cshtml
new file mode 100644
index 000000000..2f04aa21a
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Components/StoreWidget/Default.cshtml
@@ -0,0 +1,5 @@
+@model List<AdminWidgetModel>
+@foreach (var widget in Model)
+{
+ @await Component.InvokeAsync(widget.ViewComponentName, new { widgetZone = widget.WidgetZone, additionalData = widget.AdditionalData })
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Address.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Address.cshtml
new file mode 100644
index 000000000..43881fcb6
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Address.cshtml
@@ -0,0 +1,222 @@
+@model AddressModel
+@if (Model.CountryEnabled && Model.StateProvinceEnabled)
+{
+ <script>
+ $(document).ready(function() {
+ $("#@Html.IdFor(model => model.CountryId)").change(function() {
+ var selectedItem = $(this).val();
+ var ddlStates = $("#@Html.IdFor(model => model.StateProvinceId)");
+ $.ajax({
+ cache: false,
+ type: "GET",
+ url: "@(Url.Action("GetStatesByCountryId", "Home"))",
+ data: { "countryId": selectedItem, "addSelectStateItem": "false" },
+ success: function(data) {
+ ddlStates.html('');
+ $.each(data, function(id, option) {
+ ddlStates.append($('<option></option>').val(option.id).html(option.name));
+ });
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert('Failed to retrieve states.');
+ }
+ });
+ });
+ });
+ </script>
+}
+<input asp-for="Id" type="hidden"/>
+<input asp-for="FirstNameEnabled" type="hidden"/>
+<input asp-for="FirstNameRequired" type="hidden"/>
+<input asp-for="LastNameEnabled" type="hidden"/>
+<input asp-for="LastNameRequired" type="hidden"/>
+<input asp-for="EmailEnabled" type="hidden"/>
+<input asp-for="EmailRequired" type="hidden"/>
+<input asp-for="CompanyEnabled" type="hidden"/>
+<input asp-for="CompanyRequired" type="hidden"/>
+<input asp-for="VatNumberEnabled" type="hidden"/>
+<input asp-for="VatNumberRequired" type="hidden"/>
+<input asp-for="CountryEnabled" type="hidden"/>
+<input asp-for="StateProvinceEnabled" type="hidden"/>
+<input asp-for="CityEnabled" type="hidden"/>
+<input asp-for="CityRequired" type="hidden"/>
+<input asp-for="StreetAddressEnabled" type="hidden"/>
+<input asp-for="StreetAddressRequired" type="hidden"/>
+<input asp-for="StreetAddress2Enabled" type="hidden"/>
+<input asp-for="StreetAddress2Required" type="hidden"/>
+<input asp-for="ZipPostalCodeEnabled" type="hidden"/>
+<input asp-for="ZipPostalCodeRequired" type="hidden"/>
+<input asp-for="PhoneEnabled" type="hidden"/>
+<input asp-for="PhoneRequired" type="hidden"/>
+<input asp-for="FaxEnabled" type="hidden"/>
+<input asp-for="FaxRequired" type="hidden"/>
+<input asp-for="NoteEnabled" type="hidden"/>
+
+<div class="form-horizontal">
+ <div class="form-body">
+ @if (Model.NameEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Name"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Name"/>
+ <span asp-validation-for="Name"></span>
+ </div>
+ </div>
+ }
+ @if (Model.FirstNameEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="FirstName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="FirstName"/>
+ <span asp-validation-for="FirstName"></span>
+ </div>
+ </div>
+ }
+ @if (Model.LastNameEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="LastName"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="LastName"/>
+ <span asp-validation-for="LastName"></span>
+ </div>
+ </div>
+ }
+ @if (Model.EmailEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Email"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Email"/>
+ <span asp-validation-for="Email"></span>
+ </div>
+ </div>
+ }
+ @if (Model.CompanyEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Company"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Company"/>
+ <span asp-validation-for="Company"></span>
+ </div>
+ </div>
+ }
+ @if (Model.VatNumberEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="VatNumber"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="VatNumber"/>
+ <span asp-validation-for="VatNumber"></span>
+ </div>
+ </div>
+ }
+ @if (Model.CountryEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="CountryId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="CountryId" asp-items="Model.AvailableCountries"/>
+ <span asp-validation-for="CountryId"></span>
+ </div>
+ </div>
+ }
+ @if (Model.CountryEnabled && Model.StateProvinceEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="StateProvinceId"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="StateProvinceId" asp-items="Model.AvailableStates"/>
+ <span asp-validation-for="StateProvinceId"></span>
+ </div>
+ </div>
+ }
+ @if (Model.CityEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="City"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="City"/>
+ <span asp-validation-for="City"></span>
+ </div>
+ </div>
+ }
+ @if (Model.StreetAddressEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Address1"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Address1"/>
+ <span asp-validation-for="Address1"></span>
+ </div>
+ </div>
+ }
+ @if (Model.StreetAddress2Enabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Address2"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Address2"/>
+ <span asp-validation-for="Address2"></span>
+ </div>
+ </div>
+ }
+ @if (Model.ZipPostalCodeEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="ZipPostalCode"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ZipPostalCode"/>
+ <span asp-validation-for="ZipPostalCode"></span>
+ </div>
+ </div>
+ }
+ @if (Model.PhoneEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="PhoneNumber"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="PhoneNumber"/>
+ <span asp-validation-for="PhoneNumber"></span>
+ </div>
+ </div>
+ }
+ @if (Model.FaxEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="FaxNumber"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="FaxNumber"/>
+ <span asp-validation-for="FaxNumber"></span>
+ </div>
+ </div>
+ }
+ @if (Model.NoteEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="Note"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Note"/>
+ <span asp-validation-for="Note"></span>
+ </div>
+ </div>
+ }
+ @if (Model.AddressTypeEnabled)
+ {
+ <div class="form-group">
+ <admin-label asp-for="AddressType"/>
+ <div class="col-md-9 col-sm-9">
+ <select asp-for="AddressType" asp-items="EnumTranslationService.ToSelectList(AddressType.Any, false)" class="form-control custom-select"></select>
+ <span asp-validation-for="AddressType"></span>
+ </div>
+ </div>
+ }
+ @if (Model.CustomAddressAttributes.Count > 0)
+ {
+ <partial name="Partials/AddressAttributes" model="Model.CustomAddressAttributes"/>
+ }
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Review.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Review.cshtml
new file mode 100644
index 000000000..46aca387b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/EditorTemplates/Review.cshtml
@@ -0,0 +1,14 @@
+@model ReviewModel
+<input asp-for="Id" type="hidden"/>
+<div class="form-fields">
+ <div class="form-group">
+ <label asp-for="Title" class="col-form-label">@Loc["Reviews.Fields.Title"]:</label>
+ <input asp-for="Title" class="form-control review-title"/>
+ <span asp-validation-for="Title"></span>
+ </div>
+ <div class="form-group">
+ <label asp-for="ReviewText" class="col-form-label">@Loc["Reviews.Fields.ReviewText"]:</label>
+ <textarea asp-for="ReviewText" class="form-control review-text"></textarea>
+ <span asp-validation-for="ReviewText"></span>
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/AddressAttributes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/AddressAttributes.cshtml
new file mode 100644
index 000000000..9ccc77f97
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/AddressAttributes.cshtml
@@ -0,0 +1,74 @@
+@model IList<AddressModel.AddressAttributeModel>
+@foreach (var attribute in Model)
+{
+ var controlId = $"attributes[{attribute.Id}]";
+ var textPrompt = attribute.Name;
+
+ <div class="form-group">
+ <label class="control-label col-md-3">@textPrompt</label>
+ <div class="col-md-9 col-sm-9">
+ @switch (attribute.AttributeControlType)
+ {
+ case AttributeControlType.DropdownList:
+ {
+ <select class="form-control" name="@(controlId)" id="@(controlId)">
+ @if (!attribute.IsRequired)
+ {
+ <option value="">---</option>
+ }
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <option selected="@attributeValue.IsPreSelected" value="@attributeValue.Id">@attributeValue.Name</option>
+ }
+ </select>
+ }
+ break;
+ case AttributeControlType.RadioList:
+ {
+ <div class="radio-list">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <input id="@(controlId)_@(attributeValue.Id)" type="radio" name="@(controlId)" value="@attributeValue.Id" checked="@attributeValue.IsPreSelected"/>
+ <label for="@(controlId)_@(attributeValue.Id)">@attributeValue.Name</label>
+ </div>
+ }
+ </div>
+ }
+ break;
+ case AttributeControlType.Checkboxes:
+ case AttributeControlType.ReadonlyCheckboxes:
+ {
+ <div class="checkbox-list">
+ @foreach (var attributeValue in attribute.Values)
+ {
+ <div>
+ <input id="@(controlId)_@(attributeValue.Id)" type="checkbox" name="@(controlId)" value="@(attributeValue.Id)" checked="@(attributeValue.IsPreSelected)" @(attribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ? Html.Raw(" disabled=\"disabled\"") : null)/>
+ <label for="@(controlId)_@(attributeValue.Id)">@attributeValue.Name</label>
+ </div>
+ }
+ </div>
+ }
+ break;
+ case AttributeControlType.TextBox:
+ {
+ <input name="@(controlId)" type="text" class="form-control text-box single-line" id="@(controlId)" value="@(attribute.DefaultValue)"/>
+ }
+ break;
+ case AttributeControlType.MultilineTextbox:
+ {
+ <textarea id="@(controlId)" style="Width: 250px; Height: 150px;" name="@(controlId)">@(attribute.DefaultValue)</textarea>
+ }
+ break;
+ case AttributeControlType.Datepicker:
+ case AttributeControlType.FileUpload:
+ case AttributeControlType.ColorSquares:
+ case AttributeControlType.ImageSquares:
+ {
+ //not support attribute type
+ }
+ break;
+ }
+ </div>
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Delete.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Delete.cshtml
new file mode 100644
index 000000000..2c55ff748
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Delete.cshtml
@@ -0,0 +1,12 @@
+@model Grand.Web.Common.Models.DeleteConfirmationModel
+<form asp-area="@Constants.AreaStore" asp-controller="@Model.ControllerName" asp-action="@Model.ActionName" method="post" asp-route-id="@Model.Id">
+ <div>
+ <p>
+ @Loc["Admin.Common.DeleteConfirmation"]
+ </p>
+ <div class="form-actions">
+ <span id="" class="k-button" onclick="$('#@Model.WindowId').data('kendoWindow').close();">@Loc["Admin.Common.NoCancel"]</span>
+ <input type="submit" class="k-button" value="@Loc["Admin.Common.Delete"]"/>
+ </div>
+ </div>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/HeadStore.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/HeadStore.cshtml
new file mode 100644
index 000000000..4ebd6bd3c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/HeadStore.cshtml
@@ -0,0 +1,60 @@
+@using Grand.Domain.Localization
+@using Constants = Grand.SharedUIResources.Constants
+@inject LanguageSettings languageSettings
+@inject IContextAccessor contextAccessor
+<script>
+ const wwwrootpath = '@(Constants.WwwRoot)';
+</script>
+@{
+ var supportRtl = contextAccessor.WorkContext.WorkingLanguage.Rtl &&
+ !languageSettings.IgnoreRtlPropertyForAdminArea;
+ var kendoVersion = "2021.3.914";
+
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/bootstrap/css/daterangepicker.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/build/css/font-awesome.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/simple-line-icons/simple-line-icons.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/bootstrap/css/bootstrap.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/magnific-popup/magnific-popup.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/summernote/summernote.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/jquery-ui-themes/smoothness/jquery-ui-1.10.3.custom.min.css"/>
+
+ <link rel="stylesheet" type="text/css" href="@string.Format(Constants.WwwRoot + "/administration/kendo/styles/{0}/kendo.material.mobile.min.css", kendoVersion)"/>
+ <link rel="stylesheet" type="text/css" href="@string.Format(Constants.WwwRoot + "/administration/kendo/styles/{0}/kendo.material.min.css", kendoVersion)"/>
+ <link rel="stylesheet" type="text/css" href="@string.Format(Constants.WwwRoot + "/administration/kendo/styles/{0}/kendo.common-material.min.css", kendoVersion)"/>
+
+ <link rel="stylesheet" type="text/css" asp-src="@(Constants.WwwRoot)/administration/farbtastic/farbtastic.css"/>
+
+ //CSS
+ if (supportRtl)
+ {
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/bootstrap/css/bootstrap-rtl.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/build/css/custom-rtl.css"/>
+ <link rel="stylesheet" type="text/css" href="@string.Format(Constants.WwwRoot + "/administration/kendo/styles/{0}/kendo.rtl.min.css", kendoVersion)"/>
+ }
+ else
+ {
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/build/css/custom.css"/>
+ }
+
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/build/js/jquery.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/jquery-ui/jquery-ui.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/build/js/moment.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/bootstrap/js/daterangepicker.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/typeahead.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/jquery.validate.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/jquery.validate.unobtrusive.min.js"></script>
+ <script asp-location="Head" asp-src="@(Constants.WwwRoot)/administration/admin.common.js"></script>
+ <script asp-location="Head" asp-src="@string.Format(Constants.WwwRoot + "/administration/kendo/scripts/{0}/kendo.ui.core.min.js", kendoVersion)"></script>
+ <script asp-location="Head" asp-src="@string.Format(Constants.WwwRoot + "/administration/kendo/scripts/{0}/kendo.grid.js", kendoVersion)"></script>
+ <script asp-location="Head" asp-src="@string.Format(Constants.WwwRoot + "/administration/kendo/scripts/{0}/cultures/kendo.culture.{1}.js", kendoVersion, CultureInfo.CurrentCulture.Name)"></script>
+
+
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/bootstrap/js/popper.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/bootstrap/js/bootstrap.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/build/js/smartresize.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/build/js/custom.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/summernote/summernote.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/magnific-popup/jquery.magnific-popup.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/jquery.tmpl.min.js"></script>
+ <script asp-location="Footer" asp-src="@(Constants.WwwRoot)/administration/farbtastic/farbtastic.js"></script>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Menu.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Menu.cshtml
new file mode 100644
index 000000000..2d8717505
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Menu.cshtml
@@ -0,0 +1,56 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Business.Core.Interfaces.System.Admin
+@using Grand.Domain.Permissions
+@using Grand.Web.Common.Menu
+@using Constants = Grand.SharedUIResources.Constants
+@inject IPermissionService permissionService
+@inject IAdminSiteMapService adminSiteMapService
+@inject IEnumerable<IAdminMenuProvider> _adminMenuProviders
+@{
+ //load sitemap
+ var siteMap = new SiteMap(adminSiteMapService, permissionService);
+ await siteMap.Load();
+}
+<div id="sidebar-button" class="sidebar_button" onclick="sidebarToggle()">
+ <span></span>
+ <span></span>
+ <span></span>
+</div>
+<div class="col-md-3 left_col">
+ <div class="left_col scroll-view">
+ <div class="navbar nav_title">
+ <a href="~/Store" class="site_title">
+ <img src="@(Constants.WwwRoot)/administration/build/images/grandLogo.png" width="35" height="35"/> <span>GrandNode</span>
+ </a>
+ </div>
+ <div class="clearfix"></div>
+ <div class="main_menu_side hidden-print main_menu" id="sidebar-menu">
+ <div class="menu_section">
+ <ul class="nav side-menu page-sidebar-menu">
+ @{
+ //standard (default) items
+ var rootNode = siteMap.RootNode;
+
+ //plugins
+ foreach (var adminMenuPlugin in _adminMenuProviders.ToList())
+ {
+ await adminMenuPlugin.ManageSiteMap(rootNode);
+ }
+
+ //"Plugins" menu item should be visible when it has some child nodes
+ var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
+ if (pluginNode is { Visible: true })
+ {
+ var hasManagePluginsPermission = await permissionService.Authorize(StandardPermission.ManagePlugins);
+ pluginNode.Visible = hasManagePluginsPermission && pluginNode.ChildNodes.Any(x => x.Visible);
+ }
+ }
+ @foreach (var item in rootNode.ChildNodes.Where(x => x.Visible))
+ {
+ <partial name="Partials/MenuItem" model="item"/>
+ }
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/MenuItem.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/MenuItem.cshtml
new file mode 100644
index 000000000..d9a1d3bc8
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/MenuItem.cshtml
@@ -0,0 +1,56 @@
+@model Grand.Web.Common.Menu.SiteMapNode
+
+@{
+ var url = "javascript:;";
+ if (!string.IsNullOrEmpty(Model.ControllerName) && !string.IsNullOrEmpty(Model.ActionName))
+ {
+ url = Url.Action(Model.ActionName, Model.ControllerName, new { area = Constants.AreaStore });
+ }
+ else if (!string.IsNullOrEmpty(Model.Url))
+ {
+ url = Model.Url.StartsWith("~/", StringComparison.Ordinal) ? Url.Content(Model.Url) : Model.Url;
+ }
+
+ var childNodes = Model.ChildNodes.Where(x => x.Visible).ToList();
+
+<li class="@if (childNodes.Any()) { <text>has-submenu</text> }">
+ @if (childNodes.Any())
+ {
+ <a class="nav-link">
+ @if (!string.IsNullOrEmpty(Model.IconClass))
+ {
+ <i class="@Model.IconClass"></i>
+ }
+ <span class="title">@Loc[Model.ResourceName]</span>
+ </a>
+ }
+ else
+ {
+ <a href="@url" class="nav-link" @(Model.OpenUrlInNewTab ? Html.Raw(" target=\"_blank\"") : null)>
+ @if (!string.IsNullOrEmpty(Model.IconClass))
+ {
+ <i class="@Model.IconClass"></i>
+ }
+ <span class="title">@Loc[Model.ResourceName]</span>
+ @if (childNodes.Any())
+ {
+ <span class="fa fa-chevron-right"></span>
+ }
+
+ </a>
+ }
+
+ @if (childNodes.Any())
+ {
+ <ul class="nav child_menu">
+ <li class="menu-header">
+ <span class="title">@Loc[Model.ResourceName]</span>
+ <span class="close-menu" onclick="closeSubMenu(this)"></span>
+ </li>
+ @foreach (var childItem in childNodes)
+ {
+ <partial name="Partials/MenuItem" model="childItem"/>
+ }
+ </ul>
+ }
+</li>}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Notifications.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Notifications.cshtml
new file mode 100644
index 000000000..657d4ce8c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/Notifications.cshtml
@@ -0,0 +1,56 @@
+@{
+ //success messages
+ var successMessages = new List<string>();
+ if (TempData[$"Grand.notifications.{NotifyType.Success}"] != null)
+ {
+ successMessages.AddRange((TempData[$"Grand.notifications.{NotifyType.Success}"] as IList<string>)!);
+ }
+
+ if (ViewData[$"Grand.notifications.{NotifyType.Success}"] != null)
+ {
+ successMessages.AddRange((ViewData[$"Grand.notifications.{NotifyType.Success}"] as IList<string>)!);
+ }
+
+
+ //error messages
+ var errorMessages = new List<string>();
+ if (TempData[$"Grand.notifications.{NotifyType.Error}"] != null)
+ {
+ errorMessages.AddRange((TempData[$"Grand.notifications.{NotifyType.Error}"] as IList<string>)!);
+ }
+
+ if (ViewData[$"Grand.notifications.{NotifyType.Error}"] != null)
+ {
+ errorMessages.AddRange((ViewData[$"Grand.notifications.{NotifyType.Error}"] as IList<string>)!);
+ }
+
+ //warning messages
+ var warningMessages = new List<string>();
+ if (TempData[$"Grand.notifications.{NotifyType.Warning}"] != null)
+ {
+ warningMessages.AddRange((TempData[$"Grand.notifications.{NotifyType.Warning}"] as IList<string>)!);
+ }
+
+ if (ViewData[$"Grand.notifications.{NotifyType.Warning}"] != null)
+ {
+ warningMessages.AddRange((ViewData[$"Grand.notifications.{NotifyType.Warning}"] as IList<string>)!);
+ }
+}
+@foreach (var message in successMessages)
+{
+ <div class="note note-success">
+ <p> @message </p>
+ </div>
+}
+@foreach (var message in errorMessages)
+{
+ <div class="note note-danger">
+ <p> @message </p>
+ </div>
+}
+@foreach (var message in warningMessages)
+{
+ <div class="note note-warning">
+ <p> @message </p>
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/PicturePopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/PicturePopup.cshtml
new file mode 100644
index 000000000..8caec2b5c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/PicturePopup.cshtml
@@ -0,0 +1,126 @@
+@using Microsoft.AspNetCore.Mvc.Razor
+@model PictureModel
+@{
+ Layout = "";
+}
+<form id="PicturePopup" asp-area="@Constants.AreaStore" asp-action="PicturePopup" enctype="multipart/form-data" method="post">
+ <!-- #region languages template -->
+ @{
+ Func<int, HelperResult> template = @<div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].AltAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].AltAttribute"/>
+ <span asp-validation-for="@Model.Locales[item].AltAttribute"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="@Model.Locales[item].TitleAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="@Model.Locales[item].TitleAttribute"/>
+ <span asp-validation-for="@Model.Locales[item].TitleAttribute"></span>
+ </div>
+ </div>
+ <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
+ </div>;
+ }
+ <div asp-validation-summary="All"></div>
+ <input asp-for="Id" type="hidden"/>
+ <input asp-for="ObjectId" type="hidden"/>
+ <input asp-for="PictureUrl" type="hidden"/>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ <text> @Loc["Admin.Catalog.Picture"]</text>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="PictureUrl"/>
+ <div class="col-md-9 col-sm-9">
+ <a href="@Model.PictureUrl" target="_blank">
+ <img src="@Model.PictureUrl" width="150"/>
+ </a>
+ </div>
+ </div>
+ <localized-editor localized-template="template" name="picturevalue-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AltAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AltAttribute"/>
+ <span asp-validation-for="AltAttribute"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TitleAttribute" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="TitleAttribute"/>
+ <span asp-validation-for="TitleAttribute"></span>
+ </div>
+ </div>
+ </div>
+ </localized-editor>
+ <div class="form-group">
+ <admin-label asp-for="Style"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="Style"/>
+ <span asp-validation-for="Style"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ExtraField"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="ExtraField"/>
+ <span asp-validation-for="ExtraField"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="offset-sm-3 offset-md-3 col-md-9 col-sm-9">
+ <button class="btn btn-success" type="submit" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#PicturePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/UserFields.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/UserFields.cshtml
new file mode 100644
index 000000000..34af7734b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/Partials/UserFields.cshtml
@@ -0,0 +1,141 @@
+@using Grand.Business.Core.Interfaces.Common.Stores
+@model Grand.Infrastructure.Models.BaseEntityModel
+@inject IContextAccessor contextAccessor
+@{
+ var userFields = Model.UserFields.ToList();
+ var stores = new List<SelectListItem>();
+ stores.Add(new SelectListItem
+ {
+ Text = contextAccessor.WorkContext.StoreManager.Shortcut,
+ Value = contextAccessor.WorkContext.StoreManager.Id
+ });
+}
+<vc:admin-widget widget-zone="userfield_details_info_top" additional-data="Model"/>
+<div class="form-horizontal form-userfield" id="form-userfield">
+ @for (var item = 0; item < userFields.Count; item++)
+ {
+ <div id="UserFieldsItem_@item" class="form-body">
+ <div class="form-group">
+ <label class="control-label col-md-3 col-sm-3">@userFields[item].Key</label>
+ <div class="col-md-6 col-sm-6">
+ <admin-input asp-for="@userFields[item].Value"/>
+ <input type="hidden" asp-for="@userFields[item].Key"/>
+ </div>
+ <div class="col-md-3 col-sm-3 input-group custom-input-group">
+ <admin-select asp-for="@userFields[item].StoreId" asp-items="@stores"/>
+ <span class="input-group-addon btn red deleteuserfield" data-id="@item" onclick="deleteUserFields(@item)">
+ <i class="fa fa fa-times"></i>
+ </span>
+ </div>
+ </div>
+ </div>
+ }
+</div>
+
+<script id="template" type="text/html">
+ <div id="UserFieldsItem_${id}" class="form-body">
+ <div class="form-group">
+ <label class="control-label col-md-3 col-sm-3">${key}</label>
+ <div class="col-md-6 col-sm-6">
+ <input class="form-control k-input text-box single-line valid"
+ id="UserFields_${id}__Value" name="UserFields[${id}].Value" type="text" value="${value}">
+ <input type="hidden" id="UserFields_${id}__Key" name="UserFields[${id}].Key" value="${key}">
+ </div>
+ <div class="col-md-3 col-sm-3 input-group custom-input-group">
+ <select id="UserFields_{id}__StoreId" name="UserFields[${id}].StoreId" class="form-control k-input valid">
+ @foreach (var store in stores)
+ {
+ <option value="@store.Value">@store.Text</option>
+ }
+ </select>
+ <span class="input-group-addon btn red deleteuserfield" data-id="${id}" onclick="deleteUserFields(${id})">
+ <i class="fa fa fa-times"></i>
+ </span>
+ </div>
+ </div>
+ </div>
+
+</script>
+
+<div class="panel panel-default">
+ <div class="panel-body">
+ <p>
+ <strong>@Loc["Admin.Common.UserFields.AddNew"]</strong>
+ </p>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <label class="control-label col-md-3 col-sm-3">@Loc["Admin.Common.UserFields.Fields.Key"]</label>
+ <div class="col-md-9 col-sm-9">
+ <input class="form-control k-input text-box single-line valid" id="ga_key" name="ga_key" type="text" value="">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label col-md-3 col-sm-3">@Loc["Admin.Common.UserFields.Fields.Value"]</label>
+ <div class="col-md-9 col-sm-9">
+ <input class="form-control k-input text-box single-line valid" id="ga_value" name="ga_value" type="text" value="">
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" id="addUserField" onclick="addUserFields()" class="k-primary k-button">
+ <i class="fa fa-plus"></i>@Loc["Admin.Common.UserFields.AddNew.Button"]
+ </button>
+ </div>
+</div>
+<script>
+ var counter = @userFields.Count;
+
+ function addUserFields()
+ {
+ const attrKey = $("#ga_key").val();
+ const attrValue = $("#ga_value").val();
+
+ //some validation
+ if (attrKey === "") {
+ alert('@Loc["Admin.Common.UserFields.Fields.Key.Required"]');
+ return;
+ }
+ if (attrValue === "") {
+ alert('@Loc["Admin.Common.UserFields.Fields.Value.Required"]');
+ return;
+ }
+ const data = { key: attrKey, value: attrValue, id: counter };
+ $("#template").tmpl(data).appendTo("#form-userfield");
+ counter = counter + 1;
+ }
+
+ function deleteUserFields(id) {
+ // remove record
+ document.getElementById('UserFieldsItem_' + id).remove();
+ counter = counter - 1;
+ // update records
+ const records = document.querySelectorAll('#form-userfield .form-body');
+ records.forEach(function (element, id) {
+ const input_val = element.querySelector('input[type="text"]');
+ const input_key = element.querySelector('input[type="hidden"]');
+ const input_del = element.querySelector('.deleteuserfield');
+ const select = element.querySelector('select');
+
+ input_del.setAttribute('data-id', id);
+ input_del.setAttribute('onclick', 'deleteUserFields('+id+')');
+
+ element.id = 'UserFieldsItem_' + id;
+
+ input_val.id = 'UserFields_' + id + '__Value';
+ input_val.setAttribute('name', 'UserFields[' + id + '].Value');
+
+ input_key.id = 'UserFields_' + id + '__Key';
+ input_key.setAttribute('name', 'UserFields[' + id + '].Key');
+
+ select.id = 'UserFields_' + id + '__StoreId';
+ select.setAttribute('name', 'UserFields[' + id + '].StoreId');
+
+
+ select.setAttribute('name', 'UserFields[' + id + '].StoreId');
+ });
+ }
+</script>
+<vc:admin-widget widget-zone="userfield_details_info_bottom" additional-data="Model"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLayout.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLayout.cshtml
new file mode 100644
index 000000000..2a206cfc3
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLayout.cshtml
@@ -0,0 +1,201 @@
+@using Grand.Domain.Localization
+@using Grand.Web.Common.TagHelpers
+@using Microsoft.AspNetCore.Mvc.TagHelpers
+@using Constants = Grand.SharedUIResources.Constants
+@inject IContextAccessor contextAccessor
+@inject LanguageSettings languageSettings
+@{
+ var currentCustomer = contextAccessor.WorkContext.CurrentCustomer;
+ var currentVersion = GrandVersion.FullVersion;
+ var supportRtl = contextAccessor.WorkContext.WorkingLanguage.Rtl &&
+ !languageSettings.IgnoreRtlPropertyForAdminArea;
+
+ //page title
+ var pageTitle = "";
+ if (!string.IsNullOrWhiteSpace(ViewBag.Title))
+ {
+ pageTitle = ViewBag.Title + " / ";
+ }
+
+ pageTitle += Loc["Admin.PageTitle"];
+}
+<!DOCTYPE html>
+<html @if (supportRtl)
+{
+ <text> dir="rtl" </text>
+}
+>
+<head>
+ <title>@pageTitle</title>
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
+ <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
+ <head-custom/>
+ <partial name="Partials/HeadStore"/>
+ <resources asp-type="HeadLink"/>
+ <resources asp-type="HeadScript"/>
+</head>
+<body class="nav-sm @if (IsSectionDefined("popupwindow")) {
+ @await RenderSectionAsync("popupwindow") <text>no-sidebar</text>
+ }">
+ @Html.AntiForgeryToken()
+<script>
+ kendo.culture("@CultureInfo.CurrentCulture.Name");
+ if (document.readyState == "loading") {
+ $(".site_title").css("padding-left", "26px");
+ if ($('body').hasClass('nav-sm')) {
+ $('#sidebar-menu').find('li.active').addClass('active-sm').removeClass('active');
+ $('#sidebar-menu').find('li.active-sm ul').hide();
+ }
+ }
+
+ </script>
+<div class="container body">
+ <div class="main_container">
+ <vc:store-widget widget-zone="store_store_header_before" additional-data="null"/>
+ @if (IsSectionDefined("headermenu"))
+ {
+ @await RenderSectionAsync("headermenu")
+ }
+ else
+ {
+ <partial name="Partials/Menu"/>
+ }
+ <vc:store-widget widget-zone="store_store_header_after" additional-data="null"/>
+ @if (IsSectionDefined("statusbar"))
+ {
+ @await RenderSectionAsync("statusbar")
+ }
+ @if (IsSectionDefined("header"))
+ {
+ @await RenderSectionAsync("header")
+ }
+ else
+ {
+ <vc:store-widget widget-zone="store_header_before" additional-data="null"/>
+ <div class="top_nav">
+ <div class="nav_menu">
+ <nav>
+ <vc:store-widget widget-zone="store_header_toggle_after" additional-data="null"/>
+ <ul class="nav navbar-nav navbar-right">
+
+ <li class="dropdown" role="presentation">
+ <a href="@Url.Action("Index", "Home", new { area = "" })" class="dropdown-toggle">
+ <i class="icon-home"></i>
+ </a>
+ </li>
+ <li role="presentation" class="dropdown">
+ <a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
+ <i class="icon-info"></i>
+ </a>
+ <ul id="menu1" class="dropdown-menu dropdown-menu-right list-unstyled msg_list overflow-h" role="menu">
+ <li>
+ <a href="http://docs.grandnode.com/" target="_blank">
+ <i class="icon-book-open"></i>
+ @Loc["Admin.Header.Documentation"]
+ </a>
+ </li>
+ <li>
+ <a href="https://grandnode.com/boards" target="_blank">
+ <i class="icon-bubbles"></i>
+ @Loc["Admin.Header.Community"]
+ </a>
+ </li>
+ <li>
+ <a href="https://grandnode.com/release-notes" target="_blank">
+ <i class="fa fa-dot-circle-o"></i>
+ grandnode @currentVersion
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
+ <img src="@(Constants.WwwRoot)/administration/build/images/avatar.png" alt="">
+ <div class="username-hide-on-mobile">
+ @(currentCustomer.Email)
+ </div>
+ <span class="fa fa-angle-down"></span>
+ </a>
+
+ <ul class="dropdown-menu dropdown-menu-right dropdown-menu-default">
+ <li>
+ <a href="@Url.Action("Logout", "Home", new { area = Grand.Web.Store.Extensions.Constants.AreaStore }, null)">
+ <i class="icon-logout"></i> @Loc["Admin.Header.Logout"]
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="dropdown" role="presentation">
+ <span id="searchIcon" class="searchIcon dropdown-toggle">
+ <i class="icon-magnifier"></i>
+ </span>
+ </li>
+ <li role="presentation">
+ <a>
+ <div class="custom-control custom-switch light-dark-switch">
+ <input type="checkbox" class="custom-control-input" id="DarkLight">
+ <label class="custom-control-label" for="DarkLight">Enable Dark Mode</label>
+ </div>
+ </a>
+ <script>
+ const toggleSwitch = document.querySelector('.light-dark-switch input[type="checkbox"]');
+ const currentTheme = localStorage.getItem('theme');
+
+ if (currentTheme) {
+ document.documentElement.setAttribute('data-theme', currentTheme);
+
+ if (currentTheme === 'dark') {
+ toggleSwitch.checked = true;
+ $('#DarkLight ~ label').text('Disable Dark Mode');
+ }
+ }
+
+ function switchTheme(e) {
+ if (e.target.checked) {
+ document.documentElement.setAttribute('data-theme', 'dark');
+ localStorage.setItem('theme', 'dark');
+ $('#DarkLight ~ label').text('Disable Dark Mode');
+
+ }
+ else {
+ document.documentElement.setAttribute('data-theme', 'light');
+ localStorage.setItem('theme', 'light');
+ $('#DarkLight ~ label').text('Enable Dark Mode');
+ }
+ }
+
+ toggleSwitch.addEventListener('change', switchTheme, false);
+ </script>
+ </li>
+ </ul>
+ </nav>
+ </div>
+ <div class="clear"></div>
+ </div>
+ <vc:store-widget widget-zone="store_header_navbar_after" additional-data="null"/>
+ }
+
+ <div class="right_col" role="main">
+ <partial name="Partials/Notifications"/>
+ @RenderBody()
+ </div>
+ <div class="throbber">
+ <div class="curtain">
+ </div>
+ <div class="curtain-content">
+ <div>
+ <h1 class="throbber-header">Wait...</h1>
+ <div class="spinner active">
+ <svg style="width:100px; height:100px" viewBox="0 0 64 64">
+ <circle cx="32" cy="32" r="29" fill="none" stroke-width="3" stroke-miterlimit="10"></circle>
+ </svg>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<resources asp-type="ScriptFooter"/>
+</body>
+</html>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLoginLayout.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLoginLayout.cshtml
new file mode 100644
index 000000000..d6b21c399
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shared/_StoreLoginLayout.cshtml
@@ -0,0 +1,47 @@
+@using Constants = Grand.SharedUIResources.Constants
+@using Grand.Web.AdminShared.Models.Common
+@model LoginModel
+@{
+ //page title
+ Layout = "";
+}
+@{
+ //page title
+ var adminPageTitle = "";
+ if (!string.IsNullOrWhiteSpace(ViewBag.Title))
+ {
+ adminPageTitle = ViewBag.Title + " / ";
+ }
+
+ adminPageTitle += Loc["Admin.Login.PageTitle"];
+}
+
+<!DOCTYPE html>
+<html>
+<head>
+ <title>@adminPageTitle</title>
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
+ <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
+
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/build/css/font-awesome.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/simple-line-icons/simple-line-icons.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/bootstrap/css/bootstrap.min.css"/>
+ <link rel="stylesheet" type="text/css" href="@(Constants.WwwRoot)/administration/build/css/custom.css"/>
+
+ <script src="@(Constants.WwwRoot)/administration/build/js/jquery.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/build/js/moment.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/jquery.validate.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/jquery.validate.unobtrusive.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/jquery-ui/jquery-ui.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/bootstrap/js/popper.min.js"></script>
+ <script src="@(Constants.WwwRoot)/administration/bootstrap/js/bootstrap.min.js"></script>
+</head>
+<body>
+<div class="container body admin-login-layout">
+ <div class="main_container">
+ @RenderBody()
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/AddShipment.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/AddShipment.cshtml
new file mode 100644
index 000000000..df73af52b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/AddShipment.cshtml
@@ -0,0 +1,182 @@
+@model ShipmentModel
+@{
+ //page title
+ ViewBag.Title = string.Format(Loc["Admin.Orders.Shipments.AddNew.Title"], Model.OrderId);
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Shipment" asp-action="AddShipment" method="post"
+ asp-route-orderId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["orderId"])">
+
+ <div asp-validation-summary="All"></div>
+ <input type="hidden" asp-for="@Model.OrderId"/>
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-truck"></i>
+ @string.Format(Loc["Admin.Orders.Shipments.AddNew.Title"], Model.OrderNumber)
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>
+ @Html.ActionLink(Loc["Admin.Orders.Shipments.BackToOrder"], "Edit", "Order", new { Id = Model.OrderId })
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <button class="btn btn-success" type="submit" id="shipment-save" name="save">
+ <i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
+ </button>
+ <button class="btn btn-success" type="submit" id="shipment-save-continue" name="save-continue">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
+ </button>
+ <vc:admin-widget widget-zone="order_shipment_add_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="TrackingNumber"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="TrackingNumber"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AdminComment"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="AdminComment"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ <h4>
+ <strong>@Loc["Admin.Orders.Shipments.Products"]</strong>
+ </h4>
+
+ <div class="table-responsive visible-xs-block visible-sm-block visible-md-block visible-lg-block">
+ <table class="table table-bordered table-striped table-hover">
+ <thead>
+ <tr>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ProductName"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.SKU"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.Warehouse"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ItemWeight"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ItemDimensions"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.QtyOrdered"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.QtyShipped"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.QtyToShip"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @for (var j = 0; j < Model.Items.Count; j++)
+ {
+ var item = Model.Items[j];
+ <input asp-for="@Model.Items[j].OrderItemId" type="hidden"/>
+ <tr>
+ <td>
+ <div style="padding-left:10px;padding-right:10px;">
+ <em>
+ <a href="@Url.Action("Edit", "Product", new { id = item.ProductId, area = Constants.AreaStore })">@item.ProductName</a>
+ </em>
+ @if (!string.IsNullOrEmpty(item.AttributeInfo))
+ {
+ <p>
+ @Html.Raw(item.AttributeInfo)
+ </p>
+ }
+ @if (item.ShipSeparately)
+ {
+ <p>
+ <strong>@Loc["Admin.Orders.Shipments.Products.ShipSeparately.Warning"]</strong>
+ @Loc["Admin.Orders.Shipments.Products.ShipSeparately"]
+ </p>
+ }
+ </div>
+ </td>
+ <td>
+ <div style="padding-left:10px;padding-right:10px;">
+ @item.Sku
+ </div>
+ </td>
+ <td>
+ <div>
+ @if (item.AllowToChooseWarehouse)
+ {
+ if (item.AvailableWarehouses.Count > 0)
+ {
+ <select asp-for="@Model.Items[j].WarehouseId">
+ @foreach (var warehouse in item.AvailableWarehouses)
+ {
+ var selected = warehouse.WarehouseId == item.WarehouseId;
+ <option value="@(warehouse.WarehouseId)" data-stock-qty="@(warehouse.StockQuantity)"
+ data-reserved-qty="@(warehouse.ReservedQuantity)"
+ selected="@selected">
+ @Loc["Admin.Orders.Shipments.Products.Warehouse.ChooseQty", warehouse.WarehouseName, warehouse.StockQuantity, warehouse.ReservedQuantity]
+ </option>
+ }
+ </select>
+ }
+ else
+ {
+ <div>@Loc["Admin.Orders.Shipments.Products.Warehouse.NotAvailabe"]</div>
+ }
+ }
+ else
+ {
+ //display warehouses
+ for (var i = 0; i < item.AvailableWarehouses.Count; i++)
+ {
+ var warehouse = item.AvailableWarehouses[i];
+ @warehouse.WarehouseName
+ if (i != item.AvailableWarehouses.Count - 1)
+ {
+ <br/>
+ }
+ }
+ }
+ </div>
+ </td>
+ <td>
+ @item.ItemWeight
+ </td>
+ <td>
+ @item.ItemDimensions
+ </td>
+ <td>
+ @item.QuantityOrdered
+ </td>
+ <td>
+ @item.QuantityInAllShipments
+ </td>
+ <td>
+ <input asp-for="@Model.Items[j].QuantityToAdd" type="number" value="@item.QuantityToAdd"
+ class="form-control" style="width:100px;" max="@item.QuantityToAdd"/>
+ </td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </div>
+
+
+</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/List.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/List.cshtml
new file mode 100644
index 000000000..0d65f4125
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/List.cshtml
@@ -0,0 +1,404 @@
+@model ShipmentListModel
+@inject AdminAreaSettings adminAreaSettings
+@{
+ ViewBag.Title = Loc["Admin.Orders.Shipments.List"];
+}
+
+<form asp-area="@Constants.AreaStore" asp-controller="Shipment" asp-action="List" method="post">
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.Shipments.List"]
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided util-btn-margin-bottom-5">
+ <button type="submit" name="exportpackagingslips-all" asp-action="PdfPackagingSlipAll" class="btn purple">
+ <i class="fa fa-file-pdf-o"></i>
+ @Loc["Admin.Orders.Shipments.PrintPackagingSlip.All"]
+ </button>
+ <button type="submit" id="exportpackagingslips-selected" class="btn blue">
+ <i class="fa fa-file-pdf-o"></i>
+ @Loc["Admin.Orders.Shipments.PrintPackagingSlip.Selected"]
+ </button>
+ <button class="btn btn-success" type="submit" id="ship-selected">
+ <i class="fa fa-check"></i> @Loc["Admin.Orders.Shipments.ShipSelected"]
+ </button>
+ <button class="btn btn-success" type="submit" id="deliver-selected">
+ <i class="fa fa-check-circle"></i> @Loc["Admin.Orders.Shipments.DeliverySelected"]
+ </button>
+ <vc:admin-widget widget-zone="order_shipment_list_buttons" additional-data="null"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-8 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="TrackingNumber" class="control-label"/>
+ <admin-input asp-for="TrackingNumber"/>
+ </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group">
+ <button class="btn btn-success filter-submit" id="search-shipments">
+ <i class="fa fa-search"></i> @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container w-100">
+ <div class="form-group">
+ <admin-label asp-for="StartDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="StartDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EndDate" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="EndDate"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="LoadNotShipped" class="col-sm-3 control-label"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="LoadNotShipped"/>
+ <div class="control__indicator"></div>
+ </label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="x_content">
+ <div id="shipments-grid"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ $(document).ready(function () {
+ $("#shipments-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ShipmentListSelect", "Shipment", new { area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: additionalData
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ //details grid
+ detailInit: detailInit,
+ scrollable: false,
+ dataBound: onDataBound,
+ columns: [{
+ field: "Id",
+ headerTemplate: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input id='mastercheckbox' type='checkbox'/> <div class='control__indicator'></div></label>",
+ template: "<label class='mt-checkbox mt-checkbox-outline control control-checkbox'><input type='checkbox' value='#=Id#' class='checkboxGroups'/> <div class='control__indicator'></div></label>",
+ width: 40
+ }, {
+ field: "ShipmentNumber",
+ title: "@Loc["Admin.Orders.Shipments.ID"]",
+ width: 100,
+ template: '<a class="k-link" href="@Url.Action("ShipmentDetails", "Shipment", new { area = Constants.AreaStore })/#=Id#">#=ShipmentNumber#</a>'
+ }, {
+ field: "OrderNumber",
+ title: "@Loc["Admin.Orders.Shipments.OrderID"]",
+ width: 100,
+ template: '<a class="k-link" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#">#=OrderNumber#</a>'
+ }, {
+ field: "TrackingNumber",
+ title: "@Loc["Admin.Orders.Shipments.TrackingNumber"]",
+ width: 100,
+ template: '<a class="k-link" href="@Url.Action("ShipmentDetails", "Shipment", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(TrackingNumber)#</a>'
+ }, {
+ field: "TotalWeight",
+ title: "@Loc["Admin.Orders.Shipments.TotalWeight"]",
+ width: 80,
+ minScreenWidth: 770,
+ }, {
+ field: "ShippedDate",
+ title: "@Loc["Admin.Orders.Shipments.ShippedDate"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "DeliveryDate",
+ title: "@Loc["Admin.Orders.Shipments.DeliveryDate"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}"
+ }]
+ });
+ });
+
+ function detailInit(e) {
+ $("<div/>").appendTo(e.detailCell).kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ShipmentsItemsByShipmentId", "Shipment", new { area = Constants.AreaStore }))?shipmentId="+e.data.Id,
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors"
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ scrollable: false,
+ sortable: true,
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ columns: [
+ {
+ field: "ProductName",
+ title: "@Loc["Admin.Orders.Shipments.Products.ProductName"]",
+ width: 400
+ },{
+ field: "ShippedFromWarehouse",
+ title: "@Loc["Admin.Orders.Shipments.Products.Warehouse"]",
+ width: 150
+ },{
+ field: "QuantityInThisShipment",
+ title: "@Loc["Admin.Orders.Shipments.Products.QtyShipped"]",
+ width: 150
+ },{
+ field: "ItemWeight",
+ title: "@Loc["Admin.Orders.Shipments.Products.ItemWeight"]",
+ width: 150
+ },{
+ field: "ItemDimensions",
+ title: "@Loc["Admin.Orders.Shipments.Products.ItemDimensions"]",
+ width: 150
+ }
+ ]
+ });
+ }
+ </script>
+
+
+ <script>
+
+ var selectedIds = [];
+
+ $(document).ready(function () {
+
+ $("#@Html.IdFor(model => model.CountryId)").change(function () {
+ var selectedItem = $(this).val();
+ var ddlStates = $("#@Html.IdFor(model => model.StateProvinceId)");
+ $.ajax({
+ cache: false,
+ type: "GET",
+ url: "@(Url.Action("GetStatesByCountryId", "Home", new { area = Constants.AreaStore }))",
+ data: { "countryId": selectedItem, "addAsterisk": "true" },
+ success: function (data) {
+ ddlStates.html('');
+ $.each(data, function (id, option) {
+ ddlStates.append($('<option></option>').val(option.id).html(option.name));
+ });
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ alert('Failed to retrieve states.');
+ }
+ });
+ });
+
+ $("#@Html.IdFor(model => model.TrackingNumber)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-shipments").click();
+ return false;
+ }
+ });
+ $("#@Html.IdFor(model => model.City)").keydown(function (event) {
+ if (event.keyCode == 13) {
+ $("#search-shipments").click();
+ return false;
+ }
+ });
+
+ $('#search-shipments').click(function () {
+ var grid = $('#shipments-grid').data('kendoGrid');
+ grid.dataSource.page(1);
+ $('.checkboxGroups').prop('checked', false).change();
+ selectedIds = [];
+ return false;
+ });
+
+ $('#ship-selected').click(function(e) {
+ e.preventDefault();
+
+ var postData = {
+ selectedIds: selectedIds
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("SetAsShippedSelected", "Shipment", new { area = Constants.AreaStore }))",
+ data: postData,
+ complete: function(data) {
+ var grid = $('#shipments-grid').data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert(thrownError);
+ },
+ traditional: true
+ });
+ return false;
+ });
+
+ $('#deliver-selected').click(function(e) {
+ e.preventDefault();
+
+ var postData = {
+ selectedIds: selectedIds
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("SetAsDeliveredSelected", "Shipment", new { area = Constants.AreaStore }))",
+ data: postData,
+ complete: function(data) {
+ var grid = $('#shipments-grid').data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function(xhr, ajaxOptions, thrownError) {
+ alert(thrownError);
+ },
+ traditional: true
+ });
+ return false;
+ });
+
+
+ $('#mastercheckbox').click(function () {
+ $('.checkboxGroups').prop('checked', $(this).is(':checked')).change();
+ });
+
+ $('#shipments-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function (e) {
+ var $check = $(this);
+ if ($check.is(":checked") == true) {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked == -1) {
+ selectedIds.push($check.val());
+ }
+ }
+ else {
+ var checked = jQuery.inArray($check.val(), selectedIds);
+ if (checked > -1) {
+ selectedIds = $.grep(selectedIds, function (item, index) {
+ return item != $check.val();
+ });
+ }
+ }
+ updateMasterCheckbox();
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ StartDate: $('#@Html.IdFor(model => model.StartDate)').val(),
+ EndDate: $('#@Html.IdFor(model => model.EndDate)').val(),
+ TrackingNumber: $('#@Html.IdFor(model => model.TrackingNumber)').val(),
+ CountryId: $('#@Html.IdFor(model => model.CountryId)').val(),
+ StateProvinceId: $('#@Html.IdFor(model => model.StateProvinceId)').val(),
+ City: $('#@Html.IdFor(model => model.City)').val(),
+ WarehouseId: $('#@Html.IdFor(model => model.WarehouseId)').val(),
+ LoadNotShipped: $('#@Html.IdFor(model => model.LoadNotShipped)').is(':checked')
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function onDataBound(e) {
+ $('#shipments-grid input[type=checkbox][id!=mastercheckbox]').each(function () {
+ var currentId = $(this).val();
+ var checked = jQuery.inArray(currentId, selectedIds);
+ $(this).prop('checked', checked > -1);
+ });
+
+ updateMasterCheckbox();
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#shipments-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#shipments-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+ </script>
+
+</form>
+<form asp-area="@Constants.AreaStore" asp-controller="Shipment" asp-action="PdfPackagingSlipSelected" method="post" id="pdf-packaging-slip-selected-form">
+
+ <input type="hidden" id="selectedIds" name="selectedIds" value=""/>
+</form>
+
+<script>
+
+ $(document).ready(function () {
+ $('#exportpackagingslips-selected').click(function (e) {
+ e.preventDefault();
+ var ids = selectedIds.join(",");
+ $('#pdf-packaging-slip-selected-form #selectedIds').val(ids);
+ $('#pdf-packaging-slip-selected-form').submit();
+ return false;
+ });
+ });
+
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Documents.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Documents.cshtml
new file mode 100644
index 000000000..3a2255401
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Documents.cshtml
@@ -0,0 +1,73 @@
+@model ShipmentModel
+@inject AdminAreaSettings adminAreaSettings
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_shipment_details_documents_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="shipment-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Shipment, area = Constants.AreaStore })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="order_shipment_details_documents_bottom" additional-data="Model"/>
+</div>
+
+<script>
+$(document).ready(function () {
+ $("#shipment-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Shipment, ObjectId = Model.Id, StatusId = -1, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id"
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ pageSize: @(adminAreaSettings.DefaultGridPageSize),
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
+ },
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaStore })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }]
+ });
+});
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Info.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Info.cshtml
new file mode 100644
index 000000000..624d85621
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/Info.cshtml
@@ -0,0 +1,245 @@
+@model ShipmentModel
+<div>
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="OrderId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">
+ <a href="@Url.Action("Edit", "Order", new { Id = Model.OrderId, area = Constants.AreaStore })">@Model.OrderNumber - @Loc["Admin.Common.View"]</a>
+ </label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TrackingNumber"/>
+ <div class="col-md-6">
+ <div class="input-group">
+ <div class="input-group-control">
+ <admin-input asp-for="TrackingNumber"/>
+ </div>
+ <div class="input-group-append">
+ <input type="submit" name="settrackingnumber" asp-action="SetTrackingNumber" value="@Loc["Admin.Orders.Shipments.TrackingNumber.Button"]" class="btn default"/>
+ @if (!string.IsNullOrEmpty(Model.TrackingNumberUrl))
+ {
+ <a href="@Model.TrackingNumberUrl" target="_blank" class="tracking-url">@Loc["Admin.Orders.Shipments.TrackingNumber.ViewOnline"]</a>
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AdminComment"/>
+ <div class="col-md-6">
+ <div class="input-group">
+ <div class="input-group-control">
+ <admin-input asp-for="AdminComment"/>
+ </div>
+ <div class="input-group-append">
+ <input type="submit" name="setadmincomment" asp-action="SetShipmentAdminComment" value="@Loc["Admin.Orders.Shipments.AdminComment.Button"]" class="btn default"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="TotalWeight"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.TotalWeight</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ShippedDate"/>
+ <div class="col-md-9 col-sm-9">
+ <span id="lblShippedDate">
+ @if (Model.ShippedDate.HasValue)
+ {
+ @Model.ShippedDate.Value.ToString(CultureInfo.InvariantCulture)
+ }
+ else
+ {
+ <text>@Loc["Admin.Orders.Shipments.ShippedDate.NotYet"]</text>
+ }
+ </span>
+ @if (Model.CanShip)
+ {
+ <input type="submit" name="setasshipped" asp-action="SetAsShipped" value="@Loc["Admin.Orders.Shipments.ShippedDate.Button"]" id="setasshipped" class="btn default"/>
+ }
+ @if (Model.ShippedDateUtc.HasValue)
+ {
+ <div id="divShippedDate" style="display: inline-block;"><admin-input asp-for="ShippedDate"/> &nbsp;@Loc["Admin.Orders.Shipments.ShippedDate.Enter"]</div>
+ <button type="submit" id="btnEditShippedDate" onclick=" toggleShippedDate(true);return false; " class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Common.Edit"]</button>
+ <button type="submit" id="btnSaveShippedDate" asp-action="EditShippedDate" name="saveshippeddate" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button"><span class="k-icon k-i-save"></span>&nbsp;@Loc["Admin.Common.Save"]</button>
+ <button type="submit" id="btnCancelShippedDate" onclick=" toggleShippedDate(false);return false; " class="k-button"><span class="k-icon k-i-cancel"></span>&nbsp;@Loc["Admin.Common.Cancel"]</button>
+ }
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="DeliveryDate"/>
+ <div class="col-md-9 col-sm-9">
+ <span id="lblDeliveryDate">
+ @if (Model.DeliveryDate.HasValue)
+ {
+ @Model.DeliveryDate.Value.ToString(CultureInfo.InvariantCulture)
+ }
+ else
+ {
+ <text>@Loc["Admin.Orders.Shipments.DeliveryDate.NotYet"]</text>
+ }
+ </span>
+ @if (Model.CanDeliver)
+ {
+ <input type="submit" name="setasdelivered" asp-action="SetAsDelivered" value="@Loc["Admin.Orders.Shipments.DeliveryDate.Button"]" id="setasdelivered" class="btn default"/>
+ }
+ @if (Model.DeliveryDateUtc.HasValue)
+ {
+ <div id="divDeliveryDate" style="display: inline-block;"><admin-input asp-for="DeliveryDate"/> &nbsp;@Loc["Admin.Orders.Shipments.DeliveryDate.Enter"]</div>
+ <button type="submit" id="btnEditDeliveryDate" onclick=" toggleDeliveryDate(true);return false; " class="k-button"><span class="k-icon k-i-edit"></span>&nbsp;@Loc["Admin.Common.Edit"]</button>
+ <button type="submit" id="btnSaveDeliveryDate" asp-action="EditDeliveryDate" name="savedeliverydate" onclick=" return confirm('@Loc["Admin.Common.AreYouSure"]'); " class="k-button"><span class="k-icon k-i-save"></span>&nbsp;@Loc["Admin.Common.Save"]</button>
+ <button type="submit" id="btnCancelDeliveryDate" onclick=" toggleDeliveryDate(false);return false; " class="k-button"><span class="k-icon k-i-cancel"></span>&nbsp;@Loc["Admin.Common.Cancel"]</button>
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+<table class="table table-striped table-hover">
+ <tr>
+ <td>
+ <strong>@Loc["Admin.Orders.Shipments.Products"]</strong>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table class="table table-bordered table-striped table-hover">
+ <thead>
+ <tr>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ProductName"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.SKU"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.Warehouse"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ItemWeight"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.ItemDimensions"]
+ </th>
+ <th>
+ @Loc["Admin.Orders.Shipments.Products.QtyShipped"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @foreach (var item in Model.Items)
+ {
+ <tr>
+ <td>
+ <div style="padding-left: 10px; padding-right: 10px;">
+ <em>
+ <a href="@Url.Action("Edit", "Product", new { id = item.ProductId, area = Constants.AreaStore })">@item.ProductName</a>
+ </em>
+ @if (!string.IsNullOrEmpty(item.AttributeInfo))
+ {
+ <p>
+ @Html.Raw(item.AttributeInfo)
+ </p>
+ }
+ @if (!string.IsNullOrEmpty(item.RentalInfo))
+ {
+ <p>
+ @Html.Raw(item.RentalInfo)
+ </p>
+ }
+ </div>
+ </td>
+ <td>
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.Sku
+ </div>
+ </td>
+ <td>
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.ShippedFromWarehouse
+ </div>
+ </td>
+ <td>
+ @item.ItemWeight
+ </td>
+ <td>
+ @item.ItemDimensions
+ </td>
+ <td>
+ @item.QuantityInThisShipment
+ </td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </td>
+ </tr>
+</table>
+
+@if (Model.ShipmentStatusEvents.Count > 0)
+{
+ <div class="form-horizontal">
+ <div class="note note-info">
+ @Loc["Admin.Orders.Shipments.ShipmentStatusEvents"]
+ </div>
+ <div class="form-body">
+ <div class="form-group">
+ <table class="table table-bordered table-striped table-hover">
+ <thead>
+ <tr>
+ <th align="center">
+ @Loc["Admin.Orders.Shipments.ShipmentStatusEvents.Event"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Orders.Shipments.ShipmentStatusEvents.Location"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Orders.Shipments.ShipmentStatusEvents.Country"]
+ </th>
+ <th align="center">
+ @Loc["Admin.Orders.Shipments.ShipmentStatusEvents.Date"]
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ @foreach (var item in Model.ShipmentStatusEvents)
+ {
+ <tr>
+ <td style="width:40%;">
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.EventName
+ </div>
+ </td>
+ <td style="width:20%;">
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.Location
+ </div>
+ </td>
+ <td style="width:20%;">
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @item.Country
+ </div>
+ </td>
+ <td style="width:20%;">
+ <div style="padding-left: 10px; padding-right: 10px;">
+ @if (item.Date.HasValue)
+ {
+ @item.Date.Value.ToString("D")
+ }
+ </div>
+ </td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/ShipmentNotes.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/ShipmentNotes.cshtml
new file mode 100644
index 000000000..e3860d968
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/Partials/ShipmentNotes.cshtml
@@ -0,0 +1,204 @@
+@using Grand.Domain.Media
+@model ShipmentModel
+@{
+ ViewData["DownloadType"] = DownloadType.Shipment;
+ ViewData["ReferenceId"] = Model.Id;
+}
+<div class="panel panel-default">
+ <vc:admin-widget widget-zone="order_shipment_details_notes_top" additional-data="Model"/>
+ <div class="panel-body">
+ <div id="shipmentnotes-grid"></div>
+ </div>
+ <vc:admin-widget widget-zone="order_shipment_details_notes_bottom" additional-data="Model"/>
+</div>
+<script>
+ $(document).ready(function () {
+ $("#shipmentnotes-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ShipmentNotesSelect", "Shipment", new { shipmentId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ShipmentNoteDelete", "Shipment", new { shipmentId = Model.Id, area = Constants.AreaStore }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ //do not implicitly specify all fields
+ //we do it only for fields which implicitly require it
+ //otherwise, they'll be formatted wrong way
+ CreatedOn: {type: "date" }
+ }
+ }
+ },
+ error: function(e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "CreatedOn",
+ title: "@Loc["Admin.Orders.Shipments.ShipmentNotes.CreatedOn"]",
+ width: 180,
+ type: "date",
+ format: "{0:G}"
+ }, {
+ field: "Note",
+ title: "@Loc["Admin.Orders.Shipments.ShipmentNotes.Note"]",
+ width: 350,
+ encoded: false
+ }, {
+ field: "DownloadId",
+ title: "@Loc["Admin.Orders.Shipments.ShipmentNotes.Download"]",
+ width: 100,
+ template: '# if(DownloadId != "") {# <a href="@Url.Action("DownloadFile", "Download", new { area = Constants.AreaStore })/?downloadGuid=#=DownloadGuid#">@Loc["Admin.Orders.OrderNotes.Fields.Download.Link"]</a> #} else {# @Loc["Admin.Orders.OrderNotes.Fields.Download.Link.No"] #} #'
+ }, {
+ field: "CreatedByCustomer",
+ title: "@Loc["Admin.Orders.Shipments.ShipmentNotes.CreatedByCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(CreatedByCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ field: "DisplayToCustomer",
+ title: "@Loc["Admin.Orders.Shipments.ShipmentNotes.Fields.DisplayToCustomer"]",
+ width: 100,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(DisplayToCustomer) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
+ }, {
+ command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
+ title: "@Loc["Admin.Common.Delete"]",
+ width: 100
+ }]
+ });
+ });
+</script>
+<p>
+ <strong>
+ @Loc["Admin.Orders.Shipments.ShipmentNotes.AddTitle"]
+ </strong>
+</p>
+<script>
+ $(document).ready(function () {
+ $("#@Html.IdFor(model => model.AddShipmentNoteHasDownload)").change(toggleAddShipmentNoteHasDownload);
+ toggleAddShipmentNoteHasDownload();
+ });
+ function toggleAddShipmentNoteHasDownload() {
+ if ($('#@Html.IdFor(model => model.AddShipmentNoteHasDownload)').is(':checked')) {
+ $('#pnlAddShipmentNoteDownloadId').show();
+ }
+ else {
+ $('#pnlAddShipmentNoteDownloadId').hide();
+ }
+ }
+
+</script>
+
+<div class="form-horizontal">
+ <div class="form-body">
+ <div class="form-group">
+ <admin-label asp-for="AddShipmentNoteMessage"/>
+ <div class="col-md-9 col-sm-9">
+ <admin-textarea asp-for="AddShipmentNoteMessage"></admin-textarea>
+ <span asp-validation-for="AddShipmentNoteMessage"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddShipmentNoteDownloadId"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddShipmentNoteHasDownload"/>
+ <div class="control__indicator"></div>
+ </label>
+ <div id="pnlAddShipmentNoteDownloadId">
+ <admin-input asp-for="AddShipmentNoteDownloadId"/>
+ <span asp-validation-for="AddShipmentNoteDownloadId"></span>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="AddShipmentNoteDisplayToCustomer"/>
+ <div class="col-md-9 col-sm-9">
+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
+ <admin-input asp-for="AddShipmentNoteDisplayToCustomer"/>
+ <div class="control__indicator"></div>
+ </label>
+ <span asp-validation-for="AddShipmentNoteDisplayToCustomer"></span>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="offset-md-3 col-md-9 col-sm-9">
+ <button type="button" id="addShipmentNote" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Orders.Shipments.ShipmentNotes.AddButton"]</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+ $(document).ready(function () {
+ $('#addShipmentNote').click(function () {
+ var shipmentNoteMessage = $("#@Html.IdFor(model => model.AddShipmentNoteMessage)").val();
+ if (shipmentNoteMessage.length == 0) {
+ alert('Message text is required');
+ return;
+ }
+ var shipmentNoteDownloadId = '';
+ if ($('#@Html.IdFor(model => model.AddShipmentNoteHasDownload)').is(':checked')) {
+ shipmentNoteDownloadId = $("#@Html.IdFor(model => model.AddShipmentNoteDownloadId)").val();
+ }
+ var shipmentNoteDisplayToCustomer = $("#@Html.IdFor(model => model.AddShipmentNoteDisplayToCustomer)").is(':checked');
+ $('#addShipmentNote').attr('disabled', true);
+ var postData = {
+ DisplayToCustomer: shipmentNoteDisplayToCustomer,
+ message: shipmentNoteMessage,
+ downloadId: shipmentNoteDownloadId,
+ shipmentId: '@Model.Id'
+ };
+ addAntiForgeryToken(postData);
+
+ $.ajax({
+ cache:false,
+ type: "POST",
+ url: "@(Url.Action("ShipmentNoteAdd", "Shipment", new { area = Constants.AreaStore }))",
+ data: postData,
+ success: function (data) {
+ var grid = $("#shipmentnotes-grid").data('kendoGrid');
+ grid.dataSource.read();
+ $('#addShipmentNote').attr('disabled', false);
+ },
+ error:function (xhr, ajaxOptions, thrownError){
+ alert('Failed to add shipment note.');
+ $('#addShipmentNote').attr('disabled', false);
+ }
+ });
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/ShipmentDetails.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/ShipmentDetails.cshtml
new file mode 100644
index 000000000..67fa15e92
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/Shipment/ShipmentDetails.cshtml
@@ -0,0 +1,125 @@
+@using Grand.Business.Core.Interfaces.Common.Security
+@using Grand.Domain.Permissions
+@model ShipmentModel
+@inject IPermissionService permissionService
+@{
+ //page title
+ ViewBag.Title = Loc["Admin.Orders.Shipments.ViewDetails"];
+ var canManageDocuments = await permissionService.Authorize(StandardPermission.ManageDocuments);
+}
+<form asp-area="@Constants.AreaStore" asp-controller="Shipment" asp-action="ShipmentDetails" method="post">
+ <input type="hidden" asp-for="Id"/>
+ <script>
+ $(document).ready(function () {
+ toggleShippedDate(false);
+ toggleDeliveryDate(false);
+ });
+
+ function toggleShippedDate(editmode) {
+ if (editmode) {
+ $('#lblShippedDate').hide();
+ $('#divShippedDate').show();
+ $('#btnEditShippedDate').hide();
+ $('#btnSaveShippedDate').show();
+ $('#btnCancelShippedDate').show();
+ }
+ else {
+ $('#lblShippedDate').show();
+ $('#divShippedDate').hide();
+ $('#btnEditShippedDate').show();
+ $('#btnSaveShippedDate').hide();
+ $('#btnCancelShippedDate').hide();
+ }
+ }
+
+ function toggleDeliveryDate(editmode) {
+ if (editmode) {
+ $('#lblDeliveryDate').hide();
+ $('#divDeliveryDate').show();
+ $('#btnEditDeliveryDate').hide();
+ $('#btnSaveDeliveryDate').show();
+ $('#btnCancelDeliveryDate').show();
+ }
+ else {
+ $('#lblDeliveryDate').show();
+ $('#divDeliveryDate').hide();
+ $('#btnEditDeliveryDate').show();
+ $('#btnSaveDeliveryDate').hide();
+ $('#btnCancelDeliveryDate').hide();
+ }
+ }
+ </script>
+ <div asp-validation-summary="All"></div>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-truck"></i>
+ @Loc["Admin.Orders.Shipments.ViewDetails"] - @Model.ShipmentNumber
+ <small>
+ <i class="fa fa-arrow-circle-left"></i>
+ @Html.ActionLink(Loc["Admin.Orders.Shipments.BackToList"], "List")
+ </small>
+ </div>
+ <div class="actions">
+ <div class="btn-group btn-group-devided">
+ <a href="@Url.Action("PdfPackagingSlip", new { shipmentId = Model.Id, area = Constants.AreaStore })" class="btn purple">
+ <i class="fa fa-file-pdf-o"></i> @Loc["Admin.Orders.Shipments.PrintPackagingSlip"]
+ </a>
+ <span id="shipment-delete" class="btn red">
+ <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
+ </span>
+ <vc:admin-widget widget-zone="order_shipment_details_buttons" additional-data="Model"/>
+ </div>
+ </div>
+ </div>
+ <div class="x_content form">
+ <admin-tabstrip name="shipment-edit" SetTabPos="true">
+ <items>
+ <tabstrip-item text="@Loc["Admin.Orders.Shipments.ViewDetails.Info"]" tab-index="0">
+ <content>
+ <div>
+ <partial name="Partials/Info" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ @if (canManageDocuments)
+ {
+ <tabstrip-item text="@Loc["Admin.Orders.Shipments.Documents"]" tab-index="1">
+ <content>
+ <div>
+ <partial name="Partials/Documents" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ }
+ <tabstrip-item text="@Loc["Admin.Orders.Shipments.ShipmentNotes"]" tab-index="2">
+ <content>
+ <div>
+ <partial name="Partials/ShipmentNotes" model="Model"/>
+ </div>
+ </content>
+ </tabstrip-item>
+ <tabstrip-item text="@Loc["Admin.Common.UserFields.Tab"]" tab-index="3">
+ <content>
+ <div>
+ <div class="form-actions">
+ <input type="submit" asp-action="EditUserFields" value="@Loc["Admin.Common.Save"]" id="btnSaveUserFields" name="save-generic-attributes" class="k-button"/>
+ </div>
+ <div class="form-horizontal">
+ <partial name="Partials/UserFields" model="Model"/>
+ </div>
+ </div>
+ </content>
+ </tabstrip-item>
+ <vc:admin-widget widget-zone="order_shipment_details_tabs" additional-data="Model"/>
+ </items>
+ </admin-tabstrip>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</form>
+<admin-delete-confirmation button-id="shipment-delete" action-name="DeleteShipment"/>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml
new file mode 100644
index 000000000..baff7dc33
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml
@@ -0,0 +1,34 @@
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@addTagHelper *, Grand.Web.Common
+@addTagHelper *, Grand.Web.Store
+
+@using System.Globalization
+@using Grand.Web.Common.Localization
+@using Microsoft.AspNetCore.Http.Extensions
+@using Microsoft.AspNetCore.Mvc.ViewFeatures
+@using System.Text
+@using Grand.SharedKernel.Extensions
+@using Grand.Infrastructure
+@using Grand.Domain.Common
+@using Grand.Domain.Catalog
+@using Grand.Domain.Directory
+@using Grand.Domain.Documents
+@using Grand.Domain.Orders
+@using Grand.Infrastructure.TypeConverters
+@using Grand.Business.Core.Interfaces.Cms
+@using Grand.Web.Common
+@using Grand.Web.Common.Events
+@using Grand.Web.Common.Extensions
+@using Grand.Web.Common.Security.Captcha
+@using Grand.Web.Common.Themes
+@using Grand.Web.Common.Page
+@using Grand.Web.Common.Link;
+@using Grand.Web.Store.Extensions
+@using Grand.Web.AdminShared.Models.Catalog
+@using Grand.Web.AdminShared.Models.Orders
+@using Grand.Web.AdminShared.Models.Common
+@using Grand.Web.AdminShared.Models.Customers
+@using Grand.Web.AdminShared.Models.Cms
+
+@inject LocService Loc
+@inject IEnumTranslationService EnumTranslationService
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewStart.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewStart.cshtml
new file mode 100644
index 000000000..e2b8173f2
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Areas/Store/Views/_ViewStart.cshtml
@@ -0,0 +1,4 @@
+@using Grand.Web.Store.Extensions
+@{
+ Layout = Constants.LayoutStore;
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByAmount.cs b/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByAmount.cs
new file mode 100644
index 000000000..fbcdcc2dd
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByAmount.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreBestsellersBriefReportByAmountViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreBestsellersBriefReportByAmountViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByQuantity.cs b/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByQuantity.cs
new file mode 100644
index 000000000..754ff6c3c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreBestsellersBriefReportByQuantity.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreBestsellersBriefReportByQuantityViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreBestsellersBriefReportByQuantityViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreCustomerReportRegistered.cs b/src/Web/Grand.Web.Store/Components/StoreCustomerReportRegistered.cs
new file mode 100644
index 000000000..f6c9880e9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreCustomerReportRegistered.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreCustomerReportRegisteredViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreCustomerReportRegisteredViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageReports))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreCustomerReportTimeChart.cs b/src/Web/Grand.Web.Store/Components/StoreCustomerReportTimeChart.cs
new file mode 100644
index 000000000..0b1113cf0
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreCustomerReportTimeChart.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreCustomerReportTimeChartViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreCustomerReportTimeChartViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageReports))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreLatestOrder.cs b/src/Web/Grand.Web.Store/Components/StoreLatestOrder.cs
new file mode 100644
index 000000000..d7a22c11d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreLatestOrder.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreLatestOrderViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreLatestOrderViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreOrderAverageReport.cs b/src/Web/Grand.Web.Store/Components/StoreOrderAverageReport.cs
new file mode 100644
index 000000000..7d23bd9b1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreOrderAverageReport.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreOrderAverageReportViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreOrderAverageReportViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreOrderIncompleteReport.cs b/src/Web/Grand.Web.Store/Components/StoreOrderIncompleteReport.cs
new file mode 100644
index 000000000..008f3fc2c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreOrderIncompleteReport.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreOrderIncompleteReportViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreOrderIncompleteReportViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreOrderPeriodReport.cs b/src/Web/Grand.Web.Store/Components/StoreOrderPeriodReport.cs
new file mode 100644
index 000000000..783626446
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreOrderPeriodReport.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreOrderPeriodReportViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreOrderPeriodReportViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreOrderTimeChart.cs b/src/Web/Grand.Web.Store/Components/StoreOrderTimeChart.cs
new file mode 100644
index 000000000..1aa983c98
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreOrderTimeChart.cs
@@ -0,0 +1,24 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Domain.Permissions;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreOrderTimeChartViewComponent : BaseAdminViewComponent
+{
+ private readonly IPermissionService _permissionService;
+
+ public StoreOrderTimeChartViewComponent(IPermissionService permissionService)
+ {
+ _permissionService = permissionService;
+ }
+
+ public async Task<IViewComponentResult> InvokeAsync()
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ return View();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StorePage.cs b/src/Web/Grand.Web.Store/Components/StorePage.cs
new file mode 100644
index 000000000..f1b66bcff
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StorePage.cs
@@ -0,0 +1,36 @@
+using Grand.Business.Core.Interfaces.Cms;
+using Grand.Web.Common.Components;
+using Grand.Web.Store.Models.Common;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Vendor.Components;
+
+public class StorePageViewComponent : BaseVendorViewComponent
+{
+ #region Fields
+
+ private readonly IPageService _pageService;
+
+ #endregion
+
+ #region Constructors
+
+ public StorePageViewComponent(
+ IPageService pageService)
+ {
+ _pageService = pageService;
+ }
+
+ #endregion
+
+ #region Invoker
+
+ public async Task<IViewComponentResult> InvokeAsync(string systemName)
+ {
+ var page = await _pageService.GetPageBySystemName(systemName);
+ var model = new StorePortalModel(page?.Title, page?.Body);
+ return View(model);
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Components/StoreWidget.cs b/src/Web/Grand.Web.Store/Components/StoreWidget.cs
new file mode 100644
index 000000000..dcf15adae
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Components/StoreWidget.cs
@@ -0,0 +1,57 @@
+using Grand.Business.Core.Interfaces.Cms;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Models.Cms;
+using Grand.Web.Common.Components;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Components;
+
+public class StoreWidgetViewComponent : BaseVendorViewComponent
+{
+ #region Constructors
+
+ public StoreWidgetViewComponent(IWidgetService widgetService, IContextAccessor contextAccessor)
+ {
+ _widgetService = widgetService;
+ _contextAccessor = contextAccessor;
+ }
+
+ #endregion
+
+ #region Invoker
+
+ public async Task<IViewComponentResult> InvokeAsync(string widgetZone, object additionalData = null)
+ {
+ var model = new List<AdminWidgetModel>();
+
+ var widgets = await _widgetService.LoadActiveWidgetsByWidgetZone(widgetZone, _contextAccessor.StoreContext.CurrentStore.Id,
+ _contextAccessor.WorkContext.CurrentCustomer);
+ foreach (var item in widgets)
+ {
+ var viewComponentName = await item.GetPublicViewComponentName(widgetZone);
+ var widgetModel = new AdminWidgetModel {
+ WidgetZone = widgetZone,
+ ViewComponentName = viewComponentName
+ };
+ model.Add(widgetModel);
+ }
+
+ if (!model.Any())
+ return Content("");
+
+ if (additionalData == null) return View(model);
+
+ foreach (var item in model) item.AdditionalData = additionalData;
+
+ return View(model);
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IWidgetService _widgetService;
+ private readonly IContextAccessor _contextAccessor;
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/BaseStoreController.cs b/src/Web/Grand.Web.Store/Controllers/BaseStoreController.cs
new file mode 100644
index 000000000..2d7ef2e6c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/BaseStoreController.cs
@@ -0,0 +1,15 @@
+using Grand.Web.Common.Controllers;
+using Grand.Web.Common.Filters;
+using Grand.Web.Store.Extensions;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[AutoValidateAntiforgeryToken]
+[Area(Constants.AreaStore)]
+[AuthorizeStore]
+[AuthorizeMenu]
+public abstract class BaseStoreController : BaseController
+{
+
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/BrandController.cs b/src/Web/Grand.Web.Store/Controllers/BrandController.cs
new file mode 100644
index 000000000..c4b027f1d
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/BrandController.cs
@@ -0,0 +1,289 @@
+using Grand.Business.Core.Extensions;
+using Grand.Business.Core.Interfaces.Catalog.Brands;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Catalog;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Brands)]
+public class BrandController : BaseStoreController
+{
+ #region Constructors
+
+ public BrandController(
+ IBrandViewModelService brandViewModelService,
+ IBrandService brandService,
+ IContextAccessor contextAccessor,
+ ILanguageService languageService,
+ ITranslationService translationService,
+ IPictureViewModelService pictureViewModelService)
+ {
+ _brandViewModelService = brandViewModelService;
+ _brandService = brandService;
+ _contextAccessor = contextAccessor;
+ _languageService = languageService;
+ _translationService = translationService;
+ _pictureViewModelService = pictureViewModelService;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IBrandViewModelService _brandViewModelService;
+ private readonly IBrandService _brandService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly ILanguageService _languageService;
+ private readonly ITranslationService _translationService;
+ private readonly IPictureViewModelService _pictureViewModelService;
+
+ #endregion
+
+ #region List
+
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public IActionResult List()
+ {
+ var model = new BrandListModel();
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> List(DataSourceRequest command, BrandListModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var brands = await _brandService.GetAllBrands(model.SearchBrandName, model.SearchStoreId, command.Page - 1, command.PageSize, true);
+ var gridModel = new DataSourceResult {
+ Data = brands.Select(x => x.ToModel()),
+ Total = brands.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Create / Edit / Delete
+
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ public async Task<IActionResult> Create([FromServices] CatalogSettings catalogSettings)
+ {
+ var model = new BrandModel();
+ //locales
+ await AddLocales(_languageService, model.Locales);
+ //layouts
+ await _brandViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _brandViewModelService.PrepareDiscountModel(model, null, true);
+ //default values
+ model.PageSize = catalogSettings.DefaultPageSize;
+ model.PageSizeOptions = catalogSettings.DefaultPageSizeOptions;
+ model.Published = true;
+ model.AllowCustomersToSelectPageSize = true;
+ //sort options
+ _brandViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Create(BrandModel model, bool continueEditing)
+ {
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ var collection = await _brandViewModelService.InsertBrandModel(model);
+ Success(_translationService.GetResource("Admin.Catalog.Brands.Added"));
+ return continueEditing ? RedirectToAction("Edit", new { id = collection.Id }) : RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ //layouts
+ await _brandViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _brandViewModelService.PrepareDiscountModel(model, null, true);
+ //sort options
+ _brandViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var brand = await _brandService.GetBrandById(id);
+ if (brand == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (!brand.LimitedToStores || (brand.LimitedToStores &&
+ brand.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
+ brand.Stores.Count > 1))
+ {
+ Warning(_translationService.GetResource("Admin.Catalog.Brands.Permissions"));
+ }
+ else
+ {
+ if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("List");
+ }
+
+
+ var model = brand.ToModel();
+ //locales
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.Name = brand.GetTranslation(x => x.Name, languageId, false);
+ locale.Description = brand.GetTranslation(x => x.Description, languageId, false);
+ locale.BottomDescription = brand.GetTranslation(x => x.BottomDescription, languageId, false);
+ locale.MetaKeywords = brand.GetTranslation(x => x.MetaKeywords, languageId, false);
+ locale.MetaDescription = brand.GetTranslation(x => x.MetaDescription, languageId, false);
+ locale.MetaTitle = brand.GetTranslation(x => x.MetaTitle, languageId, false);
+ locale.SeName = brand.GetSeName(languageId, false);
+ });
+ //layouts
+ await _brandViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _brandViewModelService.PrepareDiscountModel(model, brand, false);
+ //sort options
+ _brandViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Edit(BrandModel model, bool continueEditing)
+ {
+ var brand = await _brandService.GetBrandById(model.Id);
+ if (brand == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = brand.Id });
+
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ brand = await _brandViewModelService.UpdateBrandModel(brand, model);
+ Success(_translationService.GetResource("Admin.Catalog.Brands.Updated"));
+
+ if (continueEditing)
+ {
+ //selected tab
+ await SaveSelectedTabIndex();
+
+ return RedirectToAction("Edit", new { id = brand.Id });
+ }
+
+ return RedirectToAction("List");
+ }
+
+
+ //If we got this far, something failed, redisplay form
+ //layouts
+ await _brandViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _brandViewModelService.PrepareDiscountModel(model, brand, true);
+ //sort options
+ _brandViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var brand = await _brandService.GetBrandById(id);
+ if (brand == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = brand.Id });
+
+ if (ModelState.IsValid)
+ {
+ await _brandViewModelService.DeleteBrand(brand);
+
+ Success(_translationService.GetResource("Admin.Catalog.Brands.Deleted"));
+ return RedirectToAction("List");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", new { id = brand.Id });
+ }
+
+ #endregion
+
+ #region Picture
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> PicturePopup(string brandId)
+ {
+ var brand = await _brandService.GetBrandById(brandId);
+ if (brand == null)
+ return Content("Brand not exist");
+
+ if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your brand");
+
+ if (string.IsNullOrEmpty(brand.PictureId))
+ return Content("Picture not exist");
+
+ return View("Partials/PicturePopup",
+ await _pictureViewModelService.PreparePictureModel(brand.PictureId, brand.Id));
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> PicturePopup(PictureModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var brand = await _brandService.GetBrandById(model.ObjectId);
+ if (brand == null)
+ throw new ArgumentException("No brand found with the specified id");
+
+ if (!brand.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your brand");
+
+ if (string.IsNullOrEmpty(brand.PictureId))
+ throw new ArgumentException("No picture found with the specified id");
+
+ if (brand.PictureId != model.Id)
+ throw new ArgumentException("Picture ident doesn't fit with brand");
+
+ await _pictureViewModelService.UpdatePicture(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+
+ return View("Partials/PicturePopup", model);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/CategoryController.cs b/src/Web/Grand.Web.Store/Controllers/CategoryController.cs
new file mode 100644
index 000000000..1c968a635
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/CategoryController.cs
@@ -0,0 +1,355 @@
+using Grand.Business.Core.Extensions;
+using Grand.Business.Core.Interfaces.Catalog.Categories;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Catalog;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Categories)]
+public class CategoryController : BaseStoreController
+{
+ #region Constructors
+
+ public CategoryController(
+ ICategoryService categoryService,
+ ICategoryViewModelService categoryViewModelService,
+ ILanguageService languageService,
+ ITranslationService translationService,
+ IContextAccessor contextAccessor,
+ IGroupService groupService,
+ IPictureViewModelService pictureViewModelService)
+ {
+ _categoryService = categoryService;
+ _categoryViewModelService = categoryViewModelService;
+ _languageService = languageService;
+ _translationService = translationService;
+ _contextAccessor = contextAccessor;
+ _groupService = groupService;
+ _pictureViewModelService = pictureViewModelService;
+ }
+
+ #endregion
+
+ #region Utilities
+
+ protected async Task<(bool allow, string message)> CheckAccessToCategory(Category category)
+ {
+ if (category == null) return (false, "Category not exists");
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
+ if (!(!category.LimitedToStores || (category.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
+ category.LimitedToStores)))
+ return (false, "This is not your category");
+ return (true, null);
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly ICategoryService _categoryService;
+ private readonly ICategoryViewModelService _categoryViewModelService;
+ private readonly ILanguageService _languageService;
+ private readonly ITranslationService _translationService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly IGroupService _groupService;
+ private readonly IPictureViewModelService _pictureViewModelService;
+
+ #endregion
+
+ #region List
+
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public async Task<IActionResult> List()
+ {
+ var model = await _categoryViewModelService.PrepareCategoryListModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> List(DataSourceRequest command, CategoryListModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var categories = await _categoryViewModelService.PrepareCategoryListModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = categories.categoryListModel,
+ Total = categories.totalCount
+ };
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Create / Edit / Delete
+
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ public async Task<IActionResult> Create()
+ {
+ var model = await _categoryViewModelService.PrepareCategoryModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ //locales
+ await AddLocales(_languageService, model.Locales);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Create(CategoryModel model, bool continueEditing)
+ {
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ var category = await _categoryViewModelService.InsertCategoryModel(model);
+ Success(_translationService.GetResource("Admin.Catalog.Categories.Added"));
+ return continueEditing ? RedirectToAction("Edit", new { id = category.Id }) : RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ model = await _categoryViewModelService.PrepareCategoryModel(model, null, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var category = await _categoryService.GetCategoryById(id);
+ if (category == null)
+ //No category found with the specified id
+ return RedirectToAction("List");
+
+ if (!category.LimitedToStores || (category.LimitedToStores &&
+ category.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
+ category.Stores.Count > 1))
+ {
+ Warning(_translationService.GetResource("Admin.Catalog.Categories.Permissions"));
+ }
+ else
+ {
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("List");
+ }
+
+ var model = category.ToModel();
+ //locales
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.Name = category.GetTranslation(x => x.Name, languageId, false);
+ locale.Description = category.GetTranslation(x => x.Description, languageId, false);
+ locale.BottomDescription = category.GetTranslation(x => x.BottomDescription, languageId, false);
+ locale.MetaKeywords = category.GetTranslation(x => x.MetaKeywords, languageId, false);
+ locale.MetaDescription = category.GetTranslation(x => x.MetaDescription, languageId, false);
+ locale.MetaTitle = category.GetTranslation(x => x.MetaTitle, languageId, false);
+ locale.SeName = category.GetSeName(languageId, false);
+ locale.Flag = category.GetTranslation(x => x.Flag, languageId, false);
+ });
+
+ model = await _categoryViewModelService.PrepareCategoryModel(model, category, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Edit(CategoryModel model, bool continueEditing)
+ {
+ var category = await _categoryService.GetCategoryById(model.Id);
+ if (category == null)
+ //No category found with the specified id
+ return RedirectToAction("List");
+
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = category.Id });
+
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ category = await _categoryViewModelService.UpdateCategoryModel(category, model);
+
+ Success(_translationService.GetResource("Admin.Catalog.Categories.Updated"));
+ if (continueEditing)
+ {
+ //selected tab
+ await SaveSelectedTabIndex();
+
+ return RedirectToAction("Edit", new { id = category.Id });
+ }
+
+ return RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ model = await _categoryViewModelService.PrepareCategoryModel(model, category, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var category = await _categoryService.GetCategoryById(id);
+ if (category == null)
+ //No category found with the specified id
+ return RedirectToAction("List");
+
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = category.Id });
+
+ if (ModelState.IsValid)
+ {
+ await _categoryViewModelService.DeleteCategory(category);
+ Success(_translationService.GetResource("Admin.Catalog.Categories.Deleted"));
+ }
+
+ return RedirectToAction("List");
+ }
+
+ #endregion
+
+ #region Picture
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> PicturePopup(string categoryId)
+ {
+ var category = await _categoryService.GetCategoryById(categoryId);
+ if (category == null)
+ return Content("Category not exist");
+
+ if (string.IsNullOrEmpty(category.PictureId))
+ return Content("Picture not exist");
+
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your category");
+
+ return View("Partials/PicturePopup",
+ await _pictureViewModelService.PreparePictureModel(category.PictureId, category.Id));
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> PicturePopup(PictureModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var category = await _categoryService.GetCategoryById(model.ObjectId);
+ if (category == null)
+ throw new ArgumentException("No category found with the specified id");
+
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your category");
+
+ if (string.IsNullOrEmpty(category.PictureId))
+ throw new ArgumentException("No picture found with the specified id");
+
+ if (category.PictureId != model.Id)
+ throw new ArgumentException("Picture ident doesn't fit with category");
+
+ await _pictureViewModelService.UpdatePicture(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+
+ return View("Partials/PicturePopup", model);
+ }
+
+ #endregion
+
+ #region Products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductList(DataSourceRequest command, string categoryId)
+ {
+ var category = await _categoryService.GetCategoryById(categoryId);
+ if (!category.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson("This is not your category");
+
+ var productCategories = await _categoryViewModelService.PrepareCategoryProductModel(categoryId, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = productCategories.categoryProductModels,
+ Total = productCategories.totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductUpdate(CategoryModel.CategoryProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _categoryViewModelService.UpdateProductCategoryModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductDelete(CategoryModel.CategoryProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _categoryViewModelService.DeleteProductCategoryModel(model.Id, model.ProductId);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAddPopup(string categoryId)
+ {
+ var model = await _categoryViewModelService.PrepareAddCategoryProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.CategoryId = categoryId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command, CategoryModel.AddCategoryProductModel model)
+ {
+ var gridModel = new DataSourceResult();
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var products = await _categoryViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ gridModel.Data = products.products.ToList();
+ gridModel.Total = products.totalCount;
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAddPopup(CategoryModel.AddCategoryProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _categoryViewModelService.InsertCategoryProductModel(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+ return View(model);
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/CollectionController.cs b/src/Web/Grand.Web.Store/Controllers/CollectionController.cs
new file mode 100644
index 000000000..e172bdb1f
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/CollectionController.cs
@@ -0,0 +1,376 @@
+using Grand.Business.Core.Extensions;
+using Grand.Business.Core.Interfaces.Catalog.Collections;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Catalog;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Common;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Collections)]
+public class CollectionController : BaseStoreController
+{
+ #region Constructors
+
+ public CollectionController(
+ ICollectionViewModelService collectionViewModelService,
+ ICollectionService collectionService,
+ IContextAccessor contextAccessor,
+ ILanguageService languageService,
+ ITranslationService translationService,
+ IGroupService groupService,
+ IPictureViewModelService pictureViewModelService)
+ {
+ _collectionViewModelService = collectionViewModelService;
+ _collectionService = collectionService;
+ _contextAccessor = contextAccessor;
+ _languageService = languageService;
+ _translationService = translationService;
+ _groupService = groupService;
+ _pictureViewModelService = pictureViewModelService;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly ICollectionViewModelService _collectionViewModelService;
+ private readonly ICollectionService _collectionService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly ILanguageService _languageService;
+ private readonly ITranslationService _translationService;
+ private readonly IGroupService _groupService;
+ private readonly IPictureViewModelService _pictureViewModelService;
+
+ #endregion
+
+ #region List
+
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public IActionResult List()
+ {
+ var model = new CollectionListModel();
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> List(DataSourceRequest command, CollectionListModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var collections = await _collectionService.GetAllCollections(model.SearchCollectionName,
+ model.SearchStoreId, command.Page - 1, command.PageSize, true);
+ var gridModel = new DataSourceResult {
+ Data = collections.Select(x => x.ToModel()),
+ Total = collections.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Create / Edit / Delete
+
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ public async Task<IActionResult> Create([FromServices] CatalogSettings catalogSettings)
+ {
+ var model = new CollectionModel();
+ //locales
+ await AddLocales(_languageService, model.Locales);
+ //layouts
+ await _collectionViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _collectionViewModelService.PrepareDiscountModel(model, null, true);
+ //default values
+ model.PageSize = catalogSettings.DefaultPageSize;
+ model.PageSizeOptions = catalogSettings.DefaultPageSizeOptions;
+ model.Published = true;
+ model.AllowCustomersToSelectPageSize = true;
+ //sort options
+ _collectionViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Create(CollectionModel model, bool continueEditing)
+ {
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ var collection = await _collectionViewModelService.InsertCollectionModel(model);
+ Success(_translationService.GetResource("Admin.Catalog.Collections.Added"));
+ return continueEditing ? RedirectToAction("Edit", new { id = collection.Id }) : RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ //layouts
+ await _collectionViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _collectionViewModelService.PrepareDiscountModel(model, null, true);
+ //sort options
+ _collectionViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var collection = await _collectionService.GetCollectionById(id);
+ if (collection == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
+ {
+ if (!collection.LimitedToStores || (collection.LimitedToStores &&
+ collection.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
+ collection.Stores.Count > 1))
+ {
+ Warning(_translationService.GetResource("Admin.Catalog.Collections.Permissions"));
+ }
+ else
+ {
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("List");
+ }
+ }
+
+ var model = collection.ToModel();
+ //locales
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.Name = collection.GetTranslation(x => x.Name, languageId, false);
+ locale.Description = collection.GetTranslation(x => x.Description, languageId, false);
+ locale.BottomDescription = collection.GetTranslation(x => x.BottomDescription, languageId, false);
+ locale.MetaKeywords = collection.GetTranslation(x => x.MetaKeywords, languageId, false);
+ locale.MetaDescription = collection.GetTranslation(x => x.MetaDescription, languageId, false);
+ locale.MetaTitle = collection.GetTranslation(x => x.MetaTitle, languageId, false);
+ locale.SeName = collection.GetSeName(languageId, false);
+ });
+ //layouts
+ await _collectionViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _collectionViewModelService.PrepareDiscountModel(model, collection, false);
+ //sort options
+ _collectionViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Edit(CollectionModel model, bool continueEditing)
+ {
+ var collection = await _collectionService.GetCollectionById(model.Id);
+ if (collection == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = collection.Id });
+
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ collection = await _collectionViewModelService.UpdateCollectionModel(collection, model);
+ Success(_translationService.GetResource("Admin.Catalog.Collections.Updated"));
+
+ if (continueEditing)
+ {
+ //selected tab
+ await SaveSelectedTabIndex();
+ return RedirectToAction("Edit", new { id = collection.Id });
+ }
+ return RedirectToAction("List");
+ }
+ //If we got this far, something failed, redisplay form
+ //layouts
+ await _collectionViewModelService.PrepareLayoutsModel(model);
+ //discounts
+ await _collectionViewModelService.PrepareDiscountModel(model, collection, true);
+ //sort options
+ _collectionViewModelService.PrepareSortOptionsModel(model);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var collection = await _collectionService.GetCollectionById(id);
+ if (collection == null)
+ //No collection found with the specified id
+ return RedirectToAction("List");
+
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = collection.Id });
+
+ if (ModelState.IsValid)
+ {
+ await _collectionViewModelService.DeleteCollection(collection);
+
+ Success(_translationService.GetResource("Admin.Catalog.Collections.Deleted"));
+ return RedirectToAction("List");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", new { id = collection.Id });
+ }
+
+ #endregion
+
+ #region Picture
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> PicturePopup(string collectionId)
+ {
+ var collection = await _collectionService.GetCollectionById(collectionId);
+ if (collection == null)
+ return Content("Collection not exist");
+
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your collection");
+
+ if (string.IsNullOrEmpty(collection.PictureId))
+ return Content("Picture not exist");
+
+ return View("Partials/PicturePopup",
+ await _pictureViewModelService.PreparePictureModel(collection.PictureId, collection.Id));
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> PicturePopup(PictureModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var collection = await _collectionService.GetCollectionById(model.ObjectId);
+ if (collection == null)
+ throw new ArgumentException("No collection found with the specified id");
+
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content("This is not your collection");
+
+ if (string.IsNullOrEmpty(collection.PictureId))
+ throw new ArgumentException("No picture found with the specified id");
+
+ if (collection.PictureId != model.Id)
+ throw new ArgumentException("Picture ident doesn't fit with collection");
+
+ await _pictureViewModelService.UpdatePicture(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+
+ return View("Partials/PicturePopup", model);
+ }
+
+ #endregion
+
+ #region Products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductList(DataSourceRequest command, string collectionId)
+ {
+ var collection = await _collectionService.GetCollectionById(collectionId);
+ if (!collection.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson("This is not your collection");
+
+ var (collectionProductModels, totalCount) = await _collectionViewModelService.PrepareCollectionProductModel(collectionId, _contextAccessor.StoreContext.CurrentStore.Id, command.Page, command.PageSize);
+
+ var gridModel = new DataSourceResult {
+ Data = collectionProductModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductUpdate(CollectionModel.CollectionProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _collectionViewModelService.ProductUpdate(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductDelete(CollectionModel.CollectionProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _collectionViewModelService.ProductDelete(model.Id, model.ProductId);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAddPopup(string collectionId)
+ {
+ var model = await _collectionViewModelService.PrepareAddCollectionProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.CollectionId = collectionId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAddPopupList(DataSourceRequest command,
+ CollectionModel.AddCollectionProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var products = await _collectionViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.products.ToList(),
+ Total = products.totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAddPopup(CollectionModel.AddCollectionProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _collectionViewModelService.InsertCollectionProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ return View(model);
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/HomeController.cs b/src/Web/Grand.Web.Store/Controllers/HomeController.cs
new file mode 100644
index 000000000..800de6b64
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/HomeController.cs
@@ -0,0 +1,78 @@
+using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Customers;
+using Grand.Infrastructure;
+using Grand.Web.Store.Extensions;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+public class HomeController : BaseStoreController
+{
+ #region Ctor
+
+ public HomeController(
+ IContextAccessor contextAccessor,
+ ILogger<HomeController> logger,
+ IGrandAuthenticationService authenticationService)
+ {
+ _contextAccessor = contextAccessor;
+ _logger = logger;
+ _authenticationService = authenticationService;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IContextAccessor _contextAccessor;
+ private readonly ILogger<HomeController> _logger;
+ private readonly IGrandAuthenticationService _authenticationService;
+
+ #endregion
+
+ #region Methods
+
+ public IActionResult Index()
+ {
+ return View();
+ }
+ public IActionResult Statistics()
+ {
+ return View();
+ }
+
+ public async Task<IActionResult> SetLanguage(string langid,
+ [FromServices] ILanguageService languageService,
+ [FromServices] ICustomerService _customerService,
+ string returnUrl = "")
+ {
+ var language = await languageService.GetLanguageById(langid);
+ if (language != null)
+ await _customerService.UpdateUserField(_contextAccessor.WorkContext.CurrentCustomer, SystemCustomerFieldNames.LanguageId,
+ language.Id, _contextAccessor.StoreContext.CurrentStore.Id);
+
+ //home page
+ if (string.IsNullOrEmpty(returnUrl))
+ returnUrl = Url.Action("Index", "Home", new { area = Constants.AreaStore });
+ //prevent open redirection attack
+ if (!Url.IsLocalUrl(returnUrl))
+ return RedirectToAction("Index", "Home", new { area = Constants.AreaStore });
+ return Redirect(returnUrl);
+ }
+
+ public IActionResult AccessDenied()
+ {
+ _logger.LogInformation("Access denied");
+ return View();
+ }
+
+ public async Task<IActionResult> Logout()
+ {
+ await _authenticationService.SignOut();
+ return RedirectToRoute("StoreLogin");
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/LoginController.cs b/src/Web/Grand.Web.Store/Controllers/LoginController.cs
new file mode 100644
index 000000000..89d24b4d6
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/LoginController.cs
@@ -0,0 +1,21 @@
+using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Customers;
+using Grand.Business.Core.Interfaces.Messages;
+using Grand.Domain.Common;
+using Grand.Domain.Customers;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Controllers;
+using Grand.Web.Store.Extensions;
+using MediatR;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[Area(Constants.AreaStore)]
+public class LoginController : BaseLoginController
+{
+ public LoginController(CustomerSettings customerSettings, CaptchaSettings captchaSettings, ITranslationService translationService, ICustomerManagerService customerManagerService, ICustomerService customerService, IGrandAuthenticationService authenticationService, IMessageProviderService messageProviderService, IContextAccessor contextAccessor, IMediator mediator) : base(customerSettings, captchaSettings, translationService, customerManagerService, customerService, authenticationService, messageProviderService, contextAccessor, mediator)
+ {
+ }
+}
diff --git a/src/Web/Grand.Web.Store/Controllers/MerchandiseReturnController.cs b/src/Web/Grand.Web.Store/Controllers/MerchandiseReturnController.cs
new file mode 100644
index 000000000..4f28f0b5c
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/MerchandiseReturnController.cs
@@ -0,0 +1,256 @@
+using Grand.Business.Core.Interfaces.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Common.Addresses;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
+using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.MerchandiseReturns)]
+public class MerchandiseReturnController : BaseStoreController
+{
+ #region Constructors
+
+ public MerchandiseReturnController(
+ IMerchandiseReturnViewModelService merchandiseReturnViewModelService,
+ ITranslationService translationService,
+ IMerchandiseReturnService merchandiseReturnService,
+ IOrderService orderService,
+ IContextAccessor contextAccessor)
+ {
+ _merchandiseReturnViewModelService = merchandiseReturnViewModelService;
+ _translationService = translationService;
+ _merchandiseReturnService = merchandiseReturnService;
+ _orderService = orderService;
+ _contextAccessor = contextAccessor;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IMerchandiseReturnViewModelService _merchandiseReturnViewModelService;
+ private readonly ITranslationService _translationService;
+ private readonly IMerchandiseReturnService _merchandiseReturnService;
+ private readonly IOrderService _orderService;
+ private readonly IContextAccessor _contextAccessor;
+
+ #endregion Fields
+
+ #region Methods
+
+ //list
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public IActionResult List()
+ {
+ var model = _merchandiseReturnViewModelService.PrepareReturnReqestListModel();
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> List(DataSourceRequest command, MerchandiseReturnListModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var merchandiseReturnModels = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, command.Page, command.PageSize);
+
+ var gridModel = new DataSourceResult {
+ Data = merchandiseReturnModels.merchandiseReturnModels,
+ Total = merchandiseReturnModels.totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> GoToId(MerchandiseReturnListModel model)
+ {
+ if (model.GoDirectlyToId == null)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ int.TryParse(model.GoDirectlyToId, out var id);
+
+ //try to load a product entity
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(id);
+ if (merchandiseReturn == null)
+ //not found
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ return RedirectToAction("Edit", "MerchandiseReturn", new { id = merchandiseReturn.Id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductsForMerchandiseReturn(string merchandiseReturnId, DataSourceRequest command)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(merchandiseReturnId);
+ if (merchandiseReturn == null)
+ return ErrorForKendoGridJson("Merchandise return not found");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return ErrorForKendoGridJson("Merchandise return is not your");
+
+ var items = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnItemModel(merchandiseReturnId);
+ var gridModel = new DataSourceResult {
+ Data = items,
+ Total = items.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ //edit
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(id);
+ if (merchandiseReturn == null)
+ //No merchandise return found with the specified id
+ return RedirectToAction("List");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ var model = new MerchandiseReturnModel();
+ await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, merchandiseReturn, false);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Edit(MerchandiseReturnModel model, bool continueEditing,
+ [FromServices] IAddressAttributeService addressAttributeService,
+ [FromServices] IAddressAttributeParser addressAttributeParser,
+ [FromServices] OrderSettings orderSettings
+ )
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(model.Id);
+ if (merchandiseReturn == null)
+ //No merchandise return found with the specified id
+ return RedirectToAction("List");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ if (ModelState.IsValid)
+ {
+ var customAddressAttributes = new List<CustomAttribute>();
+ if (orderSettings.MerchandiseReturns_AllowToSpecifyPickupAddress)
+ customAddressAttributes = await model.PickupAddress.ParseCustomAddressAttributes(addressAttributeParser, addressAttributeService);
+
+ merchandiseReturn = await _merchandiseReturnViewModelService.UpdateMerchandiseReturnModel(merchandiseReturn, model, customAddressAttributes);
+
+ Success(_translationService.GetResource("Admin.Orders.MerchandiseReturns.Updated"));
+ return continueEditing
+ ? RedirectToAction("Edit", new { id = merchandiseReturn.Id })
+ : RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ await _merchandiseReturnViewModelService.PrepareMerchandiseReturnModel(model, merchandiseReturn, false);
+ return View(model);
+ }
+
+ //delete
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(id);
+ if (merchandiseReturn == null)
+ //No merchandise return found with the specified id
+ return RedirectToAction("List");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ if (ModelState.IsValid)
+ {
+ await _merchandiseReturnViewModelService.DeleteMerchandiseReturn(merchandiseReturn);
+ Success(_translationService.GetResource("Admin.Orders.MerchandiseReturns.Deleted"));
+ return RedirectToAction("List");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", new { id = merchandiseReturn.Id });
+ }
+
+ #endregion
+
+ #region Merchandise return notes
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> MerchandiseReturnNotesSelect(string merchandiseReturnId, DataSourceRequest command)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(merchandiseReturnId);
+ if (merchandiseReturn == null)
+ throw new ArgumentException("No merchandise return found with the specified id");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Content("");
+
+ //merchandise return notes
+ var merchandiseReturnNoteModels = await _merchandiseReturnViewModelService.PrepareMerchandiseReturnNotes(merchandiseReturn);
+ var gridModel = new DataSourceResult {
+ Data = merchandiseReturnNoteModels,
+ Total = merchandiseReturnNoteModels.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> MerchandiseReturnNoteAdd(string merchandiseReturnId, string orderId,
+ string downloadId, bool displayToCustomer, string message)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(merchandiseReturnId);
+ if (merchandiseReturn == null)
+ return Json(new { Result = false });
+
+ var order = await _orderService.GetOrderById(orderId);
+ if (order == null)
+ return Json(new { Result = false });
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
+
+ await _merchandiseReturnViewModelService.InsertMerchandiseReturnNote(merchandiseReturn, order, downloadId,
+ displayToCustomer, message);
+
+ return Json(new { Result = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> MerchandiseReturnNoteDelete(string id, string merchandiseReturnId)
+ {
+ var merchandiseReturn = await _merchandiseReturnService.GetMerchandiseReturnById(merchandiseReturnId);
+ if (merchandiseReturn == null)
+ throw new ArgumentException("No merchandise return found with the specified id");
+
+ if (merchandiseReturn.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
+
+ await _merchandiseReturnViewModelService.DeleteMerchandiseReturnNote(merchandiseReturn, id);
+
+ return new JsonResult("");
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/OrderController.cs b/src/Web/Grand.Web.Store/Controllers/OrderController.cs
new file mode 100644
index 000000000..b12da8a1e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/OrderController.cs
@@ -0,0 +1,861 @@
+using Grand.Business.Core.Commands.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Catalog.Products;
+using Grand.Business.Core.Interfaces.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Common.Addresses;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Common.Pdf;
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Security.Authorization;
+using MediatR;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Orders)]
+public class OrderController(
+ IOrderViewModelService orderViewModelService,
+ IOrderService orderService,
+ IOrderStatusService orderStatusService,
+ ITranslationService translationService,
+ IContextAccessor contextAccessor,
+ IPdfService pdfService,
+ IMediator mediator) : BaseStoreController
+{
+
+ #region Order list
+
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public async Task<IActionResult> List(int? orderStatusId = null,
+ int? paymentStatusId = null, int? shippingStatusId = null, DateTime? startDate = null, string code = null)
+ {
+ var model = await orderViewModelService.PrepareOrderListModel(orderStatusId, paymentStatusId, shippingStatusId,
+ startDate, contextAccessor.WorkContext.CurrentCustomer.StaffStoreId, code);
+ return View(model);
+ }
+
+ public async Task<IActionResult> ProductSearchAutoComplete(string term,
+ [FromServices] IProductService productService)
+ {
+ const int searchTermMinimumLength = 3;
+ if (string.IsNullOrWhiteSpace(term) || term.Length < searchTermMinimumLength)
+ return Content("");
+
+ //products
+ const int productNumber = 15;
+ var products = (await productService.SearchProducts(
+ storeId: contextAccessor.WorkContext.CurrentCustomer.StaffStoreId,
+ keywords: term,
+ pageSize: productNumber,
+ showHidden: true)).products;
+
+ var result = (from p in products
+ select new
+ {
+ label = p.Name,
+ productid = p.Id
+ })
+ .ToList();
+ return Json(result);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> OrderList(DataSourceRequest command, OrderListModel model)
+ {
+ model.StoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var (orderModels, totalCount) =
+ await orderViewModelService.PrepareOrderModel(model, command.Page, command.PageSize);
+
+ var gridModel = new DataSourceResult {
+ Data = orderModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> GoToOrderId(OrderListModel model)
+ {
+ Order order = null;
+ int.TryParse(model.GoDirectlyToNumber, out var orderNumber);
+ if (orderNumber > 0) order = await orderService.GetOrderByNumber(orderNumber);
+ var orders = await orderService.GetOrdersByCode(model.GoDirectlyToNumber);
+ switch (orders.Count)
+ {
+ case > 1:
+ return RedirectToAction("List", new { Code = model.GoDirectlyToNumber });
+ case 1:
+ order = orders.FirstOrDefault();
+ break;
+ case 0:
+ return RedirectToAction("List", new { Code = model.GoDirectlyToNumber });
+ }
+
+ if (order!.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ return RedirectToAction("Edit", "Order", new { id = order.Id });
+ }
+
+ #endregion
+
+ #region Order details
+
+ #region Payments and other order workflow
+
+ [PermissionAuthorizeAction(PermissionActionName.Cancel)]
+ [HttpGet]
+ public async Task<IActionResult> CancelOrder(string id)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ try
+ {
+ await mediator.Send(new CancelOrderCommand { Order = order, NotifyCustomer = true });
+
+ Success("Successfully canceled order");
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc);
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SaveOrderTags(OrderModel orderModel)
+ {
+ var order = await orderService.GetOrderById(orderModel.Id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ try
+ {
+ await orderViewModelService.SaveOrderTags(order, orderModel.OrderTags);
+
+ var model = new OrderModel();
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+ return RedirectToAction("Edit", "Order", new { id = order.Id });
+ }
+ catch (Exception exception)
+ {
+ //error
+ Error(exception, false);
+ return RedirectToAction("Edit", "Order", new { id = order.Id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ChangeOrderStatus(string id, OrderModel model)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ try
+ {
+ var status = await orderStatusService.GetByStatusId(model.OrderStatusId);
+ ArgumentNullException.ThrowIfNull(status);
+
+ order.OrderStatusId = model.OrderStatusId;
+ await orderService.UpdateOrder(order);
+
+ //add a note
+ await orderService.InsertOrderNote(new OrderNote {
+ Note = $"Order status has been edited. New status: {status.Name}",
+ DisplayToCustomer = false,
+ OrderId = order.Id
+ });
+ model = new OrderModel();
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+ }
+
+ #endregion
+
+ #region Edit, delete
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null || order.Deleted)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var model = new OrderModel();
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(OrderDeleteModel model)
+ {
+ var order = await orderService.GetOrderById(model.Id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ if (ModelState.IsValid)
+ {
+ await mediator.Send(new DeleteOrderCommand { Order = order });
+
+ return RedirectToAction("List");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", "Order", new { model.Id });
+ }
+
+ public async Task<IActionResult> PdfInvoice(string orderId)
+ {
+ var order = await orderService.GetOrderById(orderId);
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var orders = new List<Order> {
+ order
+ };
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await pdfService.PrintOrdersToPdf(stream, orders, contextAccessor.WorkContext.WorkingLanguage.Id);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", $"order_{order.Id}.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Export)]
+ [HttpPost]
+ public async Task<IActionResult> PdfInvoiceAll(OrderListModel model)
+ {
+ //load orders
+ var orders = await orderViewModelService.PrepareOrders(model);
+ orders = orders.Where(x => x.StoreId == contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
+
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await pdfService.PrintOrdersToPdf(stream, orders, contextAccessor.WorkContext.WorkingLanguage.Id, model.VendorId);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", "orders.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Export)]
+ [HttpPost]
+ public async Task<IActionResult> PdfInvoiceSelected(string selectedIds)
+ {
+ var orders = new List<Order>();
+ if (selectedIds != null)
+ {
+ var ids = selectedIds
+ .Split([','], StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => x)
+ .ToArray();
+ orders.AddRange(await orderService.GetOrdersByIds(ids));
+ }
+
+ orders = orders.Where(x => x.StoreId == contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
+
+ //ensure that we at least one order selected
+ if (orders.Count == 0)
+ {
+ Error(translationService.GetResource("Admin.Orders.PdfInvoice.NoOrders"));
+ return RedirectToAction("List");
+ }
+
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await pdfService.PrintOrdersToPdf(stream, orders, contextAccessor.WorkContext.WorkingLanguage.Id);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", "orders.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> EditOrderTotals(string id, OrderModel model)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ order.OrderSubtotalInclTax = model.OrderSubtotalInclTaxValue;
+ order.OrderSubtotalExclTax = model.OrderSubtotalExclTaxValue;
+ order.OrderSubTotalDiscountInclTax = model.OrderSubTotalDiscountInclTaxValue;
+ order.OrderSubTotalDiscountExclTax = model.OrderSubTotalDiscountExclTaxValue;
+ order.OrderShippingInclTax = model.OrderShippingInclTaxValue;
+ order.OrderShippingExclTax = model.OrderShippingExclTaxValue;
+ order.PaymentMethodAdditionalFeeInclTax = model.PaymentMethodAdditionalFeeInclTaxValue;
+ order.PaymentMethodAdditionalFeeExclTax = model.PaymentMethodAdditionalFeeExclTaxValue;
+ order.OrderTax = model.TaxValue;
+ order.OrderDiscount = model.OrderTotalDiscountValue;
+ order.OrderTotal = model.OrderTotalValue;
+ order.CurrencyRate = model.CurrencyRate;
+ await orderService.UpdateOrder(order);
+
+ //add a note
+ await orderService.InsertOrderNote(new OrderNote {
+ Note = "Order totals have been edited",
+ DisplayToCustomer = false,
+ OrderId = order.Id
+ });
+
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> EditShippingMethod(string id, OrderModel model)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ order.ShippingMethod = model.ShippingMethod;
+ await orderService.UpdateOrder(order);
+
+ //add a note
+ await orderService.InsertOrderNote(new OrderNote {
+ Note = "Shipping method has been edited",
+ DisplayToCustomer = false,
+ OrderId = order.Id
+ });
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> EditUserFields(string id, OrderModel model)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ order.UserFields = model.UserFields;
+
+ await orderService.UpdateOrder(order);
+
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SaveOrderItem(string id, OrderItemsModel model)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ if (order.OrderStatusId == (int)OrderStatusSystem.Cancelled)
+ {
+ Error("You can't edit position when order is canceled");
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ var itemModel = model.Items.FirstOrDefault(x => x.Id == model.OrderItemId) ?? throw new ArgumentException("No order item model found with the specified id");
+
+ if (itemModel.Quantity == 0 || (orderItem.OpenQty != orderItem.Quantity && orderItem.IsShipEnabled))
+ {
+ Error("You can't change quantity");
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ if (orderItem.Quantity == itemModel.Quantity && orderItem.UnitPriceExclTax == itemModel.UnitPriceExclTaxValue)
+ {
+ Error("Nothing has been changed");
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ orderItem.Quantity = itemModel.Quantity;
+ orderItem.OpenQty = itemModel.Quantity;
+
+ if (orderItem.UnitPriceExclTax != itemModel.UnitPriceExclTaxValue)
+ {
+ orderItem.UnitPriceExclTax = itemModel.UnitPriceExclTaxValue;
+ orderItem.UnitPriceInclTax =
+ Math.Round(orderItem.UnitPriceExclTax * orderItem.TaxRate / 100 + orderItem.UnitPriceExclTax, 2);
+ orderItem.PriceInclTax = Math.Round(orderItem.UnitPriceInclTax * orderItem.Quantity, 2);
+ orderItem.PriceExclTax = Math.Round(orderItem.UnitPriceExclTax * orderItem.Quantity, 2);
+
+ orderItem.DiscountAmountInclTax = 0;
+ orderItem.DiscountAmountExclTax = 0;
+ }
+ else
+ {
+ orderItem.PriceInclTax = Math.Round(orderItem.UnitPriceInclTax * orderItem.Quantity, 2);
+ orderItem.PriceExclTax = Math.Round(orderItem.UnitPriceExclTax * orderItem.Quantity, 2);
+
+ orderItem.DiscountAmountInclTax = 0;
+ orderItem.DiscountAmountExclTax = 0;
+ }
+
+ await mediator.Send(new UpdateOrderItemCommand { Order = order, OrderItem = orderItem });
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> DeleteOrderItem(string id, string orderItemId)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ var result = await mediator.Send(new DeleteOrderItemCommand { Order = order, OrderItem = orderItem });
+ if (result.error)
+ Error(result.message);
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> CancelOrderItem(string id, string orderItemId)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ var result = await mediator.Send(new CancelOrderItemCommand { Order = order, OrderItem = orderItem });
+ if (result.error)
+ Error(result.message);
+ else
+ Success("The order item was successfully canceled");
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ResetDownloadCount(string id, string orderItemId)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ orderItem.DownloadCount = 0;
+ await orderService.UpdateOrder(order);
+ var model = new OrderModel();
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ActivateDownloadItem(string id, string orderItemId)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ orderItem.IsDownloadActivated = !orderItem.IsDownloadActivated;
+ await orderService.UpdateOrder(order);
+ var model = new OrderModel();
+ await orderViewModelService.PrepareOrderDetailsModel(model, order);
+
+ //selected tab
+ await SaveSelectedTabIndex(persistForTheNextRequest: true);
+
+ return RedirectToAction("Edit", "Order", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> UploadLicenseFilePopup(string id, string orderItemId,
+ [FromServices] IProductService productService)
+ {
+ var order = await orderService.GetOrderById(id);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == orderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+ var product = await productService.GetProductByIdIncludeArch(orderItem.ProductId);
+
+ if (!product.IsDownload)
+ throw new ArgumentException("Product is not downloadable");
+ var model = new OrderModel.UploadLicenseModel {
+ LicenseDownloadId = !string.IsNullOrEmpty(orderItem.LicenseDownloadId) ? orderItem.LicenseDownloadId : "",
+ OrderId = order.Id,
+ OrderItemId = orderItem.Id
+ };
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> UploadLicenseFilePopup(OrderModel.UploadLicenseModel model)
+ {
+ var order = await orderService.GetOrderById(model.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId) ?? throw new ArgumentException("No order item found with the specified id");
+
+ //attach license
+ orderItem.LicenseDownloadId = !string.IsNullOrEmpty(model.LicenseDownloadId) ? model.LicenseDownloadId : null;
+ await orderService.UpdateOrder(order);
+
+ //success
+ ViewBag.RefreshPage = true;
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> DeleteLicenseFilePopup(OrderModel.UploadLicenseModel model)
+ {
+ var order = await orderService.GetOrderById(model.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItem = order.OrderItems.FirstOrDefault(x => x.Id == model.OrderItemId);
+ if (orderItem == null)
+ throw new ArgumentException("No order item found with the specified id");
+
+ //attach license
+ orderItem.LicenseDownloadId = null;
+ await orderService.UpdateOrder(order);
+
+ //success
+ ViewBag.RefreshPage = true;
+
+ return RedirectToAction("Edit", "Order", new { id = model.OrderId });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> AddProductToOrder(string orderId)
+ {
+ var order = await orderService.GetOrderById(orderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var model = await orderViewModelService.PrepareAddOrderProductModel(order);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AddProductToOrder(DataSourceRequest command, OrderModel.AddOrderProductModel model,
+ [FromServices] IProductService productService)
+ {
+ var categoryIds = new List<string>();
+ if (!string.IsNullOrEmpty(model.SearchCategoryId))
+ categoryIds.Add(model.SearchCategoryId);
+
+ var gridModel = new DataSourceResult();
+ var products = (await productService.SearchProducts(categoryIds: categoryIds,
+ storeId: contextAccessor.WorkContext.CurrentCustomer.StaffStoreId,
+ brandId: model.SearchBrandId,
+ collectionId: model.SearchCollectionId,
+ productType: model.SearchProductTypeId > 0 ? (ProductType?)model.SearchProductTypeId : null,
+ keywords: model.SearchProductName,
+ pageIndex: command.Page - 1,
+ pageSize: command.PageSize,
+ showHidden: true)).products;
+ gridModel.Data = products.Select(x =>
+ {
+ var productModel = new OrderModel.AddOrderProductModel.ProductModel {
+ Id = x.Id,
+ Name = x.Name,
+ Sku = x.Sku
+ };
+
+ return productModel;
+ });
+ gridModel.Total = products.TotalCount;
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> AddProductToOrderDetails(string orderId, string productId)
+ {
+ var order = await orderService.GetOrderById(orderId);
+ if (order == null)
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var model = await orderViewModelService.PrepareAddProductToOrderModel(order, productId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AddProductToOrderDetails(AddProductToOrderModel model)
+ {
+ var order = await orderService.GetOrderById(model.OrderId);
+ if (order == null)
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var warnings = await orderViewModelService.AddProductToOrderDetails(model);
+ if (!warnings.Any())
+ //redirect to order details page
+ return RedirectToAction("Edit", "Order", new { id = model.OrderId });
+
+ //errors
+ var result = await orderViewModelService.PrepareAddProductToOrderModel(order, model.ProductId);
+ result.Warnings.AddRange(warnings);
+ return View(result);
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Addresses
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> AddressEdit(string addressId, string orderId, bool billingAddress)
+ {
+ var order = await orderService.GetOrderById(orderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var address = new Address();
+ switch (billingAddress)
+ {
+ case true when order.BillingAddress != null:
+ {
+ if (order.BillingAddress.Id == addressId)
+ address = order.BillingAddress;
+ break;
+ }
+ case false when order.ShippingAddress != null:
+ {
+ if (order.ShippingAddress.Id == addressId)
+ address = order.ShippingAddress;
+ break;
+ }
+ }
+
+ if (address == null)
+ throw new ArgumentException("No address found with the specified id", nameof(addressId));
+
+ var model = await orderViewModelService.PrepareOrderAddressModel(order, address);
+ model.BillingAddress = billingAddress;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AddressEdit(OrderAddressModel model,
+ [FromServices] IAddressAttributeService addressAttributeService,
+ [FromServices] IAddressAttributeParser addressAttributeParser)
+ {
+ var order = await orderService.GetOrderById(model.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return RedirectToAction("List");
+
+ var address = new Address();
+ switch (model.BillingAddress)
+ {
+ case true when order.BillingAddress != null:
+ {
+ if (order.BillingAddress.Id == model.Address.Id)
+ address = order.BillingAddress;
+ break;
+ }
+ case false when order.ShippingAddress != null:
+ {
+ if (order.ShippingAddress.Id == model.Address.Id)
+ address = order.ShippingAddress;
+ break;
+ }
+ }
+
+ if (ModelState.IsValid)
+ {
+ var customAttributes = await model.Address.ParseCustomAddressAttributes(addressAttributeParser, addressAttributeService);
+ await orderViewModelService.UpdateOrderAddress(order, address, model, customAttributes);
+ return RedirectToAction("AddressEdit",
+ new { addressId = model.Address.Id, orderId = model.OrderId, model.BillingAddress });
+ }
+
+ //If we got this far, something failed, redisplay form
+ model = await orderViewModelService.PrepareOrderAddressModel(order, address);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Order notes
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> OrderNotesSelect(string orderId, DataSourceRequest command)
+ {
+ var order = await orderService.GetOrderById(orderId) ?? throw new ArgumentException("No order found with the specified id");
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Content("");
+
+ //order notes
+ var orderNoteModels = await orderViewModelService.PrepareOrderNotes(order);
+ var gridModel = new DataSourceResult {
+ Data = orderNoteModels,
+ Total = orderNoteModels.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> OrderNoteAdd(string orderId, string downloadId, bool displayToCustomer,
+ string message)
+ {
+ var order = await orderService.GetOrderById(orderId);
+ if (order == null)
+ return Json(new { Result = false });
+
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
+
+ await orderViewModelService.InsertOrderNote(order, downloadId, displayToCustomer, message);
+
+ return Json(new { Result = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> OrderNoteDelete(string id, string orderId)
+ {
+ var order = await orderService.GetOrderById(orderId) ?? throw new ArgumentException("No order found with the specified id");
+ if (order.StoreId != contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) return Json(new { Result = false });
+
+ await orderViewModelService.DeleteOrderNote(order, id);
+
+ return new JsonResult("");
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/PaymentTransactionController.cs b/src/Web/Grand.Web.Store/Controllers/PaymentTransactionController.cs
new file mode 100644
index 000000000..93db21582
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/PaymentTransactionController.cs
@@ -0,0 +1,525 @@
+using Grand.Business.Core.Commands.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Checkout.Payments;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Queries.Checkout.Orders;
+using Grand.Domain.Permissions;
+using Grand.Domain.Payments;
+using Grand.Infrastructure;
+using Grand.SharedKernel;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Localization;
+using Grand.Web.Common.Security.Authorization;
+using MediatR;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Rendering;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.PaymentTransactions)]
+public class PaymentTransactionController : BaseStoreController
+{
+ #region Constructors
+
+ public PaymentTransactionController(
+ ITranslationService translationService,
+ IPaymentTransactionService paymentTransactionService,
+ IOrderService orderService,
+ IContextAccessor contextAccessor,
+ IDateTimeService dateTimeService,
+ IMediator mediator,
+ IEnumTranslationService enumTranslationService)
+ {
+ _translationService = translationService;
+ _paymentTransactionService = paymentTransactionService;
+ _orderService = orderService;
+ _contextAccessor = contextAccessor;
+ _dateTimeService = dateTimeService;
+ _mediator = mediator;
+ _enumTranslationService = enumTranslationService;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IPaymentTransactionService _paymentTransactionService;
+ private readonly IOrderService _orderService;
+ private readonly ITranslationService _translationService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly IDateTimeService _dateTimeService;
+ private readonly IMediator _mediator;
+ private readonly IEnumTranslationService _enumTranslationService;
+
+ #endregion Fields
+
+ #region Methods
+
+ //list
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public IActionResult List()
+ {
+ var model = new PaymentTransactionListModel {
+ PaymentTransactionStatus = _enumTranslationService.ToSelectList(TransactionStatus.Pending, false)
+ .ToList()
+ };
+ model.PaymentTransactionStatus.Insert(0,
+ new SelectListItem
+ { Text = _translationService.GetResource("Admin.Common.All"), Value = "-1", Selected = true });
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> List(DataSourceRequest command, PaymentTransactionListModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ DateTime? startDateValue = model.StartDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
+
+ DateTime? endDateValue = model.EndDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.EndDate.Value, _dateTimeService.CurrentTimeZone);
+
+ Guid? orderGuid = null;
+ if (!string.IsNullOrEmpty(model.OrderNumber))
+ if (int.TryParse(model.OrderNumber, out var ordernumber))
+ {
+ var order = await _orderService.GetOrderByNumber(ordernumber);
+ if (order != null)
+ orderGuid = order.OrderGuid;
+ }
+
+ var paymentTransactions = await _paymentTransactionService.SearchPaymentTransactions(
+ customerEmail: model.SearchCustomerEmail,
+ ts: model.SearchTransactionStatus >= 0 ? (TransactionStatus)model.SearchTransactionStatus : null,
+ createdFromUtc: startDateValue,
+ createdToUtc: endDateValue,
+ storeId: model.StoreId,
+ orderGuid: orderGuid,
+ pageIndex: command.Page - 1,
+ pageSize: command.PageSize);
+
+ var dataModel = new List<PaymentTransactionModel>();
+
+ foreach (var item in paymentTransactions)
+ {
+ var order = await _orderService.GetOrderByGuid(item.OrderGuid);
+ var trmodel = new PaymentTransactionModel {
+ Id = item.Id,
+ OrderCode = item.OrderCode,
+ CustomerEmail = item.CustomerEmail,
+ CustomerId = item.CustomerId,
+ CurrencyCode = item.CurrencyCode,
+ TransactionAmount = item.TransactionAmount,
+ PaidAmount = item.PaidAmount,
+ PaymentMethodSystemName = item.PaymentMethodSystemName,
+ RefundedAmount = item.RefundedAmount,
+ OrderId = order?.Id,
+ OrderNumber = order?.OrderNumber,
+ CreatedOn = _dateTimeService.ConvertToUserTime(item.CreatedOnUtc, DateTimeKind.Utc),
+ TransactionStatus = item.TransactionStatus,
+ Status = _enumTranslationService.GetTranslationEnum(item.TransactionStatus)
+ };
+ dataModel.Add(trmodel);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = dataModel.ToList(),
+ Total = paymentTransactions.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> GoToOrderNumber(PaymentTransactionListModel model)
+ {
+ if (model.OrderNumber == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ int.TryParse(model.OrderNumber, out var id);
+
+ var order = await _orderService.GetOrderByNumber(id);
+ if (order == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ var paymentTransaction = await _paymentTransactionService.GetOrderByGuid(order.OrderGuid);
+ if (paymentTransaction == null)
+ //not found
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ return RedirectToAction("Edit", "PaymentTransaction", new { id = paymentTransaction.Id });
+ }
+
+
+ //edit
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ var order = await _orderService.GetOrderByGuid(paymentTransaction.OrderGuid);
+
+ var model = new PaymentTransactionModel {
+ Id = paymentTransaction.Id,
+ OrderCode = paymentTransaction.OrderCode,
+ CustomerEmail = string.IsNullOrEmpty(paymentTransaction.CustomerEmail)
+ ? "(null)"
+ : paymentTransaction.CustomerEmail,
+ CustomerId = paymentTransaction.CustomerId,
+ CurrencyCode = paymentTransaction.CurrencyCode,
+ TransactionAmount = paymentTransaction.TransactionAmount,
+ PaidAmount = paymentTransaction.PaidAmount,
+ PaymentMethodSystemName = paymentTransaction.PaymentMethodSystemName,
+ RefundedAmount = paymentTransaction.RefundedAmount,
+ OrderId = order?.Id,
+ OrderNumber = order?.OrderNumber,
+ CreatedOn = _dateTimeService.ConvertToUserTime(paymentTransaction.CreatedOnUtc, DateTimeKind.Utc),
+ TransactionStatus = paymentTransaction.TransactionStatus,
+ Status = _enumTranslationService.GetTranslationEnum(paymentTransaction.TransactionStatus),
+ IPAddress = paymentTransaction.IPAddress,
+ Description = paymentTransaction.Description,
+ AdditionalInfo = paymentTransaction.AdditionalInfo,
+ AuthorizationTransactionId = paymentTransaction.AuthorizationTransactionId,
+ //payment method buttons
+ //model.CanCancelOrder = await _mediator.Send(new CanCancelOrderQuery() { Order = order });
+ CanCapture = await _mediator.Send(new CanCaptureQuery { PaymentTransaction = paymentTransaction }),
+ CanMarkAsPaid = await _mediator.Send(new CanMarkPaymentTransactionAsPaidQuery
+ { PaymentTransaction = paymentTransaction }),
+ CanRefund = await _mediator.Send(new CanRefundQuery { PaymentTransaction = paymentTransaction }),
+ CanRefundOffline = await _mediator.Send(new CanRefundOfflineQuery
+ { PaymentTransaction = paymentTransaction }),
+ CanPartiallyRefund = await _mediator.Send(new CanPartiallyRefundQuery
+ { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
+ CanPartiallyRefundOffline = await _mediator.Send(new CanPartiallyRefundOfflineQuery
+ { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
+ CanPartiallyPaidOffline = await _mediator.Send(new CanPartiallyPaidOfflineQuery
+ { PaymentTransaction = paymentTransaction, AmountToPaid = 0 }),
+ CanVoid = await _mediator.Send(new CanVoidQuery { PaymentTransaction = paymentTransaction }),
+ CanVoidOffline = await _mediator.Send(new CanVoidOfflineQuery { PaymentTransaction = paymentTransaction }),
+ MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
+ MaxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount
+ };
+
+ return View(model);
+ }
+
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> CapturePaymentTransaction(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ var errors = await _mediator.Send(new CaptureCommand { PaymentTransaction = paymentTransaction });
+
+ foreach (var error in errors)
+ Error(error);
+
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> MarkPaymentTransactionAsPaid(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ await _mediator.Send(new MarkAsPaidCommand { PaymentTransaction = paymentTransaction });
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RefundPaymentTransaction(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ var errors = await _mediator.Send(new RefundCommand { PaymentTransaction = paymentTransaction });
+ foreach (var error in errors)
+ Error(error);
+
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RefundPaymentTransactionOffline(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ await _mediator.Send(new RefundOfflineCommand { PaymentTransaction = paymentTransaction });
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> VoidPaymentTransaction(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ var errors = await _mediator.Send(new VoidCommand { PaymentTransaction = paymentTransaction });
+ foreach (var error in errors)
+ Error(error);
+
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> VoidPaymentTransactionOffline(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ await _mediator.Send(new VoidOfflineCommand { PaymentTransaction = paymentTransaction });
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc, false);
+ return RedirectToAction("Edit", "PaymentTransaction", new { id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> PartiallyRefundPopup(string id, bool online)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ var model = new PaymentTransactionModel {
+ Id = paymentTransaction.Id,
+ MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
+ CurrencyCode = paymentTransaction.CurrencyCode
+ };
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> PartiallyRefundPopup(string id, bool online, PaymentTransactionModel model)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ var amountToRefund = model.AmountToRefund;
+ if (amountToRefund <= 0)
+ throw new GrandException("Enter amount to refund");
+
+ var maxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount;
+ if (amountToRefund > maxAmountToRefund)
+ amountToRefund = maxAmountToRefund;
+
+ var errors = new List<string>();
+ if (online)
+ errors = (await _mediator.Send(new PartiallyRefundCommand
+ { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund })).ToList();
+ else
+ await _mediator.Send(new PartiallyRefundOfflineCommand
+ { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund });
+
+ if (errors.Count == 0)
+ {
+ //success
+ ViewBag.RefreshPage = true;
+ return View(model);
+ }
+
+ //error
+ foreach (var error in errors)
+ Error(error);
+
+ return View(model);
+ }
+ catch (Exception exc)
+ {
+ Error(exc, false);
+ return View(model);
+ }
+ }
+
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> PartiallyPaidPopup(string id, bool online)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ var model = new PaymentTransactionModel {
+ Id = paymentTransaction.Id,
+ MaxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount,
+ CurrencyCode = paymentTransaction.CurrencyCode
+ };
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> PartiallyPaidPopup(string id, bool online, PaymentTransactionModel model)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "PaymentTransaction");
+
+ try
+ {
+ var amountToPaid = model.AmountToPaid;
+ if (amountToPaid <= 0)
+ throw new GrandException("Enter amount to refund");
+
+ var maxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount;
+ if (amountToPaid > maxAmountToPaid)
+ amountToPaid = maxAmountToPaid;
+
+ await _mediator.Send(new PartiallyPaidOfflineCommand
+ { PaymentTransaction = paymentTransaction, AmountToPaid = amountToPaid });
+
+ ViewBag.RefreshPage = true;
+ return View(model);
+ }
+ catch (Exception exc)
+ {
+ Error(exc, false);
+ return View(model);
+ }
+ }
+
+ //delete
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var paymentTransaction = await _paymentTransactionService.GetById(id);
+ if (paymentTransaction == null)
+ return RedirectToAction("List");
+
+ if (paymentTransaction.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List", "MerchandiseReturn");
+
+ if (ModelState.IsValid)
+ {
+ await _paymentTransactionService.DeletePaymentTransaction(paymentTransaction);
+ Success(_translationService.GetResource("Admin.Orders.PaymentTransaction.Deleted"));
+ return RedirectToAction("List", "PaymentTransaction");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", new { id = paymentTransaction.Id });
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/PictureController.cs b/src/Web/Grand.Web.Store/Controllers/PictureController.cs
new file mode 100644
index 000000000..8efde3af4
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/PictureController.cs
@@ -0,0 +1,157 @@
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Business.Core.Interfaces.Storage;
+using Grand.Domain.Permissions;
+using Grand.Domain.Common;
+using Grand.Domain.Media;
+using Grand.Web.Common.Extensions;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.StaticFiles;
+using Grand.SharedKernel.Extensions;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Pictures)]
+public class PictureController : BaseStoreController
+{
+ private readonly IMediaFileStore _mediaFileStore;
+
+ private readonly MediaSettings _mediaSettings;
+ private readonly IPermissionService _permissionService;
+ private readonly IPictureService _pictureService;
+
+ public PictureController(
+ IPictureService pictureService,
+ IPermissionService permissionService,
+ IMediaFileStore mediaFileStore,
+ MediaSettings mediaSettings)
+ {
+ _pictureService = pictureService;
+ _permissionService = permissionService;
+ _mediaFileStore = mediaFileStore;
+ _mediaSettings = mediaSettings;
+ }
+
+ [HttpPost]
+ public virtual async Task<IActionResult> AsyncUpload(IFormFile file, Reference reference = Reference.None, string objectId = "")
+ {
+ if (file == null)
+ return Json(new {
+ success = false,
+ message = "No file uploaded",
+ downloadGuid = Guid.Empty
+ });
+ if (reference != Reference.None && string.IsNullOrEmpty(objectId))
+ return Json(new {
+ success = false,
+ message = "Please save form before upload new picture",
+ downloadGuid = Guid.Empty
+ });
+
+ var fileName = Path.GetFileName(file.FileName);
+ var contentType = file.ContentType;
+ if (!FileExtensions.GetAllowedMediaFileTypes(_mediaSettings.AllowedFileTypes).IsAllowedMediaFileType(Path.GetExtension(fileName)))
+ return Json(new {
+ success = false,
+ pictureId = "",
+ imageUrl = ""
+ });
+ if (string.IsNullOrEmpty(contentType))
+ _ = new FileExtensionContentTypeProvider().TryGetContentType(fileName, out contentType);
+
+ var fileBinary = file.GetDownloadBits();
+ var picture =
+ await _pictureService.InsertPicture(fileBinary, contentType, null, reference: reference,
+ objectId: objectId);
+ //when returning JSON the mime-type must be set to text/plain
+ //otherwise some browsers will pop-up a "Save As" dialog.
+ return Json(new {
+ success = true,
+ pictureId = picture.Id,
+ imageUrl = await _pictureService.GetPictureUrl(picture, 100)
+ });
+ }
+
+ [HttpPost]
+ public virtual async Task<IActionResult> AsyncLogoUpload(IFormFile file)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageSettings))
+ return Content("Access denied");
+
+ if (file == null)
+ return Json(new {
+ success = false,
+ message = "No file uploaded"
+ });
+
+ var fileName = Path.GetFileName(file.FileName);
+ var contentType = file.ContentType;
+ if (!FileExtensions.GetAllowedMediaFileTypes(_mediaSettings.AllowedFileTypes).IsAllowedMediaFileType(Path.GetExtension(fileName)))
+ return Json(new {
+ success = false,
+ message = "File no allowed"
+ });
+
+ if (string.IsNullOrEmpty(contentType))
+ _ = new FileExtensionContentTypeProvider().TryGetContentType(fileName, out contentType);
+ if (string.IsNullOrEmpty(contentType))
+ return Json(new {
+ success = false,
+ message = "Unknown content type"
+ });
+ fileName = fileName.Replace(" ", "");
+ var fileInfo = await _mediaFileStore.GetFileInfo(fileName);
+ if (fileInfo == null)
+ try
+ {
+ var filepath = _mediaFileStore.GetDirectoryInfo("");
+ if (filepath != null)
+ {
+ await using (var stream = new FileStream(_mediaFileStore.Combine(filepath.PhysicalPath, fileName),
+ FileMode.OpenOrCreate))
+ {
+ await file.CopyToAsync(stream);
+ }
+
+ return Json(new {
+ success = true,
+ imageUrl = fileName
+ });
+ }
+
+ return Json(new {
+ success = false,
+ message = "Physical path not exist"
+ });
+ }
+ catch (Exception ex)
+ {
+ return Json(new {
+ success = false,
+ message = ex.Message
+ });
+ }
+
+ {
+ var filepath = _mediaFileStore.GetDirectoryInfo("");
+ if (filepath != null)
+ {
+ await using (var stream = new FileStream(_mediaFileStore.Combine(filepath.PhysicalPath, fileName),
+ FileMode.OpenOrCreate))
+ {
+ await file.CopyToAsync(stream);
+ }
+
+ return Json(new {
+ success = true,
+ imageUrl = fileName
+ });
+ }
+
+ return Json(new {
+ success = false,
+ message = "Physical path not exist"
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/ProductController.cs b/src/Web/Grand.Web.Store/Controllers/ProductController.cs
new file mode 100644
index 000000000..ad8ad745b
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/ProductController.cs
@@ -0,0 +1,2627 @@
+using Grand.Business.Catalog.Services.Products;
+using Grand.Business.Core.Extensions;
+using Grand.Business.Core.Interfaces.Catalog.Products;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Business.Core.Interfaces.Storage;
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Media;
+using Grand.Domain.Permissions;
+using Grand.Infrastructure;
+using Grand.SharedKernel.Extensions;
+using Grand.Web.AdminShared.Extensions;
+using Grand.Web.AdminShared.Extensions.Mapping;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Extensions;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Helpers;
+using Grand.Web.Common.Localization;
+using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Rendering;
+using Microsoft.AspNetCore.StaticFiles;
+using NPOI.SS.Formula.Functions;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Products)]
+public class ProductController : BaseStoreController
+{
+ #region Constructors
+
+ public ProductController(
+ IProductViewModelService productViewModelService,
+ IProductService productService,
+ IInventoryManageService inventoryManageService,
+ IContextAccessor contextAccessor,
+ ILanguageService languageService,
+ ITranslationService translationService,
+ IProductReservationService productReservationService,
+ IAuctionService auctionService,
+ IDateTimeService dateTimeService,
+ IPermissionService permissionService,
+ IEnumTranslationService enumTranslationService)
+ {
+ _productViewModelService = productViewModelService;
+ _productService = productService;
+ _inventoryManageService = inventoryManageService;
+ _contextAccessor = contextAccessor;
+ _languageService = languageService;
+ _translationService = translationService;
+ _productReservationService = productReservationService;
+ _auctionService = auctionService;
+ _dateTimeService = dateTimeService;
+ _permissionService = permissionService;
+ _enumTranslationService = enumTranslationService;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IProductViewModelService _productViewModelService;
+ private readonly IProductService _productService;
+ private readonly IInventoryManageService _inventoryManageService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly ILanguageService _languageService;
+ private readonly ITranslationService _translationService;
+ private readonly IProductReservationService _productReservationService;
+ private readonly IAuctionService _auctionService;
+ private readonly IDateTimeService _dateTimeService;
+ private readonly IPermissionService _permissionService;
+ private readonly IEnumTranslationService _enumTranslationService;
+
+ #endregion
+
+ #region Methods
+
+ #region Product list / create / edit / delete
+
+ //list products
+ public IActionResult Index()
+ {
+ return RedirectToAction("List");
+ }
+
+ public async Task<IActionResult> List()
+ {
+ var model = await _productViewModelService.PrepareProductListModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> ProductList(DataSourceRequest command, ProductListModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var (productModels, totalCount) = await _productViewModelService.PrepareProductsModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = productModels.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> GoToSku(ProductListModel model)
+ {
+ var sku = model.GoDirectlyToSku;
+
+ //try to load a product entity
+ var product = await _productService.GetProductBySku(sku);
+ if (product != null)
+ {
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = product.Id });
+ }
+
+ //not found
+ Warning(_translationService.GetResource("Admin.Catalog.Products.List.SkuNotFound"));
+ return RedirectToAction("List", "Product");
+ }
+
+ //create product
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ public async Task<IActionResult> Create()
+ {
+ var model = new ProductModel();
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ await _productViewModelService.PrepareProductModel(model, null, true, true);
+ await AddLocales(_languageService, model.Locales);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Create(ProductModel model, bool continueEditing)
+ {
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var product = await _productViewModelService.InsertProductModel(model);
+ Success(_translationService.GetResource("Admin.Catalog.Products.Added"));
+ return continueEditing ? RedirectToAction("Edit", new { id = product.Id }) : RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ await _productViewModelService.PrepareProductModel(model, null, false, true);
+ return View(model);
+ }
+
+ //edit product
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> Edit(string id)
+ {
+ var product = await _productService.GetProductById(id, true);
+ if (product == null)
+ //No product found with the specified id
+ return RedirectToAction("List");
+
+ if (!product.LimitedToStores || (product.LimitedToStores &&
+ product.Stores.Contains(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId) &&
+ product.Stores.Count > 1))
+ {
+ Warning(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+ }
+ else
+ {
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("List");
+ }
+
+ var model = product.ToModel(_dateTimeService);
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ await _productViewModelService.PrepareProductModel(model, product, false, false);
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.Name = product.GetTranslation(x => x.Name, languageId, false);
+ locale.ShortDescription = product.GetTranslation(x => x.ShortDescription, languageId, false);
+ locale.FullDescription = product.GetTranslation(x => x.FullDescription, languageId, false);
+ locale.MetaKeywords = product.GetTranslation(x => x.MetaKeywords, languageId, false);
+ locale.MetaDescription = product.GetTranslation(x => x.MetaDescription, languageId, false);
+ locale.MetaTitle = product.GetTranslation(x => x.MetaTitle, languageId, false);
+ locale.SeName = product.GetSeName(languageId, false);
+ });
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> Edit(ProductModel model, bool continueEditing)
+ {
+ var product = await _productService.GetProductById(model.Id, true);
+ if (product == null)
+ //No product found with the specified id
+ return RedirectToAction("List");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = product.Id });
+
+ if (model.Ticks != product.Ticks)
+ {
+ Error(_translationService.GetResource("Admin.Catalog.Products.Fields.ChangedWarning"));
+ return RedirectToAction("Edit", new { id = product.Id });
+ }
+
+ if (ModelState.IsValid)
+ {
+ model.Stores = [_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId];
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ product = await _productViewModelService.UpdateProductModel(product, model);
+ Success(_translationService.GetResource("Admin.Catalog.Products.Updated"));
+ if (continueEditing)
+ {
+ //selected tab
+ await SaveSelectedTabIndex();
+ return RedirectToAction("Edit", new { id = product.Id });
+ }
+
+ return RedirectToAction("List");
+ }
+
+ //If we got this far, something failed, redisplay form
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ await _productViewModelService.PrepareProductModel(model, product, false, true);
+
+ return View(model);
+ }
+
+ //delete product
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> Delete(string id)
+ {
+ var product = await _productService.GetProductById(id, true);
+ if (product == null)
+ //No product found with the specified id
+ return RedirectToAction("List");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("Edit", new { id = product.Id });
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteProduct(product);
+ Success(_translationService.GetResource("Admin.Catalog.Products.Deleted"));
+ return RedirectToAction("List");
+ }
+
+ Error(ModelState);
+ return RedirectToAction("Edit", new { id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ [HttpPost]
+ public async Task<IActionResult> CopyProduct(ProductModel model,
+ [FromServices] ICopyProductService copyProductService, [FromServices] IPictureService pictureService)
+ {
+ var copyModel = model.CopyProductModel;
+ try
+ {
+ var originalProduct = await _productService.GetProductById(copyModel.Id, true);
+
+ if (!originalProduct.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return RedirectToAction("List");
+
+ originalProduct.LimitedToStores = true;
+ originalProduct.Stores.Clear();
+ originalProduct.Stores.Add(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+
+ var newProduct = await copyProductService.CopyProduct(originalProduct, copyModel.Name, copyModel.Published);
+
+ if (copyModel.CopyImages) await CopyImages(originalProduct, newProduct, pictureService);
+
+ Success("The product has been copied successfully");
+ return RedirectToAction("Edit", new { id = newProduct.Id });
+ }
+ catch (Exception exc)
+ {
+ Error(exc.Message);
+ return RedirectToAction("Edit", new { id = copyModel.Id });
+ }
+ }
+
+ private async Task CopyImages(Product originalProduct, Product newProduct, IPictureService pictureService)
+ {
+ foreach (var productPicture in originalProduct.ProductPictures)
+ {
+ var picture = await pictureService.GetPictureById(productPicture.PictureId);
+ var pictureCopy = await pictureService.InsertPicture(
+ await pictureService.LoadPictureBinary(picture),
+ picture.MimeType,
+ pictureService.GetPictureSeName(newProduct.Name),
+ picture.AltAttribute,
+ picture.TitleAttribute,
+ false,
+ Reference.Product,
+ newProduct.Id);
+
+ await _productService.InsertProductPicture(new ProductPicture {
+ PictureId = pictureCopy.Id,
+ DisplayOrder = productPicture.DisplayOrder,
+ IsDefault = productPicture.IsDefault
+ }, newProduct.Id);
+ }
+ }
+
+ #endregion
+
+ #region Required products
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> LoadProductFriendlyNames(string productIds)
+ {
+ var result = "";
+
+ if (!string.IsNullOrWhiteSpace(productIds))
+ {
+ var ids = new List<string>();
+ var rangeArray = productIds
+ .Split([','], StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => x.Trim())
+ .ToList();
+
+ foreach (var str1 in rangeArray) ids.Add(str1);
+
+ var products = await _productService.GetProductsByIds(ids.ToArray(), true);
+ for (var i = 0; i <= products.Count - 1; i++)
+ {
+ if (!products[i].AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ continue;
+
+ result += products[i].Name;
+ if (i != products.Count - 1)
+ result += ", ";
+ }
+ }
+
+ return Json(new { Text = result });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> RequiredProductAddPopup(string productIdsInput)
+ {
+ var model = await _productViewModelService.PrepareAddRequiredProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ ViewBag.productIdsInput = productIdsInput;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RequiredProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddRequiredProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Product categories
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCategoryList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productCategoriesModel = await _productViewModelService.PrepareProductCategoryModel(product);
+ var gridModel = new DataSourceResult {
+ Data = productCategoriesModel,
+ Total = productCategoriesModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCategoryInsert(ProductModel.ProductCategoryModel model)
+ {
+ if (ModelState.IsValid)
+ try
+ {
+ await _productViewModelService.InsertProductCategoryModel(model);
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCategoryUpdate(ProductModel.ProductCategoryModel model)
+ {
+ if (ModelState.IsValid)
+ try
+ {
+ await _productViewModelService.UpdateProductCategoryModel(model);
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCategoryDelete(ProductModel.ProductCategoryModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteProductCategory(model.Id, model.ProductId);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Product collections
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCollectionList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productCollectionsModel = await _productViewModelService.PrepareProductCollectionModel(product);
+ var gridModel = new DataSourceResult {
+ Data = productCollectionsModel,
+ Total = productCollectionsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCollectionInsert(ProductModel.ProductCollectionModel model)
+ {
+ if (ModelState.IsValid)
+ try
+ {
+ await _productViewModelService.InsertProductCollection(model);
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCollectionUpdate(ProductModel.ProductCollectionModel model)
+ {
+ if (ModelState.IsValid)
+ try
+ {
+ await _productViewModelService.UpdateProductCollection(model);
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductCollectionDelete(ProductModel.ProductCollectionModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteProductCollection(model.Id, model.ProductId);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Related products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> RelatedProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var relatedProducts = product.RelatedProducts.OrderBy(x => x.DisplayOrder);
+ var relatedProductsModel = new List<ProductModel.RelatedProductModel>();
+ foreach (var x in relatedProducts)
+ relatedProductsModel.Add(new ProductModel.RelatedProductModel {
+ Id = x.Id,
+ ProductId1 = productId,
+ ProductId2 = x.ProductId2,
+ Product2Name = (await _productService.GetProductById(x.ProductId2))?.Name,
+ DisplayOrder = x.DisplayOrder
+ });
+
+ var gridModel = new DataSourceResult {
+ Data = relatedProductsModel,
+ Total = relatedProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RelatedProductUpdate(ProductModel.RelatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.UpdateRelatedProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RelatedProductDelete(ProductModel.RelatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteRelatedProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> RelatedProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareRelatedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RelatedProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddRelatedProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RelatedProductAddPopup(ProductModel.AddRelatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertRelatedProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareRelatedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Similar products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> SimilarProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var similarProducts = product.SimilarProducts.OrderBy(x => x.DisplayOrder);
+ var similarProductsModel = new List<ProductModel.SimilarProductModel>();
+ foreach (var x in similarProducts)
+ similarProductsModel.Add(new ProductModel.SimilarProductModel {
+ Id = x.Id,
+ ProductId1 = productId,
+ ProductId2 = x.ProductId2,
+ Product2Name = (await _productService.GetProductById(x.ProductId2))?.Name,
+ DisplayOrder = x.DisplayOrder
+ });
+
+ var gridModel = new DataSourceResult {
+ Data = similarProductsModel,
+ Total = similarProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SimilarProductUpdate(ProductModel.SimilarProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.UpdateSimilarProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SimilarProductDelete(ProductModel.SimilarProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteSimilarProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> SimilarProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareSimilarProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SimilarProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddSimilarProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SimilarProductAddPopup(ProductModel.AddSimilarProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertSimilarProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareSimilarProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Bundle products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> BundleProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var bundleProducts = product.BundleProducts.OrderBy(x => x.DisplayOrder);
+ var bundleProductsModel = new List<ProductModel.BundleProductModel>();
+ foreach (var x in bundleProducts)
+ bundleProductsModel.Add(new ProductModel.BundleProductModel {
+ Id = x.Id,
+ ProductBundleId = productId,
+ ProductId = x.ProductId,
+ ProductName = (await _productService.GetProductById(x.ProductId))?.Name,
+ DisplayOrder = x.DisplayOrder,
+ Quantity = x.Quantity
+ });
+ var gridModel = new DataSourceResult {
+ Data = bundleProductsModel,
+ Total = bundleProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BundleProductUpdate(ProductModel.BundleProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.UpdateBundleProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BundleProductDelete(ProductModel.BundleProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteBundleProductModel(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> BundleProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareBundleProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BundleProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddBundleProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BundleProductAddPopup(ProductModel.AddBundleProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertBundleProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareBundleProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Cross-sell products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> CrossSellProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var crossSellProducts = product.CrossSellProduct;
+ var crossSellProductsModel = new List<ProductModel.CrossSellProductModel>();
+ foreach (var x in crossSellProducts)
+ crossSellProductsModel.Add(new ProductModel.CrossSellProductModel {
+ Id = x,
+ ProductId = product.Id,
+ Product2Name = (await _productService.GetProductById(x))?.Name
+ });
+ var gridModel = new DataSourceResult {
+ Data = crossSellProductsModel,
+ Total = crossSellProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> CrossSellProductDelete(ProductModel.CrossSellProductModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null) throw new ArgumentException("Product not exists");
+ var crossSellProduct = product.CrossSellProduct.FirstOrDefault(x => x == model.Id);
+ if (string.IsNullOrEmpty(crossSellProduct))
+ throw new ArgumentException("No cross-sell product found with the specified id");
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteCrossSellProduct(product.Id, crossSellProduct);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> CrossSellProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareCrossSellProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> CrossSellProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddCrossSellProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> CrossSellProductAddPopup(ProductModel.AddCrossSellProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertCrossSellProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareCrossSellProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Recommended products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> RecommendedProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var recommendedProductsModel = new List<ProductModel.RecommendedProductModel>();
+ foreach (var x in product.RecommendedProduct)
+ recommendedProductsModel.Add(new ProductModel.RecommendedProductModel {
+ Id = x,
+ ProductId = product.Id,
+ Product2Name = (await _productService.GetProductById(x))?.Name
+ });
+ var gridModel = new DataSourceResult {
+ Data = recommendedProductsModel,
+ Total = recommendedProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RecommendedProductDelete(ProductModel.RecommendedProductModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null) throw new ArgumentException("Product not exists");
+ var recommendedProduct = product.RecommendedProduct.FirstOrDefault(x => x == model.Id);
+ if (string.IsNullOrEmpty(recommendedProduct))
+ throw new ArgumentException("No recommended product found with the specified id");
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteRecommendedProduct(product.Id, recommendedProduct);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> RecommendedProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareRecommendedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RecommendedProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddRecommendedProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> RecommendedProductAddPopup(ProductModel.AddRecommendedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertRecommendedProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareRecommendedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Associated products
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> AssociatedProductList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var associatedProducts = await _productService.GetAssociatedProducts(productId,
+ showHidden: true);
+ var associatedProductsModel = associatedProducts
+ .Select(x => new ProductModel.AssociatedProductModel {
+ Id = x.Id,
+ ProductId = productId,
+ ProductName = x.Name,
+ DisplayOrder = x.DisplayOrder
+ })
+ .ToList();
+
+ var gridModel = new DataSourceResult {
+ Data = associatedProductsModel,
+ Total = associatedProductsModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociatedProductUpdate(ProductModel.AssociatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var associatedProduct = await _productService.GetProductById(model.Id);
+ if (associatedProduct == null)
+ throw new ArgumentException("No associated product found with the specified id");
+
+ associatedProduct.DisplayOrder = model.DisplayOrder;
+ await _productService.UpdateAssociatedProduct(associatedProduct);
+
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociatedProductDelete(ProductModel.AssociatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.Id);
+ if (product == null)
+ throw new ArgumentException("No associated product found with the specified id");
+
+ await _productViewModelService.DeleteAssociatedProduct(product);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> AssociatedProductAddPopup(string productId)
+ {
+ var model = await _productViewModelService.PrepareAssociatedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ model.ProductId = productId;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociatedProductAddPopupList(DataSourceRequest command,
+ ProductModel.AddAssociatedProductModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociatedProductAddPopup(ProductModel.AddAssociatedProductModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ if (model.SelectedProductIds != null) await _productViewModelService.InsertAssociatedProductModel(model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareAssociatedProductModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Product pictures
+
+ [HttpPost]
+ public async Task<IActionResult> ProductPictureAdd(
+ IFormFileCollection files,
+ Reference reference, string objectId,
+ [FromServices] IPictureService pictureService,
+ [FromServices] MediaSettings mediaSettings)
+ {
+ if (!await _permissionService.Authorize(PermissionSystemName.Pictures))
+ return Json(new
+ {
+ success = false,
+ message = "Access denied - picture permissions"
+ });
+
+ if (reference != Reference.Product || string.IsNullOrEmpty(objectId))
+ return Json(new
+ {
+ success = false,
+ message = "Please save form before upload new pictures"
+ });
+
+ if (!files.Any())
+ return Json(new
+ {
+ success = false,
+ message = "No files uploaded"
+ });
+
+ var product = await _productService.GetProductById(objectId);
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new
+ {
+ success = false,
+ message = "Access denied - staff permissions"
+ });
+
+ var values = new List<(string pictureUrl, string pictureId)>();
+ foreach (var file in files)
+ {
+ var fileName = file.FileName;
+ var contentType = file.ContentType;
+ var fileExtension = Path.GetExtension(fileName);
+ if (string.IsNullOrEmpty(contentType))
+ _ = new FileExtensionContentTypeProvider().TryGetContentType(fileName, out contentType);
+
+ if (FileExtensions.GetAllowedMediaFileTypes(mediaSettings.AllowedFileTypes).IsAllowedMediaFileType(fileExtension))
+ {
+ var fileBinary = file.GetDownloadBits();
+ //insert picture
+ var picture = await pictureService.InsertPicture(fileBinary, contentType, null, reference: reference,
+ objectId: objectId);
+ var pictureUrl = await pictureService.GetPictureUrl(picture);
+
+ values.Add((pictureUrl, picture.Id));
+ //assign picture to the product
+ await _productViewModelService.InsertProductPicture(product, picture, 0);
+ }
+ }
+
+ return Json(new { success = values.Any(), data = values });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPictureList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productPicturesModel = await _productViewModelService.PrepareProductPicturesModel(product);
+ var gridModel = new DataSourceResult {
+ Data = productPicturesModel,
+ Total = productPicturesModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> ProductPicturePopup(string productId, string id)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ return Content("Product not exist");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var pp = product.ProductPictures.FirstOrDefault(x => x.Id == id);
+ if (pp == null)
+ return Content("Product picture not exist");
+
+ var (model, picture) = await _productViewModelService.PrepareProductPictureModel(product, pp);
+ //locales
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.AltAttribute = picture?.GetTranslation(x => x.AltAttribute, languageId, false);
+ locale.TitleAttribute = picture?.GetTranslation(x => x.TitleAttribute, languageId, false);
+ });
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPicturePopup(ProductModel.ProductPictureModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (product.ProductPictures.FirstOrDefault(x => x.Id == model.Id) == null)
+ throw new ArgumentException("No product picture found with the specified id");
+
+ await _productViewModelService.UpdateProductPicture(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPictureDelete(ProductModel.ProductPictureModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.DeleteProductPicture(model);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Product specification attributes
+
+ //ajax
+ [AcceptVerbs("GET")]
+ public async Task<IActionResult> GetOptionsByAttributeId(string attributeId,
+ [FromServices] ISpecificationAttributeService specificationAttributeService)
+ {
+ if (string.IsNullOrEmpty(attributeId))
+ return Json("");
+
+ var options = (await specificationAttributeService.GetSpecificationAttributeById(attributeId)).SpecificationAttributeOptions.OrderBy(x => x.DisplayOrder);
+ var result = (from o in options select new { id = o.Id, name = o.Name }).ToList();
+ return Json(result);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductSpecAttrList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productrSpecsModel = await _productViewModelService.PrepareProductSpecificationAttributeModel(product);
+ var gridModel = new DataSourceResult {
+ Data = productrSpecsModel,
+ Total = productrSpecsModel.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductSpecAttrPopup(
+ [FromServices] ISpecificationAttributeService specificationAttributeService,
+ string productId, string id)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var model = new ProductModel.AddProductSpecificationAttributeModel {
+ //default specs values
+ ShowOnProductPage = true
+ };
+
+ if (!string.IsNullOrEmpty(id))
+ {
+ var specification = product.ProductSpecificationAttributes.FirstOrDefault(x => x.Id == id);
+ if (specification != null) model = specification.ToModel();
+ }
+
+ model.AvailableAttributes = await PrepareAvailableAttributes(specificationAttributeService);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductSpecAttrPopup(
+ [FromServices] ISpecificationAttributeService specificationAttributeService,
+ ProductModel.AddProductSpecificationAttributeModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ return Content("Product not exists");
+
+ var psa = product.ProductSpecificationAttributes.FirstOrDefault(x => x.Id == model.Id);
+ if (psa == null)
+ await _productViewModelService.InsertProductSpecificationAttributeModel(model, product);
+ else
+ await _productViewModelService.UpdateProductSpecificationAttributeModel(product, psa, model);
+
+ return new JsonResult("");
+ }
+
+ Error(ModelState);
+ model.AvailableAttributes = await PrepareAvailableAttributes(specificationAttributeService);
+
+ return View(model);
+ }
+
+ private async Task<List<SelectListItem>> PrepareAvailableAttributes(
+ ISpecificationAttributeService specificationAttributeService)
+ {
+ var availableSpecificationAttributes = new List<SelectListItem>();
+ foreach (var sa in await specificationAttributeService.GetSpecificationAttributes())
+ availableSpecificationAttributes.Add(new SelectListItem {
+ Text = sa.Name,
+ Value = sa.Id
+ });
+ return availableSpecificationAttributes;
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductSpecAttrDelete(ProductSpecificationAttributeModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ return Content("Product not exists");
+
+ var psa = product.ProductSpecificationAttributes.FirstOrDefault(x => x.Id == model.Id);
+ if (psa == null)
+ throw new ArgumentException("No specification attribute found with the specified id");
+
+ await _productViewModelService.DeleteProductSpecificationAttribute(product, psa);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Purchased with order
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> PurchasedWithOrders(DataSourceRequest command, string productId,
+ [FromServices] IOrderViewModelService orderViewModelService)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Json(new DataSourceResult {
+ Data = null,
+ Total = 0
+ });
+
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var model = new OrderListModel {
+ ProductId = productId
+ };
+
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var (orderModels, totalCount) =
+ await orderViewModelService.PrepareOrderModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = orderModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Reviews
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> Reviews(DataSourceRequest command, string productId,
+ [FromServices] IProductReviewService productReviewService)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var productReviews = await productReviewService.GetAllProductReviews("", null,
+ null, null, "", storeId, productId);
+
+ var items = new List<ProductReviewModel>();
+ foreach (var item in productReviews.PagedForCommand(command))
+ {
+ var m = new ProductReviewModel();
+ await _productViewModelService.PrepareProductReviewModel(m, item, false, true);
+ items.Add(m);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = items,
+ Total = productReviews.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Bulk editing
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> BulkEdit()
+ {
+ var model = await _productViewModelService.PrepareBulkEditListModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BulkEditSelect(DataSourceRequest command, BulkEditListModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (bulkEditProductModels, totalCount) =
+ await _productViewModelService.PrepareBulkEditProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = bulkEditProductModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BulkEditUpdate(IEnumerable<BulkEditProductModel> products)
+ {
+ var validProducts = await FilterValidProductsForStore(products);
+
+ if (validProducts.Any())
+ await _productViewModelService.UpdateBulkEdit(validProducts);
+
+ return new JsonResult("");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> BulkEditDelete(IEnumerable<BulkEditProductModel> products)
+ {
+ var validProducts = await FilterValidProductsForStore(products);
+
+ if (validProducts.Any())
+ await _productViewModelService.DeleteBulkEdit(validProducts.ToList());
+
+ return new JsonResult("");
+ }
+
+
+ /// <summary>
+ /// Filters product models to include only valid products accessible to the current store
+ /// </summary>
+ /// <param name="products">Collection of product models to filter</param>
+ /// <returns>List of product models that are accessible to the current store</returns>
+ private async Task<List<BulkEditProductModel>> FilterValidProductsForStore(IEnumerable<BulkEditProductModel> products)
+ {
+ var validProducts = new List<BulkEditProductModel>();
+
+ foreach (var pModel in products)
+ {
+ if (string.IsNullOrEmpty(pModel.Id))
+ continue;
+
+ var product = await _productService.GetProductById(pModel.Id);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ continue;
+
+ validProducts.Add(pModel);
+ }
+
+ return validProducts;
+ }
+ #endregion
+
+ #region Product currency price
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPriceList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var items = new List<ProductModel.ProductPriceModel>();
+ foreach (var item in product.ProductPrices)
+ items.Add(new ProductModel.ProductPriceModel {
+ Id = item.Id,
+ CurrencyCode = item.CurrencyCode,
+ Price = item.Price,
+ ProductId = product.Id
+ });
+
+ var gridModel = new DataSourceResult {
+ Data = items,
+ Total = items.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPriceInsert(ProductModel.ProductPriceModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (product.ProductPrices.Any(x => x.CurrencyCode == model.CurrencyCode))
+ throw new ArgumentException("Currency code exists");
+
+ if (ModelState.IsValid)
+ try
+ {
+ await _productService.InsertProductPrice(new ProductPrice {
+ ProductId = product.Id,
+ CurrencyCode = model.CurrencyCode,
+ Price = model.Price
+ });
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPriceUpdate(ProductModel.ProductPriceModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productPrice = product.ProductPrices.FirstOrDefault(x => x.Id == model.Id);
+ if (productPrice == null)
+ throw new ArgumentException("Product price model not exists");
+
+ if (product.ProductPrices.Any(x => x.Id != model.Id && x.CurrencyCode == model.CurrencyCode))
+ throw new ArgumentException("You can't use this currency code");
+
+ if (ModelState.IsValid)
+ try
+ {
+ productPrice!.CurrencyCode = model.CurrencyCode;
+ productPrice.Price = model.Price;
+ productPrice.ProductId = model.ProductId;
+
+ await _productService.UpdateProductPrice(productPrice);
+
+ return new JsonResult("");
+ }
+ catch (Exception ex)
+ {
+ return ErrorForKendoGridJson(ex.Message);
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductPriceDelete(ProductModel.ProductPriceModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productPrice = product.ProductPrices.FirstOrDefault(x => x.Id == model.Id);
+ if (productPrice == null)
+ throw new ArgumentException("Product price model not exists");
+
+ if (ModelState.IsValid)
+ {
+ productPrice!.ProductId = model.ProductId;
+ await _productService.DeleteProductPrice(productPrice);
+
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Tier prices
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> TierPriceList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var tierPricesModel = await _productViewModelService.PrepareTierPriceModel(product, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ var gridModel = new DataSourceResult {
+ Data = tierPricesModel,
+ Total = tierPricesModel.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> TierPriceCreatePopup(string productId)
+ {
+ var model = new ProductModel.TierPriceModel {
+ ProductId = productId
+ };
+ await _productViewModelService.PrepareTierPriceModel(model, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> TierPriceCreatePopup(ProductModel.TierPriceModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var tierPrice = model.ToEntity(_dateTimeService);
+ await _productService.InsertTierPrice(tierPrice, product.Id);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+ //If we got this far, something failed, redisplay form
+ await _productViewModelService.PrepareTierPriceModel(model, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> TierPriceEditPopup(string id, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var tierPrice = product.TierPrices.FirstOrDefault(x => x.Id == id);
+ if (tierPrice == null)
+ return Content("Empty tier price");
+
+ var model = tierPrice.ToModel(_dateTimeService);
+ model.ProductId = productId;
+ await _productViewModelService.PrepareTierPriceModel(model, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> TierPriceEditPopup(string productId, ProductModel.TierPriceModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(productId, true);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var tierPrice = product.TierPrices.FirstOrDefault(x => x.Id == model.Id);
+ if (tierPrice == null)
+ return Content("Empty tier price");
+
+ tierPrice = model.ToEntity(tierPrice, _dateTimeService);
+ await _productService.UpdateTierPrice(tierPrice, product.Id);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+ //stores
+ await _productViewModelService.PrepareTierPriceModel(model, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> TierPriceDelete(ProductModel.TierPriceDeleteModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId, true);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var tierPrice = product.TierPrices.FirstOrDefault(x => x.Id == model.Id);
+ if (tierPrice == null)
+ throw new ArgumentException("No tier price found with the specified id");
+
+ await _productService.DeleteTierPrice(tierPrice, product.Id);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #endregion
+
+ #region Product attributes
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeMappingList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var attributesModel = await _productViewModelService.PrepareProductAttributeMappingModels(product);
+ var gridModel = new DataSourceResult {
+ Data = attributesModel,
+ Total = attributesModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeMappingPopup(string productId, string productAttributeMappingId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ if (string.IsNullOrEmpty(productAttributeMappingId))
+ {
+ var model = await _productViewModelService.PrepareProductAttributeMappingModel(product);
+ return View(model);
+ }
+ else
+ {
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ var model = await _productViewModelService.PrepareProductAttributeMappingModel(product,
+ productAttributeMapping);
+ return View(model);
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeMappingPopup(ProductModel.ProductAttributeMappingModel model)
+ {
+ if (ModelState.IsValid)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (string.IsNullOrEmpty(model.Id))
+ await _productViewModelService.InsertProductAttributeMappingModel(model);
+ else
+ await _productViewModelService.UpdateProductAttributeMappingModel(model);
+
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareProductAttributeMappingModel(model);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeMappingDelete(string id, string productId,
+ [FromServices] IProductAttributeService productAttributeService)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productAttributeMapping = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == id);
+ if (productAttributeMapping == null)
+ throw new ArgumentException("No product attribute mapping found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ await productAttributeService.DeleteProductAttributeMapping(productAttributeMapping, product.Id);
+ return new JsonResult("");
+ }
+
+ //edit
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeValidationRulesPopup(string id, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productAttributeMapping = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == id);
+ if (productAttributeMapping == null)
+ return Content("No attribute value found with the specified id");
+
+
+ var model = await _productViewModelService.PrepareProductAttributeMappingModel(productAttributeMapping);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeValidationRulesPopup(
+ ProductModel.ProductAttributeMappingModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productAttributeMapping = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == model.Id);
+ if (productAttributeMapping == null)
+ throw new ArgumentException("No attribute value found with the specified id");
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.UpdateProductAttributeValidationRulesModel(productAttributeMapping, model);
+ return Content("");
+ }
+
+ Error(ModelState);
+ model = await _productViewModelService.PrepareProductAttributeMappingModel(productAttributeMapping);
+ return View(model);
+ }
+
+ #endregion
+
+ #region Product attributes. Condition
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeConditionPopup(string productId, string productAttributeMappingId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ if (productAttributeMapping == null)
+ //No attribute value found with the specified id
+ return Content("No attribute value found with the specified id");
+
+ var model = await _productViewModelService.PrepareProductAttributeConditionModel(product,
+ productAttributeMapping);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeConditionPopup(ProductAttributeConditionModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == model.ProductAttributeMappingId);
+ if (productAttributeMapping == null)
+ return Content("No attribute value found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ await _productViewModelService.UpdateProductAttributeConditionModel(product, productAttributeMapping, model);
+ return Content("");
+ }
+
+ #endregion
+
+ #region Product attribute values
+
+ //list
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> EditAttributeValues(string productAttributeMappingId, string productId,
+ [FromServices] IProductAttributeService productAttributeService)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ if (productAttributeMapping == null)
+ throw new ArgumentException("No product attribute mapping found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productAttribute =
+ await productAttributeService.GetProductAttributeById(productAttributeMapping.ProductAttributeId);
+ var model = new ProductModel.ProductAttributeValueListModel {
+ ProductName = product.Name,
+ ProductId = product.Id,
+ ProductAttributeName = productAttribute.Name,
+ ProductAttributeMappingId = productAttributeMappingId
+ };
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeValueList(string productAttributeMappingId, string productId,
+ DataSourceRequest command)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ if (productAttributeMapping == null)
+ throw new ArgumentException("No product attribute mapping found with the specified id");
+
+ var values =
+ await _productViewModelService.PrepareProductAttributeValueModels(product, productAttributeMapping);
+ var gridModel = new DataSourceResult {
+ Data = values,
+ Total = values.Count
+ };
+ return Json(gridModel);
+ }
+
+ //create
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeValueCreatePopup(string productAttributeMappingId,
+ string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ if (productAttributeMapping == null)
+ throw new ArgumentException("No product attribute mapping found with the specified id");
+
+ var model = await _productViewModelService.PrepareProductAttributeValueModel(product, productAttributeMapping);
+ //locales
+ await AddLocales(_languageService, model.Locales);
+
+ return View(model);
+ }
+
+ [HttpPost]
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeValueCreatePopup(ProductModel.ProductAttributeValueModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var productAttributeMapping =
+ product.ProductAttributeMappings.FirstOrDefault(x => x.Id == model.ProductAttributeMappingId);
+ if (productAttributeMapping == null)
+ //No product attribute found with the specified id
+ return RedirectToAction("List", "Product");
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.InsertProductAttributeValueModel(model);
+ return Content("");
+ }
+
+ //If we got this far, something failed, redisplay form
+ await _productViewModelService.PrepareProductAttributeValueModel(product, model);
+ return View(model);
+ }
+
+ //edit
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ProductAttributeValueEditPopup(string id, string productId,
+ string productAttributeMappingId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var pa = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == productAttributeMappingId);
+ if (pa == null)
+ return RedirectToAction("List", "Product");
+
+ var pav = pa.ProductAttributeValues.FirstOrDefault(x => x.Id == id);
+ if (pav == null)
+ //No attribute value found with the specified id
+ return RedirectToAction("List", "Product");
+
+ var model = await _productViewModelService.PrepareProductAttributeValueModel(pa, pav);
+ //locales
+ await AddLocales(_languageService, model.Locales, (locale, languageId) =>
+ {
+ locale.Name = pav.GetTranslation(x => x.Name, languageId, false);
+ });
+ //pictures
+ await _productViewModelService.PrepareProductAttributeValueModel(product, model);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeValueEditPopup(string productId,
+ ProductModel.ProductAttributeValueModel model)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var pav = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == model.ProductAttributeMappingId)
+ ?.ProductAttributeValues.FirstOrDefault(x => x.Id == model.Id);
+ if (pav == null)
+ //No attribute value found with the specified id
+ return RedirectToAction("List", "Product");
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.UpdateProductAttributeValueModel(pav, model);
+ return Content("");
+ }
+
+ //If we got this far, something failed, redisplay form
+ await _productViewModelService.PrepareProductAttributeValueModel(product, model);
+ return View(model);
+ }
+
+ //delete
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeValueDelete(string id, string pam, string productId,
+ [FromServices] IProductAttributeService productAttributeService)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var pav = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == pam)?.ProductAttributeValues
+ .FirstOrDefault(x => x.Id == id);
+ if (pav == null)
+ throw new ArgumentException("No product attribute value found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ throw new ArgumentException(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ if (ModelState.IsValid)
+ {
+ await productAttributeService.DeleteProductAttributeValue(pav, productId, pam);
+ return new JsonResult("");
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ public async Task<IActionResult> AssociateProductToAttributeValuePopup()
+ {
+ var model = await _productViewModelService.PrepareAssociateProductToAttributeValueModel(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociateProductToAttributeValuePopupList(DataSourceRequest command,
+ ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel model)
+ {
+ model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (products, totalCount) = await _productViewModelService.PrepareProductModel(model, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = products.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AssociateProductToAttributeValuePopup(
+ ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel model)
+ {
+ var associatedProduct = await _productService.GetProductById(model.AssociatedToProductId);
+ if (associatedProduct == null)
+ return Content("Cannot load a product");
+
+ if (!associatedProduct.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ throw new ArgumentException(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ return Content("");
+ }
+
+ #endregion
+
+ #region Product attribute combinations
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationList(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var combinationsModel = await _productViewModelService.PrepareProductAttributeCombinationModel(product);
+ var gridModel = new DataSourceResult {
+ Data = combinationsModel,
+ Total = combinationsModel.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationDelete(string id, string productId,
+ [FromServices] IProductAttributeService productAttributeService)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ var combination = product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == id);
+ if (combination == null)
+ throw new ArgumentException("No product attribute combination found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ await productAttributeService.DeleteProductAttributeCombination(combination, productId);
+ if (product.ManageInventoryMethodId == ManageInventoryMethod.ManageStockByAttributes)
+ {
+ var pr = await _productService.GetProductById(productId);
+ pr.StockQuantity = pr.ProductAttributeCombinations.Sum(x => x.StockQuantity);
+ pr.ReservedQuantity = pr.ProductAttributeCombinations.Sum(x => x.ReservedQuantity);
+ await _inventoryManageService.UpdateStockProduct(pr, false);
+ }
+
+ return new JsonResult("");
+ }
+
+ //edit
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> AttributeCombinationPopup(string productId, string Id)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var model = await _productViewModelService.PrepareProductAttributeCombinationModel(product, Id);
+ await _productViewModelService.PrepareAddProductAttributeCombinationModel(model, product);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> AttributeCombinationPopup(string productId,
+ ProductAttributeCombinationModel model)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ //No product found with the specified id
+ return RedirectToAction("List", "Product");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var warnings = await _productViewModelService.InsertOrUpdateProductAttributeCombinationPopup(product, model);
+ if (!warnings.Any()) return Content("");
+ //If we got this far, something failed, redisplay form
+ await _productViewModelService.PrepareAddProductAttributeCombinationModel(model, product);
+ model.Warnings = warnings;
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> GenerateAllAttributeCombinations(string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ await _productViewModelService.GenerateAllAttributeCombinations(product);
+
+ return Json(new { Success = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ClearAllAttributeCombinations(string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ if (ModelState.IsValid)
+ {
+ await _productViewModelService.ClearAllAttributeCombinations(product);
+
+ if (product.ManageInventoryMethodId == ManageInventoryMethod.ManageStockByAttributes)
+ {
+ product.StockQuantity = 0;
+ product.ReservedQuantity = 0;
+ await _inventoryManageService.UpdateStockProduct(product, false);
+ }
+
+ return Json(new { Success = true });
+ }
+
+ return ErrorForKendoGridJson(ModelState);
+ }
+
+ #region Product Attribute combination - tier prices
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationTierPriceList(DataSourceRequest command,
+ string productId, string productAttributeCombinationId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var tierPriceModel =
+ await _productViewModelService.PrepareProductAttributeCombinationTierPricesModel(product,
+ productAttributeCombinationId);
+ var gridModel = new DataSourceResult {
+ Data = tierPriceModel,
+ Total = tierPriceModel.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationTierPriceInsert(string productId,
+ string productAttributeCombinationId, ProductModel.ProductAttributeCombinationTierPricesModel model)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var combination = product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
+ if (combination != null)
+ await _productViewModelService.InsertProductAttributeCombinationTierPricesModel(product, combination,
+ model);
+
+ return new JsonResult("");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationTierPriceUpdate(string productId,
+ string productAttributeCombinationId, ProductModel.ProductAttributeCombinationTierPricesModel model)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var combination = product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
+ if (combination != null)
+ await _productViewModelService.UpdateProductAttributeCombinationTierPricesModel(product, combination,
+ model);
+
+ return new JsonResult("");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductAttributeCombinationTierPriceDelete(string productId,
+ string productAttributeCombinationId, string id)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Content(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var combination =
+ product.ProductAttributeCombinations.FirstOrDefault(x => x.Id == productAttributeCombinationId);
+ if (combination != null)
+ {
+ var tierPrice = combination.TierPrices.FirstOrDefault(x => x.Id == id);
+ if (tierPrice != null)
+ await _productViewModelService.DeleteProductAttributeCombinationTierPrices(product, combination,
+ tierPrice);
+ }
+
+ return new JsonResult("");
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Reservation
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ListReservations(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var reservations =
+ await _productReservationService.GetProductReservationsByProductId(productId, null, null, command.Page - 1,
+ command.PageSize);
+ var reservationModel = reservations
+ .Select(x => new ProductModel.ReservationModel {
+ ReservationId = x.Id,
+ Date = x.Date,
+ OrderId = x.OrderId,
+ ProductId = x.ProductId,
+ Parameter = x.Parameter,
+ Resource = x.Resource,
+ Duration = x.Duration
+ }).ToList();
+
+ var gridModel = new DataSourceResult {
+ Data = reservationModel,
+ Total = reservations.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> GenerateCalendar(string productId, ProductModel.GenerateCalendarModel model)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
+
+ var reservations = await _productReservationService.GetProductReservationsByProductId(productId, null, null);
+ if (reservations.Any())
+ if (((product.IntervalUnitId == IntervalUnit.Minute || product.IntervalUnitId == IntervalUnit.Hour) &&
+ (IntervalUnit)model.Interval == IntervalUnit.Day) ||
+ (product.IntervalUnitId == IntervalUnit.Day &&
+ ((IntervalUnit)model.IntervalUnit == IntervalUnit.Minute ||
+ (IntervalUnit)model.IntervalUnit == IntervalUnit.Hour)))
+ return Json(new
+ {
+ errors = _translationService.GetResource("Admin.Catalog.Products.Calendar.CannotChangeInterval")
+ });
+
+ if (!ModelState.IsValid)
+ {
+ var error = (Dictionary<string, Dictionary<string, object>>)ModelState.SerializeErrors();
+ var s = "";
+ foreach (var error1 in error)
+ foreach (var error2 in error1.Value)
+ {
+ var v = (string[])error2.Value;
+ s += v[0] + "\n";
+ }
+
+ return Json(new { errors = s });
+ }
+
+ //update fields on product
+ await _productService.UpdateProductField(product, x => x.Interval, model.Interval);
+ await _productService.UpdateProductField(product, x => x.IntervalUnitId, (IntervalUnit)model.IntervalUnit);
+ await _productService.UpdateProductField(product, x => x.IncBothDate, model.IncBothDate);
+
+ var minutesToAdd = 0;
+ switch ((IntervalUnit)model.IntervalUnit)
+ {
+ case IntervalUnit.Minute:
+ minutesToAdd = model.Interval;
+ break;
+ case IntervalUnit.Hour:
+ minutesToAdd = model.Interval * 60;
+ break;
+ case IntervalUnit.Day:
+ minutesToAdd = model.Interval * 60 * 24;
+ break;
+ }
+
+ var _hourFrom = model.StartTime.Hour;
+ var _minutesFrom = model.StartTime.Minute;
+ var _hourTo = model.EndTime.Hour;
+ var _minutesTo = model.EndTime.Minute;
+ var _dateFrom = new DateTime(model.StartDate.Value.Year, model.StartDate.Value.Month, model.StartDate.Value.Day,
+ 0, 0, 0, 0);
+ var _dateTo = new DateTime(model.EndDate.Value.Year, model.EndDate.Value.Month, model.EndDate.Value.Day, 23, 59,
+ 59, 999);
+ if ((IntervalUnit)model.IntervalUnit == IntervalUnit.Day)
+ {
+ model.Quantity = 1;
+ model.Parameter = "";
+ }
+ else
+ {
+ model.Resource = "";
+ }
+
+ var dates = new List<DateTime>();
+ var counter = 0;
+ for (var iterator = _dateFrom; iterator <= _dateTo; iterator += new TimeSpan(0, minutesToAdd, 0))
+ {
+ if ((IntervalUnit)model.IntervalUnit != IntervalUnit.Day)
+ {
+ if (iterator.Hour >= _hourFrom && iterator.Hour <= _hourTo)
+ {
+ if (iterator.Hour == _hourTo)
+ if (iterator.Minute > _minutesTo)
+ continue;
+ if (iterator.Hour == _hourFrom)
+ if (iterator.Minute < _minutesFrom)
+ continue;
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ if ((iterator.DayOfWeek == DayOfWeek.Monday && !model.Monday) ||
+ (iterator.DayOfWeek == DayOfWeek.Tuesday && !model.Tuesday) ||
+ (iterator.DayOfWeek == DayOfWeek.Wednesday && !model.Wednesday) ||
+ (iterator.DayOfWeek == DayOfWeek.Thursday && !model.Thursday) ||
+ (iterator.DayOfWeek == DayOfWeek.Friday && !model.Friday) ||
+ (iterator.DayOfWeek == DayOfWeek.Saturday && !model.Saturday) ||
+ (iterator.DayOfWeek == DayOfWeek.Sunday && !model.Sunday))
+ continue;
+
+ for (var i = 0; i < model.Quantity.MaxQuantity(); i++)
+ {
+ dates.Add(iterator);
+ try
+ {
+ var insert = true;
+ if ((IntervalUnit)model.IntervalUnit == IntervalUnit.Day)
+ if (reservations.Any(x => x.Resource == model.Resource && x.Date == iterator))
+ insert = false;
+ if (insert)
+ {
+ if (counter++ > 1000)
+ break;
+
+ await _productReservationService.InsertProductReservation(new ProductReservation {
+ OrderId = "",
+ Date = iterator,
+ ProductId = productId,
+ Resource = model.Resource,
+ Parameter = model.Parameter,
+ Duration = model.Interval + " " + _enumTranslationService.GetTranslationEnum((IntervalUnit)model.IntervalUnit)
+ });
+ }
+ }
+ catch { }
+ }
+ }
+
+ return Json(new { success = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ClearCalendar(string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
+
+ var toDelete = await _productReservationService.GetProductReservationsByProductId(productId, true, null);
+ foreach (var record in toDelete) await _productReservationService.DeleteProductReservation(record);
+
+ return Json("");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ClearOld(string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
+
+ var toDelete =
+ (await _productReservationService.GetProductReservationsByProductId(productId, true, null)).Where(x =>
+ x.Date < DateTime.UtcNow);
+ foreach (var record in toDelete) await _productReservationService.DeleteProductReservation(record);
+
+ return Json("");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> ProductReservationDelete(ProductModel.ReservationModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return ErrorForKendoGridJson(_translationService.GetResource("Admin.Catalog.Products.Permissions"));
+
+ var toDelete = await _productReservationService.GetProductReservation(model.ReservationId);
+ if (toDelete != null)
+ {
+ if (string.IsNullOrEmpty(toDelete.OrderId))
+ await _productReservationService.DeleteProductReservation(toDelete);
+ else
+ return Json(new DataSourceResult {
+ Errors = _translationService.GetResource("Admin.Catalog.ProductReservations.CantDeleteWithOrder")
+ });
+ }
+
+ return Json("");
+ }
+
+ #endregion
+
+ #region Bids
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ListBids(DataSourceRequest command, string productId)
+ {
+ var product = await _productService.GetProductById(productId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new { errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
+
+ var (bidModels, totalCount) =
+ await _productViewModelService.PrepareBidMode(productId, command.Page, command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = bidModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> BidDelete(ProductModel.BidModel model)
+ {
+ var product = await _productService.GetProductById(model.ProductId);
+ if (product == null)
+ throw new ArgumentException("No product found with the specified id");
+
+ if (!product.AccessToEntityByStore(_contextAccessor.WorkContext.CurrentCustomer.StaffStoreId))
+ return Json(new DataSourceResult { Errors = _translationService.GetResource("Admin.Catalog.Products.Permissions") });
+
+ var toDelete = await _auctionService.GetBid(model.BidId);
+ if (toDelete != null)
+ {
+ if (string.IsNullOrEmpty(toDelete.OrderId))
+ {
+ //delete bid
+ await _auctionService.DeleteBid(toDelete);
+ return Json("");
+ }
+
+ return Json(new DataSourceResult { Errors = _translationService.GetResource("Admin.Catalog.Products.Bids.CantDeleteWithOrder") });
+ }
+
+ return Json(new DataSourceResult { Errors = "Bid not exists" });
+ }
+
+ #endregion
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/ReportsController.cs b/src/Web/Grand.Web.Store/Controllers/ReportsController.cs
new file mode 100644
index 000000000..2461ad3a1
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/ReportsController.cs
@@ -0,0 +1,639 @@
+using Grand.Business.Core.Interfaces.Catalog.Prices;
+using Grand.Business.Core.Interfaces.Catalog.Products;
+using Grand.Business.Core.Interfaces.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Common.Security;
+using Grand.Business.Core.Interfaces.Common.Stores;
+using Grand.Business.Core.Interfaces.System.Reports;
+using Grand.Business.Core.Utilities.System;
+using Grand.Domain.Orders;
+using Grand.Domain.Payments;
+using Grand.Domain.Permissions;
+using Grand.Domain.Shipping;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Catalog;
+using Grand.Web.AdminShared.Models.Customers;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Extensions;
+using Grand.Web.Common.Localization;
+using Grand.Web.Common.Security.Authorization;
+using Grand.Web.Store.Extensions;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Rendering;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Reports)]
+public class ReportsController : BaseStoreController
+{
+ private readonly ICountryService _countryService;
+ private readonly ICurrencyService _currencyService;
+ private readonly ICustomerReportService _customerReportService;
+ private readonly ICustomerReportViewModelService _customerReportViewModelService;
+ private readonly IDateTimeService _dateTimeService;
+ private readonly IOrderReportService _orderReportService;
+ private readonly IOrderService _orderService;
+ private readonly IOrderStatusService _orderStatusService;
+ private readonly IPermissionService _permissionService;
+ private readonly IPriceFormatter _priceFormatter;
+ private readonly IProductAttributeFormatter _productAttributeFormatter;
+ private readonly IProductService _productService;
+ private readonly IProductsReportService _productsReportService;
+ private readonly IStockQuantityService _stockQuantityService;
+ private readonly IStoreService _storeService;
+ private readonly ITranslationService _translationService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly IEnumTranslationService _enumTranslationService;
+ public ReportsController(IOrderService orderService,
+ IOrderReportService orderReportService,
+ IProductsReportService productsReportService,
+ ICustomerReportService customerReportService,
+ ICustomerReportViewModelService customerReportViewModelService,
+ IPermissionService permissionService,
+ IContextAccessor contextAccessor,
+ IPriceFormatter priceFormatter,
+ IProductService productService,
+ IProductAttributeFormatter productAttributeFormatter,
+ IStockQuantityService stockQuantityService,
+ ITranslationService translationService,
+ IStoreService storeService,
+ ICountryService countryService,
+ IDateTimeService dateTimeService,
+ IOrderStatusService orderStatusService,
+ ICurrencyService currencyService,
+ IEnumTranslationService enumTranslationService)
+ {
+ _orderService = orderService;
+ _orderReportService = orderReportService;
+ _productsReportService = productsReportService;
+ _customerReportService = customerReportService;
+ _customerReportViewModelService = customerReportViewModelService;
+ _permissionService = permissionService;
+ _contextAccessor = contextAccessor;
+ _priceFormatter = priceFormatter;
+ _productService = productService;
+ _productAttributeFormatter = productAttributeFormatter;
+ _stockQuantityService = stockQuantityService;
+ _translationService = translationService;
+ _storeService = storeService;
+ _countryService = countryService;
+ _dateTimeService = dateTimeService;
+ _orderStatusService = orderStatusService;
+ _currencyService = currencyService;
+ _enumTranslationService = enumTranslationService;
+ }
+
+ [NonAction]
+ protected async Task<DataSourceResult> GetBestsellersBriefReportModel(int pageIndex,
+ int pageSize, int orderBy)
+ {
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var items = await _orderReportService.BestSellersReport(
+ storeId,
+ orderBy: orderBy,
+ pageIndex: pageIndex,
+ pageSize: pageSize,
+ showHidden: true);
+ var result = new List<BestsellersReportLineModel>();
+ foreach (var x in items)
+ {
+ var m = new BestsellersReportLineModel {
+ ProductId = x.ProductId,
+ TotalAmount =
+ _priceFormatter.FormatPrice(x.TotalAmount, await _currencyService.GetPrimaryStoreCurrency()),
+ TotalQuantity = x.TotalQuantity
+ };
+ var product = await _productService.GetProductById(x.ProductId);
+ if (product != null)
+ m.ProductName = product.Name;
+ result.Add(m);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = result,
+ Total = items.TotalCount
+ };
+ return gridModel;
+ }
+
+ [NonAction]
+ protected virtual async Task<IList<OrderPeriodReportLineModel>> GetReportOrderPeriodModel()
+ {
+ var report = new List<OrderPeriodReportLineModel>();
+ var reportperiod7days = await _orderReportService.GetOrderPeriodReport(7, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ report.Add(new OrderPeriodReportLineModel {
+ Period = _translationService.GetResource("Admin.Reports.Period.7days"),
+ Count = reportperiod7days.Count,
+ Amount = reportperiod7days.Amount
+ });
+
+ var reportperiod14days = await _orderReportService.GetOrderPeriodReport(14, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ report.Add(new OrderPeriodReportLineModel {
+ Period = _translationService.GetResource("Admin.Reports.Period.14days"),
+ Count = reportperiod14days.Count,
+ Amount = reportperiod14days.Amount
+ });
+
+ var reportperiodmonth = await _orderReportService.GetOrderPeriodReport(30, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ report.Add(new OrderPeriodReportLineModel {
+ Period = _translationService.GetResource("Admin.Reports.Period.month"),
+ Count = reportperiodmonth.Count,
+ Amount = reportperiodmonth.Amount
+ });
+
+ var reportperiodyear = await _orderReportService.GetOrderPeriodReport(365, _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId);
+ report.Add(new OrderPeriodReportLineModel {
+ Period = _translationService.GetResource("Admin.Reports.Period.year"),
+ Count = reportperiodyear.Count,
+ Amount = reportperiodyear.Amount
+ });
+
+ return report;
+ }
+
+
+ [HttpPost]
+ public async Task<IActionResult> BestsellersBriefReportByQuantityList(DataSourceRequest command)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var gridModel = await GetBestsellersBriefReportModel(command.Page - 1,
+ command.PageSize, 1);
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> BestsellersBriefReportByAmountList(DataSourceRequest command)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var gridModel = await GetBestsellersBriefReportModel(command.Page - 1,
+ command.PageSize, 2);
+
+ return Json(gridModel);
+ }
+
+ public async Task<IActionResult> BestsellersReport()
+ {
+ var model = new BestsellersReportModel();
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var status = await _orderStatusService.GetAll();
+ //order statuses
+ model.AvailableOrderStatuses = status.Select(x => new SelectListItem { Value = x.StatusId.ToString(), Text = x.Name }).ToList();
+ model.AvailableOrderStatuses.Insert(0,
+ new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+
+ //payment statuses
+ model.AvailablePaymentStatuses = _enumTranslationService.ToSelectList(PaymentStatus.Pending, false).ToList();
+ model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+
+ //billing countries
+ foreach (var c in await _countryService.GetAllCountriesForBilling(showHidden: true))
+ model.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id });
+ model.AvailableCountries.Insert(0, new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> BestsellersReportList(DataSourceRequest command, BestsellersReportModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ DateTime? startDateValue = model.StartDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
+
+ DateTime? endDateValue = model.EndDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.EndDate.Value, _dateTimeService.CurrentTimeZone).AddDays(1);
+
+ int? orderStatus = model.OrderStatusId > 0 ? model.OrderStatusId : null;
+ var paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)model.PaymentStatusId : null;
+
+ var items = await _orderReportService.BestSellersReport(
+ createdFromUtc: startDateValue,
+ createdToUtc: endDateValue,
+ os: orderStatus,
+ ps: paymentStatus,
+ billingCountryId: model.BillingCountryId,
+ orderBy: 2,
+ pageIndex: command.Page - 1,
+ pageSize: command.PageSize,
+ showHidden: true,
+ storeId: model.StoreId);
+
+ var result = new List<BestsellersReportLineModel>();
+ foreach (var x in items)
+ {
+ var m = new BestsellersReportLineModel {
+ ProductId = x.ProductId,
+ TotalAmount =
+ _priceFormatter.FormatPrice(x.TotalAmount, await _currencyService.GetPrimaryStoreCurrency()),
+ TotalQuantity = x.TotalQuantity
+ };
+ var product = await _productService.GetProductById(x.ProductId);
+ if (product != null)
+ m.ProductName = product.Name;
+
+ result.Add(m);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = result,
+ Total = items.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportOrderPeriodList(DataSourceRequest command)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var model = await GetReportOrderPeriodModel();
+ var gridModel = new DataSourceResult {
+ Data = model,
+ Total = model.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportOrderTimeChart(DataSourceRequest command, DateTime? startDate,
+ DateTime? endDate)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var model = await _orderReportService.GetOrderByTimeReport(storeId, startDate, endDate);
+ var gridModel = new DataSourceResult {
+ Data = model
+ };
+ return Json(gridModel);
+ }
+
+ public IActionResult NeverSoldReport()
+ {
+ var model = new NeverSoldReportModel();
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> NeverSoldReportList(DataSourceRequest command, NeverSoldReportModel model)
+ {
+ DateTime? startDateValue = model.StartDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
+
+ DateTime? endDateValue = model.EndDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.EndDate.Value, _dateTimeService.CurrentTimeZone).AddDays(1);
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var items = await _orderReportService.ProductsNeverSold(storeId, "",
+ startDateValue, endDateValue,
+ command.Page - 1, command.PageSize, true);
+ var gridModel = new DataSourceResult {
+ Data = items.Select(x =>
+ new NeverSoldReportLineModel {
+ ProductId = x.Id,
+ ProductName = x.Name
+ }),
+ Total = items.TotalCount
+ };
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> OrderAverageReportList(DataSourceRequest command)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var report = new List<OrderAverageReportLineSummary> {
+ await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Pending),
+ await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Processing),
+ await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Complete),
+ await _orderReportService.OrderAverageReport(storeId, (int)OrderStatusSystem.Cancelled)
+ };
+
+ var statuses = await _orderStatusService.GetAll();
+ var model = new List<OrderAverageReportLineSummaryModel>();
+ foreach (var x in report.ToList())
+ model.Add(new OrderAverageReportLineSummaryModel {
+ OrderStatus = statuses.FirstOrDefault(y => y.StatusId == x.OrderStatus)?.Name,
+ SumTodayOrders =
+ _priceFormatter.FormatPrice(x.SumTodayOrders, await _currencyService.GetPrimaryStoreCurrency()),
+ SumThisWeekOrders = _priceFormatter.FormatPrice(x.SumThisWeekOrders,
+ await _currencyService.GetPrimaryStoreCurrency()),
+ SumThisMonthOrders = _priceFormatter.FormatPrice(x.SumThisMonthOrders,
+ await _currencyService.GetPrimaryStoreCurrency()),
+ SumThisYearOrders = _priceFormatter.FormatPrice(x.SumThisYearOrders,
+ await _currencyService.GetPrimaryStoreCurrency()),
+ SumAllTimeOrders = _priceFormatter.FormatPrice(x.SumAllTimeOrders,
+ await _currencyService.GetPrimaryStoreCurrency())
+ });
+ var gridModel = new DataSourceResult {
+ Data = model,
+ Total = model.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportLatestOrder(DataSourceRequest command, DateTime? startDate,
+ DateTime? endDate)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ //load orders
+ var orders = await _orderService.SearchOrders(
+ storeId,
+ createdFromUtc: startDate,
+ createdToUtc: endDate,
+ pageIndex: command.Page - 1,
+ pageSize: command.PageSize);
+
+ var statuses = await _orderStatusService.GetAll();
+
+ var items = new List<OrderModel>();
+ foreach (var x in orders)
+ {
+ var store = await _storeService.GetStoreById(x.StoreId);
+ items.Add(new OrderModel {
+ Id = x.Id,
+ OrderNumber = x.OrderNumber,
+ StoreName = store != null ? store.Shortcut : "Unknown",
+ OrderTotal =
+ _priceFormatter.FormatPrice(x.OrderTotal, await _currencyService.GetPrimaryStoreCurrency()),
+ OrderStatus = statuses.FirstOrDefault(y => y.StatusId == x.OrderStatusId)?.Name,
+ PaymentStatus = _enumTranslationService.GetTranslationEnum(x.PaymentStatusId),
+ ShippingStatus = _enumTranslationService.GetTranslationEnum(x.ShippingStatusId),
+ CustomerEmail = x.BillingAddress.Email,
+ CustomerFullName = $"{x.BillingAddress.FirstName} {x.BillingAddress.LastName}",
+ CreatedOn = _dateTimeService.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc)
+ });
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = items,
+ Total = orders.TotalCount
+ };
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> OrderIncompleteReportList(DataSourceRequest command)
+ {
+ if (!await _permissionService.Authorize(StandardPermission.ManageOrders))
+ return Content("");
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var model = new List<OrderIncompleteReportLineModel>();
+ //not paid
+ var psPending =
+ await _orderReportService.GetOrderAverageReportLine(storeId, ps: PaymentStatus.Pending,
+ ignoreCancelledOrders: true);
+ model.Add(new OrderIncompleteReportLineModel {
+ Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalUnpaidOrders"),
+ Count = psPending.CountOrders,
+ Total = _priceFormatter.FormatPrice(psPending.SumOrders, await _currencyService.GetPrimaryStoreCurrency()),
+ ViewLink = Url.Action("List", "Order",
+ new { paymentStatusId = ((int)PaymentStatus.Pending).ToString(), area = Constants.AreaStore })
+ });
+ //not shipped
+ var ssPending =
+ await _orderReportService.GetOrderAverageReportLine(storeId, ss: ShippingStatus.Pending,
+ ignoreCancelledOrders: true);
+ model.Add(new OrderIncompleteReportLineModel {
+ Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalNotShippedOrders"),
+ Count = ssPending.CountOrders,
+ Total = _priceFormatter.FormatPrice(ssPending.SumOrders, await _currencyService.GetPrimaryStoreCurrency()),
+ ViewLink = Url.Action("List", "Order",
+ new { shippingStatusId = ((int)ShippingStatus.Pending).ToString(), area = Constants.AreaStore })
+ });
+ //pending
+ var osPending = await _orderReportService.GetOrderAverageReportLine(storeId, os: (int)OrderStatusSystem.Pending,
+ ignoreCancelledOrders: true);
+ model.Add(new OrderIncompleteReportLineModel {
+ Item = _translationService.GetResource("Admin.Reports.Incomplete.TotalIncompleteOrders"),
+ Count = osPending.CountOrders,
+ Total = _priceFormatter.FormatPrice(osPending.SumOrders, await _currencyService.GetPrimaryStoreCurrency()),
+ ViewLink = Url.Action("List", "Order",
+ new { orderStatusId = ((int)OrderStatusSystem.Pending).ToString(), area = Constants.AreaStore })
+ });
+
+ var gridModel = new DataSourceResult {
+ Data = model,
+ Total = model.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ public async Task<IActionResult> CountryReport()
+ {
+ var status = await _orderStatusService.GetAll();
+ var model = new CountryReportModel {
+ //order statuses
+ AvailableOrderStatuses =
+ status.Select(x => new SelectListItem { Value = x.StatusId.ToString(), Text = x.Name }).ToList()
+ };
+
+ model.AvailableOrderStatuses.Insert(0,
+ new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+
+ //payment statuses
+ model.AvailablePaymentStatuses = _enumTranslationService.ToSelectList(PaymentStatus.Pending, false).ToList();
+ model.AvailablePaymentStatuses.Insert(0,
+ new SelectListItem { Text = _translationService.GetResource("Admin.Common.All"), Value = "" });
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> CountryReportList(DataSourceRequest command, CountryReportModel model)
+ {
+ DateTime? startDateValue = model.StartDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.StartDate.Value, _dateTimeService.CurrentTimeZone);
+
+ DateTime? endDateValue = model.EndDate == null
+ ? null
+ : _dateTimeService.ConvertToUtcTime(model.EndDate.Value, _dateTimeService.CurrentTimeZone).AddDays(1);
+
+ int? orderStatus = model.OrderStatusId > 0 ? model.OrderStatusId : null;
+ var paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)model.PaymentStatusId : null;
+
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var items = await _orderReportService.GetCountryReport(
+ storeId,
+ os: orderStatus,
+ ps: paymentStatus,
+ startTimeUtc: startDateValue,
+ endTimeUtc: endDateValue);
+ var result = new List<CountryReportLineModel>();
+ foreach (var x in items)
+ {
+ var country = await _countryService.GetCountryById(!string.IsNullOrEmpty(x.CountryId) ? x.CountryId : "");
+ var m = new CountryReportLineModel {
+ CountryName = country != null ? country.Name : "Unknown",
+ SumOrders = _priceFormatter.FormatPrice(x.SumOrders, await _currencyService.GetPrimaryStoreCurrency()),
+ TotalOrders = x.TotalOrders
+ };
+ result.Add(m);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = result,
+ Total = items.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ #region Low stock reports
+
+ public IActionResult LowStockReport()
+ {
+ return View();
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> LowStockReportList(DataSourceRequest command)
+ {
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var lowStockProducts = await _productsReportService.LowStockProducts(storeId: storeId);
+
+ var models = new List<LowStockProductModel>();
+ //products
+ foreach (var product in lowStockProducts.products)
+ {
+ var lowStockModel = new LowStockProductModel {
+ Id = product.Id,
+ Name = product.Name,
+ ManageInventoryMethod = _enumTranslationService.GetTranslationEnum(product.ManageInventoryMethodId),
+ StockQuantity = _stockQuantityService.GetTotalStockQuantity(product, total: true),
+ Published = product.Published
+ };
+ models.Add(lowStockModel);
+ }
+
+ //combinations
+ foreach (var combination in lowStockProducts.combinations)
+ {
+ var product = await _productService.GetProductById(combination.ProductId);
+ var lowStockModel = new LowStockProductModel {
+ Id = product.Id,
+ Name = product.Name,
+ Attributes = await _productAttributeFormatter.FormatAttributes(product, combination.Attributes,
+ _contextAccessor.WorkContext.CurrentCustomer, "<br />", true, true, true, false),
+ ManageInventoryMethod = _enumTranslationService.GetTranslationEnum(product.ManageInventoryMethodId),
+ StockQuantity = combination.StockQuantity,
+ Published = product.Published
+ };
+ models.Add(lowStockModel);
+ }
+
+ var gridModel = new DataSourceResult {
+ Data = models.PagedForCommand(command),
+ Total = models.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ #endregion
+
+ #region Customer Reports
+
+ public async Task<IActionResult> Customer()
+ {
+ var model = await _customerReportViewModelService.PrepareCustomerReportsModel();
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportBestCustomersByOrderTotalList(DataSourceRequest command,
+ BestCustomersReportModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var (bestCustomerReportLineModels, totalCount) =
+ await _customerReportViewModelService.PrepareBestCustomerReportLineModel(model, 1, command.Page,
+ command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = bestCustomerReportLineModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportBestCustomersByNumberOfOrdersList(DataSourceRequest command,
+ BestCustomersReportModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var (bestCustomerReportLineModels, totalCount) =
+ await _customerReportViewModelService.PrepareBestCustomerReportLineModel(model, 2, command.Page,
+ command.PageSize);
+ var gridModel = new DataSourceResult {
+ Data = bestCustomerReportLineModels.ToList(),
+ Total = totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportRegisteredCustomersList(DataSourceRequest command)
+ {
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var model = await _customerReportViewModelService.GetReportRegisteredCustomersModel(storeId);
+ var gridModel = new DataSourceResult {
+ Data = model,
+ Total = model.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [HttpPost]
+ public async Task<IActionResult> ReportCustomerTimeChart(DataSourceRequest command, DateTime? startDate,
+ DateTime? endDate)
+ {
+ var storeId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ var model = await _customerReportService.GetCustomerByTimeReport(storeId, startDate, endDate);
+ var gridModel = new DataSourceResult {
+ Data = model
+ };
+ return Json(gridModel);
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/SearchController.cs b/src/Web/Grand.Web.Store/Controllers/SearchController.cs
new file mode 100644
index 000000000..992e0c5ed
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/SearchController.cs
@@ -0,0 +1,73 @@
+using Grand.Business.Core.Interfaces.Catalog.Brands;
+using Grand.Business.Core.Interfaces.Catalog.Categories;
+using Grand.Business.Core.Interfaces.Catalog.Collections;
+using Grand.Domain.Admin;
+using Grand.Infrastructure;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Helpers;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+public class SearchController : BaseStoreController
+{
+ private readonly AdminSearchSettings _adminSearchSettings;
+ private readonly IBrandService _brandService;
+ private readonly ICategoryService _categoryService;
+ private readonly ICollectionService _collectionService;
+ private readonly IContextAccessor _contextAccessor;
+
+ public SearchController(ICategoryService categoryService,
+ IBrandService brandService, ICollectionService collectionService,
+ AdminSearchSettings adminSearchSettings, IContextAccessor contextAccessor)
+ {
+ _categoryService = categoryService;
+ _brandService = brandService;
+ _collectionService = collectionService;
+ _adminSearchSettings = adminSearchSettings;
+ _contextAccessor = contextAccessor;
+ }
+
+ [HttpGet]
+ public async Task<IActionResult> Category(string categoryId, DataSourceRequestFilter model)
+ {
+ var categories = await _categoryService.GetAllCategories(
+ parentId: null,
+ categoryName: model.GetNameFilterValue(),
+ storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId,
+ pageIndex: 0,
+ pageSize: _adminSearchSettings.CategorySizeLimit,
+ showHidden: false
+ );
+
+ var gridModel = await DataSourceResultHelper.GetSearchResult(categoryId, categories, async category => await _categoryService.GetFormattedBreadCrumb(category));
+ return Json(gridModel);
+ }
+
+ [HttpGet]
+ public async Task<IActionResult> Collection(string collectionId, DataSourceRequestFilter model)
+ {
+ var collections = await _collectionService.GetAllCollections(
+ collectionName: model.GetNameFilterValue(),
+ storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId,
+ pageIndex: 0,
+ pageSize: _adminSearchSettings.CollectionSizeLimit,
+ showHidden: false
+ );
+
+ var gridModel = await DataSourceResultHelper.GetSearchResult(collectionId, collections, collection => Task.FromResult(collection.Name));
+ return Json(gridModel);
+ }
+
+ [HttpGet]
+ public async Task<IActionResult> Brand(string brandId, DataSourceRequestFilter model)
+ {
+ var brands = await _brandService.GetAllBrands(
+ model.GetNameFilterValue(),
+ storeId: _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId,
+ pageSize: _adminSearchSettings.BrandSizeLimit);
+
+ var gridModel = await DataSourceResultHelper.GetSearchResult(brandId, brands, brand => Task.FromResult(brand.Name));
+ return Json(gridModel);
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Store/Controllers/ShipmentController.cs
new file mode 100644
index 000000000..eb3ea3fae
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Controllers/ShipmentController.cs
@@ -0,0 +1,630 @@
+using Grand.Business.Core.Commands.Checkout.Shipping;
+using Grand.Business.Core.Interfaces.Checkout.Orders;
+using Grand.Business.Core.Interfaces.Checkout.Shipping;
+using Grand.Business.Core.Interfaces.Common.Directory;
+using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Business.Core.Interfaces.Common.Pdf;
+using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
+using Grand.Domain.Shipping;
+using Grand.Infrastructure;
+using Grand.Web.AdminShared.Interfaces;
+using Grand.Web.AdminShared.Models.Orders;
+using Grand.Web.Common.DataSource;
+using Grand.Web.Common.Extensions;
+using Grand.Web.Common.Filters;
+using Grand.Web.Common.Security.Authorization;
+using MediatR;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Grand.Web.Store.Controllers;
+
+[PermissionAuthorize(PermissionSystemName.Shipments)]
+public class ShipmentController : BaseStoreController
+{
+ public ShipmentController(
+ IShipmentViewModelService shipmentViewModelService,
+ IOrderService orderService,
+ ITranslationService translationService,
+ IContextAccessor contextAccessor,
+ IPdfService pdfService,
+ IShipmentService shipmentService,
+ IDateTimeService dateTimeService,
+ IMediator mediator)
+ {
+ _shipmentViewModelService = shipmentViewModelService;
+ _orderService = orderService;
+ _translationService = translationService;
+ _contextAccessor = contextAccessor;
+ _pdfService = pdfService;
+ _shipmentService = shipmentService;
+ _dateTimeService = dateTimeService;
+ _mediator = mediator;
+ }
+
+ #region Fields
+
+ private readonly IShipmentViewModelService _shipmentViewModelService;
+ private readonly IOrderService _orderService;
+ private readonly ITranslationService _translationService;
+ private readonly IContextAccessor _contextAccessor;
+ private readonly IPdfService _pdfService;
+ private readonly IShipmentService _shipmentService;
+ private readonly IDateTimeService _dateTimeService;
+ private readonly IMediator _mediator;
+
+ #endregion
+
+ #region Shipments
+
+ public async Task<IActionResult> List()
+ {
+ var model = await _shipmentViewModelService.PrepareShipmentListModel();
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> ShipmentListSelect(DataSourceRequest command, ShipmentListModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+ var shipments = await _shipmentViewModelService.PrepareShipments(model, command.Page, command.PageSize);
+ var items = new List<ShipmentModel>();
+ foreach (var item in shipments.shipments)
+ items.Add(await _shipmentViewModelService.PrepareShipmentModel(item, false));
+
+ var gridModel = new DataSourceResult {
+ Data = items,
+ Total = shipments.totalCount
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> ShipmentsByOrder(string orderId, DataSourceRequest command)
+ {
+ var order = await _orderService.GetOrderById(orderId) ?? throw new ArgumentException("No order found with the specified id");
+ if (order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return Content("");
+
+ //shipments
+ var shipmentModels = new List<ShipmentModel>();
+ var shipments = (await _shipmentService.GetShipmentsByOrder(orderId))
+ .OrderBy(s => s.CreatedOnUtc)
+ .ToList();
+ foreach (var shipment in shipments)
+ shipmentModels.Add(await _shipmentViewModelService.PrepareShipmentModel(shipment, false));
+
+ var gridModel = new DataSourceResult {
+ Data = shipmentModels,
+ Total = shipmentModels.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.List)]
+ [HttpPost]
+ public async Task<IActionResult> ShipmentsItemsByShipmentId(string shipmentId, DataSourceRequest command)
+ {
+ var shipment = await _shipmentService.GetShipmentById(shipmentId) ?? throw new ArgumentException("No shipment found with the specified id");
+ var order = await _orderService.GetOrderById(shipment.OrderId) ?? throw new ArgumentException("No order found with the specified id");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return Content("");
+
+ //shipments
+ var shipmentModel = await _shipmentViewModelService.PrepareShipmentModel(shipment, true);
+ var gridModel = new DataSourceResult {
+ Data = shipmentModel.Items,
+ Total = shipmentModel.Items.Count
+ };
+
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Create)]
+ public async Task<IActionResult> AddShipment(string orderId)
+ {
+ var order = await _orderService.GetOrderById(orderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var model = await _shipmentViewModelService.PrepareShipmentModel(order);
+
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ [ArgumentNameFilter(KeyName = "save-continue", Argument = "continueEditing")]
+ public async Task<IActionResult> AddShipment(AddShipmentModel model, bool continueEditing)
+ {
+ var order = await _orderService.GetOrderById(model.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (order.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderItems = order.OrderItems;
+
+ var sh = await _shipmentViewModelService.PrepareShipment(order, orderItems.ToList(), model);
+ if (sh.shipment == null)
+ return RedirectToAction("AddShipment", new { orderId = model.OrderId });
+
+ var shipment = sh.shipment;
+ //check stock
+ var (valid, message) = await _shipmentViewModelService.ValidStockShipment(shipment);
+ if (!valid)
+ {
+ Error(message);
+ return RedirectToAction("AddShipment", new { orderId = model.OrderId });
+ }
+
+ //if we have at least one item in the shipment, then save it
+ if (shipment.ShipmentItems.Count > 0)
+ {
+ shipment.TotalWeight = sh.totalWeight;
+ await _shipmentService.InsertShipment(shipment);
+
+ //add a note
+ await _orderService.InsertOrderNote(new OrderNote {
+ Note = $"A shipment #{shipment.ShipmentNumber} has been added",
+ DisplayToCustomer = false,
+ OrderId = order.Id
+ });
+
+ Success(_translationService.GetResource("Admin.Orders.Shipments.Added"));
+ return continueEditing
+ ? RedirectToAction("ShipmentDetails", new { id = shipment.Id })
+ : RedirectToAction("List", new { id = shipment.Id });
+ }
+
+ Error(_translationService.GetResource("Admin.Orders.Shipments.NoProductsSelected"));
+ return RedirectToAction("AddShipment", new { orderId = model.OrderId });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> ShipmentDetails(string id)
+ {
+ var shipment = await _shipmentService.GetShipmentById(id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderId = shipment.OrderId;
+ var order = await _orderService.GetOrderById(orderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ var model = await _shipmentViewModelService.PrepareShipmentModel(shipment, true, true);
+ return View(model);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> DeleteShipment(string id)
+ {
+ var shipment = await _shipmentService.GetShipmentById(id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var orderId = shipment.OrderId;
+ var order = await _orderService.GetOrderById(orderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ //delete shipment
+ await _shipmentService.DeleteShipment(shipment);
+
+ //add a note
+ await _orderService.InsertOrderNote(new OrderNote {
+ Note = $"A shipment #{shipment.ShipmentNumber} has been deleted",
+ DisplayToCustomer = false,
+ OrderId = order.Id
+ });
+
+ Success(_translationService.GetResource("Admin.Orders.Shipments.Deleted"));
+
+ return RedirectToAction("Edit", "Order", new { order.Id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetTrackingNumber(ShipmentModel model)
+ {
+ var shipment = await _shipmentService.GetShipmentById(model.Id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ shipment.TrackingNumber = model.TrackingNumber;
+ await _shipmentService.UpdateShipment(shipment);
+
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetShipmentAdminComment(ShipmentModel model)
+ {
+ var shipment = await _shipmentService.GetShipmentById(model.Id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ shipment.AdminComment = model.AdminComment;
+ await _shipmentService.UpdateShipment(shipment);
+
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetAsShipped(string id)
+ {
+ var shipment = await _shipmentService.GetShipmentById(id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+ try
+ {
+ await _mediator.Send(new ShipCommand { Shipment = shipment, NotifyCustomer = true });
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> EditShippedDate(ShipmentModel model)
+ {
+ var shipment = await _shipmentService.GetShipmentById(model.Id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+ try
+ {
+ if (!model.ShippedDate.HasValue) throw new Exception("Enter shipped date");
+
+ shipment.ShippedDateUtc = model.ShippedDate.ConvertToUtcTime(_dateTimeService);
+ await _shipmentService.UpdateShipment(shipment);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetAsDelivered(string id)
+ {
+ var shipment = await _shipmentService.GetShipmentById(id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ try
+ {
+ await _mediator.Send(new DeliveryCommand { Shipment = shipment, NotifyCustomer = true });
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ }
+
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> EditDeliveryDate(ShipmentModel model)
+ {
+ var shipment = await _shipmentService.GetShipmentById(model.Id);
+ if (shipment == null)
+ //No shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ try
+ {
+ if (!model.DeliveryDate.HasValue) throw new Exception("Enter delivery date");
+
+ shipment.DeliveryDateUtc = model.DeliveryDate.ConvertToUtcTime(_dateTimeService);
+ await _shipmentService.UpdateShipment(shipment);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ catch (Exception exc)
+ {
+ //error
+ Error(exc);
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> EditUserFields(string id, ShipmentModel model)
+ {
+ var shipment = await _shipmentService.GetShipmentById(id);
+ if (shipment == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+
+ shipment.UserFields = model.UserFields;
+ await _shipmentService.UpdateShipment(shipment);
+
+ //selected tab
+ await SaveSelectedTabIndex();
+
+ return RedirectToAction("ShipmentDetails", new { id = shipment.Id });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ public async Task<IActionResult> PdfPackagingSlip(string shipmentId)
+ {
+ var shipment = await _shipmentService.GetShipmentById(shipmentId);
+ if (shipment == null)
+ //no shipment found with the specified id
+ return RedirectToAction("List");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return RedirectToAction("List");
+
+ var order = await _orderService.GetOrderById(shipment.OrderId);
+ if (order == null)
+ //No order found with the specified id
+ return RedirectToAction("List");
+
+ var shipments = new List<Shipment> {
+ shipment
+ };
+
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await _pdfService.PrintPackagingSlipsToPdf(stream, shipments, _contextAccessor.WorkContext.WorkingLanguage.Id);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", $"packagingslip_{shipment.Id}.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Export)]
+ [HttpPost]
+ public async Task<IActionResult> PdfPackagingSlipAll(ShipmentListModel model)
+ {
+ model.StoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId;
+
+ //load shipments
+ var shipments = await _shipmentViewModelService.PrepareShipments(model, 1, 100);
+
+ //ensure that we at least one shipment selected
+ if (shipments.totalCount == 0)
+ {
+ Error(_translationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected"));
+ return RedirectToAction("List");
+ }
+
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await _pdfService.PrintPackagingSlipsToPdf(stream, shipments.shipments.ToList(),
+ _contextAccessor.WorkContext.WorkingLanguage.Id);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", "packagingslips.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Export)]
+ [HttpPost]
+ public async Task<IActionResult> PdfPackagingSlipSelected(string selectedIds)
+ {
+ var shipments = new List<Shipment>();
+ var shipments_access = new List<Shipment>();
+ if (selectedIds != null)
+ {
+ var ids = selectedIds
+ .Split([','], StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => x)
+ .ToArray();
+ shipments.AddRange(await _shipmentService.GetShipmentsByIds(ids));
+ }
+
+ shipments_access = shipments.Where(x => x.StoreId == _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
+ //ensure that we at least one shipment selected
+ if (shipments.Count == 0)
+ {
+ Error(_translationService.GetResource("Admin.Orders.Shipments.NoShipmentsSelected"));
+ return RedirectToAction("List");
+ }
+
+ byte[] bytes;
+ using (var stream = new MemoryStream())
+ {
+ await _pdfService.PrintPackagingSlipsToPdf(stream, shipments_access, _contextAccessor.WorkContext.WorkingLanguage.Id);
+ bytes = stream.ToArray();
+ }
+
+ return File(bytes, "application/pdf", "packagingslips.pdf");
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetAsShippedSelected(ICollection<string> selectedIds)
+ {
+ var shipments = new List<Shipment>();
+ var shipments_access = new List<Shipment>();
+ if (selectedIds != null) shipments.AddRange(await _shipmentService.GetShipmentsByIds(selectedIds.ToArray()));
+
+ shipments_access = shipments.Where(x => x.StoreId == _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
+ foreach (var shipment in shipments_access)
+ try
+ {
+ await _mediator.Send(new ShipCommand { Shipment = shipment, NotifyCustomer = true });
+ }
+ catch
+ {
+ //ignore any exception
+ }
+
+ return Json(new { Result = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ [HttpPost]
+ public async Task<IActionResult> SetAsDeliveredSelected(ICollection<string> selectedIds)
+ {
+ var shipments = new List<Shipment>();
+ var shipments_access = new List<Shipment>();
+ if (selectedIds != null) shipments.AddRange(await _shipmentService.GetShipmentsByIds(selectedIds.ToArray()));
+
+ shipments_access = shipments.Where(x => x.StoreId == _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId).ToList();
+ foreach (var shipment in shipments_access)
+ try
+ {
+ await _mediator.Send(new DeliveryCommand { Shipment = shipment, NotifyCustomer = true });
+ }
+ catch
+ {
+ //ignore any exception
+ }
+
+ return Json(new { Result = true });
+ }
+
+ #region Shipment notes
+
+ [PermissionAuthorizeAction(PermissionActionName.Preview)]
+ [HttpPost]
+ public async Task<IActionResult> ShipmentNotesSelect(string shipmentId, DataSourceRequest command)
+ {
+ var shipment = await _shipmentService.GetShipmentById(shipmentId);
+ if (shipment == null)
+ throw new ArgumentException("No shipment found with the specified id");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return Content("");
+
+ //shipment notes
+ var shipmentNoteModels = await _shipmentViewModelService.PrepareShipmentNotes(shipment);
+ var gridModel = new DataSourceResult {
+ Data = shipmentNoteModels,
+ Total = shipmentNoteModels.Count
+ };
+ return Json(gridModel);
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Edit)]
+ public async Task<IActionResult> ShipmentNoteAdd(string shipmentId, string downloadId, bool displayToCustomer,
+ string message)
+ {
+ var shipment = await _shipmentService.GetShipmentById(shipmentId);
+ if (shipment == null)
+ return Json(new { Result = false });
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return Json(new { Result = false });
+
+ await _shipmentViewModelService.InsertShipmentNote(shipment, downloadId, displayToCustomer, message);
+
+ return Json(new { Result = true });
+ }
+
+ [PermissionAuthorizeAction(PermissionActionName.Delete)]
+ [HttpPost]
+ public async Task<IActionResult> ShipmentNoteDelete(string id, string shipmentId)
+ {
+ var shipment = await _shipmentService.GetShipmentById(shipmentId);
+ if (shipment == null)
+ throw new ArgumentException("No shipment found with the specified id");
+
+ if (shipment.StoreId != _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId)
+ return Json(new { Result = false });
+
+ await _shipmentViewModelService.DeleteShipmentNote(shipment, id);
+
+ return new JsonResult("");
+ }
+
+ #endregion
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Endpoints/EndpointProvider.cs b/src/Web/Grand.Web.Store/Endpoints/EndpointProvider.cs
new file mode 100644
index 000000000..f13fb398e
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Endpoints/EndpointProvider.cs
@@ -0,0 +1,26 @@
+using Grand.Infrastructure.Endpoints;
+using Grand.Web.Store.Extensions;
+
+namespace Grand.Web.Store.Endpoints;
+
+public class EndpointProvider : IEndpointProvider
+{
+ public void RegisterEndpoint(IEndpointRouteBuilder endpointRouteBuilder)
+ {
+ //area vendor
+ endpointRouteBuilder.MapAreaControllerRoute(
+ "storeareas",
+ Constants.AreaStore,
+ $"{Constants.AreaStore}/{{controller=Home}}/{{action=Index}}/{{id?}}");
+
+ //store index
+ endpointRouteBuilder.MapControllerRoute("StoreIndex", "store/",
+ new { controller = "Home", action = "Index", area = Constants.AreaStore });
+
+ //store login
+ endpointRouteBuilder.MapControllerRoute("StoreLogin", "store/login/",
+ new { controller = "Login", action = "Index", area = Constants.AreaStore });
+ }
+
+ public int Priority => 10;
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Extensions/Constants.cs b/src/Web/Grand.Web.Store/Extensions/Constants.cs
new file mode 100644
index 000000000..219f2eec7
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Extensions/Constants.cs
@@ -0,0 +1,8 @@
+namespace Grand.Web.Store.Extensions;
+
+public static class Constants
+{
+ public const string AreaStore = "Store";
+ public static string LayoutStore => $"~/Areas/{AreaStore}/Views/Shared/_StoreLayout.cshtml";
+ public static string LayoutStoreLogin => $"~/Areas/{AreaStore}/Views/Shared/_StoreLoginLayout.cshtml";
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Grand.Web.Store.csproj b/src/Web/Grand.Web.Store/Grand.Web.Store.csproj
new file mode 100644
index 000000000..91d032643
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Grand.Web.Store.csproj
@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+ <Import Project="..\..\Build\Grand.Common.props" />
+ <PropertyGroup>
+ <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
+ <ServerGarbageCollection>true</ServerGarbageCollection>
+ <GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
+ <EnableDefaultContentItems>false</EnableDefaultContentItems>
+ <UseAppHost>false</UseAppHost>
+ <!--Set GenerateRuntimeConfigurationFiles as true when Admin panel is supposed to works independent-->
+ <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
+ <CompressionEnabled>false</CompressionEnabled>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="Areas\**" CopyToPublishDirectory="Never" />
+ <Content Include="wwwroot\**" CopyToPublishDirectory="PreserveNewest" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Aspire\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj" />
+ <ProjectReference Include="..\..\Business\Grand.Business.Core\Grand.Business.Core.csproj" />
+ <ProjectReference Include="..\..\Core\Grand.Domain\Grand.Domain.csproj" />
+ <ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
+ <ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
+ <ProjectReference Include="..\Grand.SharedUIResources\Grand.SharedUIResources.csproj" />
+ <ProjectReference Include="..\Grand.Web.AdminShared\Grand.Web.AdminShared.csproj" />
+ </ItemGroup>
+</Project>
diff --git a/src/Web/Grand.Web.Store/Infrastructure/StoreAreaViewFactory.cs b/src/Web/Grand.Web.Store/Infrastructure/StoreAreaViewFactory.cs
new file mode 100644
index 000000000..aa38d1657
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Infrastructure/StoreAreaViewFactory.cs
@@ -0,0 +1,35 @@
+using Grand.Web.Store.Extensions;
+using Grand.Web.Common.Themes;
+using Grand.Web.Common.View;
+
+namespace Grand.Web.Admin.Infrastructure;
+
+public class StoreAreaViewFactory : IAreaViewFactory
+{
+ private readonly IThemeContext _themeContext;
+
+ public StoreAreaViewFactory(IThemeContextFactory themeContextFactory)
+ {
+ _themeContext = themeContextFactory.GetThemeContext(AreaName);
+ }
+
+ public string AreaName => Constants.AreaStore;
+
+ public IEnumerable<string> GetViewLocations(IEnumerable<string> viewLocations)
+ {
+ var themeName = _themeContext?.GetCurrentTheme();
+
+ var basicViewLocations = new[] {
+ $"/Areas/{AreaName}/Views/{{1}}/{{0}}.cshtml",
+ $"/Areas/{AreaName}/Views/Shared/{{0}}.cshtml"
+ };
+ if (string.IsNullOrWhiteSpace(themeName)) return basicViewLocations;
+
+ var themeViewLocations = new[] {
+ $"/Areas/{AreaName}/Themes/{themeName}/Views/{{1}}/{{0}}.cshtml",
+ $"/Areas/{AreaName}/Themes/{themeName}/Views/Shared/{{0}}.cshtml"
+ };
+
+ return themeViewLocations.Concat(basicViewLocations);
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Infrastructure/StoreThemeContext.cs b/src/Web/Grand.Web.Store/Infrastructure/StoreThemeContext.cs
new file mode 100644
index 000000000..d2b684d87
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Infrastructure/StoreThemeContext.cs
@@ -0,0 +1,37 @@
+using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Domain.Stores;
+using Grand.Web.Store.Extensions;
+using Grand.Web.Common.Themes;
+
+namespace Grand.Web.Admin.Infrastructure;
+
+public class StoreThemeContext : ThemeContextBase
+{
+ private readonly IHttpContextAccessor _contextAccessor;
+ private readonly StoreInformationSettings _storeInformationSettings;
+ private string _themeName;
+
+ public StoreThemeContext(IHttpContextAccessor contextAccessor, ICookieOptionsFactory cookieOptionsFactory,StoreInformationSettings storeInformationSettings) :
+ base(contextAccessor, cookieOptionsFactory)
+ {
+ _storeInformationSettings = storeInformationSettings;
+ _contextAccessor = contextAccessor;
+ }
+
+ public override string AreaName => Constants.AreaStore;
+
+ public override string GetCurrentTheme()
+ {
+ if (!string.IsNullOrEmpty(_themeName))
+ return _themeName;
+
+ var theme = "";
+ if (_storeInformationSettings.AllowToSelectAdminTheme)
+ theme = _contextAccessor.HttpContext?.Request.Cookies[CookiesName];
+ //default store theme
+ if (string.IsNullOrEmpty(theme))
+ theme = _storeInformationSettings.DefaultStoreTheme;
+
+ return _themeName = theme;
+ }
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Models/Cms/StorePortalModel.cs b/src/Web/Grand.Web.Store/Models/Cms/StorePortalModel.cs
new file mode 100644
index 000000000..f368e80f5
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Models/Cms/StorePortalModel.cs
@@ -0,0 +1,3 @@
+namespace Grand.Web.Store.Models.Common;
+
+public record StorePortalModel(string Title, string Body);
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Program.cs b/src/Web/Grand.Web.Store/Program.cs
new file mode 100644
index 000000000..7c7c724ba
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Program.cs
@@ -0,0 +1,29 @@
+using Grand.Web.Common.Extensions;
+using StartupBase = Grand.Infrastructure.StartupBase;
+
+var builder = WebApplication.CreateBuilder(args);
+
+//add configuration
+builder.Configuration.AddAppSettingsJsonFile(args);
+
+builder.AddServiceDefaults();
+
+builder.Host.UseDefaultServiceProvider((_, options) =>
+{
+ options.ValidateScopes = false;
+ options.ValidateOnBuild = false;
+});
+
+//add services
+StartupBase.ConfigureServices(builder.Services, builder.Configuration);
+
+builder.ConfigureApplicationSettings();
+
+//build app
+var app = builder.Build();
+
+//request pipeline
+StartupBase.ConfigureRequestPipeline(app, builder.Environment);
+
+//run app
+await app.RunAsync();
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Store/Properties/launchSettings.json b/src/Web/Grand.Web.Store/Properties/launchSettings.json
new file mode 100644
index 000000000..0be1953f9
--- /dev/null
+++ b/src/Web/Grand.Web.Store/Properties/launchSettings.json
@@ -0,0 +1,23 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5255",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:7083;http://localhost:5255",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ad.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ad.png
new file mode 100644
index 000000000..0df590b2a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ad.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ae.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ae.png
new file mode 100644
index 000000000..82038d3f0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ae.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/af.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/af.png
new file mode 100644
index 000000000..2697219cf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/af.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ag.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ag.png
new file mode 100644
index 000000000..70e16d86d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ag.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ai.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ai.png
new file mode 100644
index 000000000..af38c2048
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ai.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/al.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/al.png
new file mode 100644
index 000000000..69d48cafc
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/al.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/am.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/am.png
new file mode 100644
index 000000000..87d1195f9
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/am.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/an.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/an.png
new file mode 100644
index 000000000..03f81feaa
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/an.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ao.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ao.png
new file mode 100644
index 000000000..3d3097d81
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ao.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ar.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ar.png
new file mode 100644
index 000000000..bfbc20785
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ar.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/as.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/as.png
new file mode 100644
index 000000000..79fed482d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/as.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/at.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/at.png
new file mode 100644
index 000000000..a101d8010
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/at.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/au.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/au.png
new file mode 100644
index 000000000..8995c934c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/au.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/aw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/aw.png
new file mode 100644
index 000000000..5e1a5691e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/aw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ax.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ax.png
new file mode 100644
index 000000000..a68f9eb64
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ax.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/az.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/az.png
new file mode 100644
index 000000000..50af7608b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/az.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ba.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ba.png
new file mode 100644
index 000000000..75d0a728a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ba.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bb.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bb.png
new file mode 100644
index 000000000..afe41c7dd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bb.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bd.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bd.png
new file mode 100644
index 000000000..40f83f97a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bd.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/be.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/be.png
new file mode 100644
index 000000000..bf1328387
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/be.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bf.png
new file mode 100644
index 000000000..554a2c3c7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bg.png
new file mode 100644
index 000000000..1ff623d09
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bh.png
new file mode 100644
index 000000000..1a18d9d8e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bi.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bi.png
new file mode 100644
index 000000000..559f714ff
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bi.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bj.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bj.png
new file mode 100644
index 000000000..4fa192aac
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bj.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bm.png
new file mode 100644
index 000000000..d0ed48983
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bn.png
new file mode 100644
index 000000000..5f55d770b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bo.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bo.png
new file mode 100644
index 000000000..0aede14fb
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bo.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/br.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/br.png
new file mode 100644
index 000000000..177de4d6c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/br.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bs.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bs.png
new file mode 100644
index 000000000..5b4d697e6
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bs.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bt.png
new file mode 100644
index 000000000..c97494ce7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bv.png
new file mode 100644
index 000000000..65ab004a2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bw.png
new file mode 100644
index 000000000..fe22a22fc
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/by.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/by.png
new file mode 100644
index 000000000..b47bc2309
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/by.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bz.png
new file mode 100644
index 000000000..ae58eee2e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/bz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ca.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ca.png
new file mode 100644
index 000000000..ac615c585
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ca.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/catalonia.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/catalonia.png
new file mode 100644
index 000000000..b6cc28c6a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/catalonia.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cc.png
new file mode 100644
index 000000000..78c9a0c41
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cd.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cd.png
new file mode 100644
index 000000000..4af27b646
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cd.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cf.png
new file mode 100644
index 000000000..20ba24d3b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cg.png
new file mode 100644
index 000000000..3bf71272b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ch.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ch.png
new file mode 100644
index 000000000..1788aef7c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ch.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ci.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ci.png
new file mode 100644
index 000000000..a0855ced1
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ci.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ck.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ck.png
new file mode 100644
index 000000000..6de371585
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ck.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cl.png
new file mode 100644
index 000000000..12568c4a7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cm.png
new file mode 100644
index 000000000..acc93f746
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cn.png
new file mode 100644
index 000000000..5eea6e89c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/co.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/co.png
new file mode 100644
index 000000000..dd6d2b9e0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/co.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cr.png
new file mode 100644
index 000000000..477eddead
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cs.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cs.png
new file mode 100644
index 000000000..7b3e2e745
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cs.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cu.png
new file mode 100644
index 000000000..7df753b22
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cv.png
new file mode 100644
index 000000000..223a757f6
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cx.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cx.png
new file mode 100644
index 000000000..7884d74f0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cx.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cy.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cy.png
new file mode 100644
index 000000000..9bd385e9f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cy.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cz.png
new file mode 100644
index 000000000..b1781dc7d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/cz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/de.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/de.png
new file mode 100644
index 000000000..9398546c1
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/de.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dj.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dj.png
new file mode 100644
index 000000000..921eb47af
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dj.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dk.png
new file mode 100644
index 000000000..5c6c213df
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dm.png
new file mode 100644
index 000000000..de3603755
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/do.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/do.png
new file mode 100644
index 000000000..d1d3ff61e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/do.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dz.png
new file mode 100644
index 000000000..06288af41
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/dz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ec.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ec.png
new file mode 100644
index 000000000..c86d542bf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ec.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ee.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ee.png
new file mode 100644
index 000000000..414399c2d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ee.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eg.png
new file mode 100644
index 000000000..93be9511d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eh.png
new file mode 100644
index 000000000..69f6410d7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/eh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/england.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/england.png
new file mode 100644
index 000000000..8e4d3feda
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/england.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/er.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/er.png
new file mode 100644
index 000000000..3f9024d78
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/er.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/es.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/es.png
new file mode 100644
index 000000000..43bb971d9
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/es.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/et.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/et.png
new file mode 100644
index 000000000..2338460cf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/et.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/europeanunion.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/europeanunion.png
new file mode 100644
index 000000000..e64b7366e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/europeanunion.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fam.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fam.png
new file mode 100644
index 000000000..de2705647
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fam.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fi.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fi.png
new file mode 100644
index 000000000..b580e5135
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fi.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fj.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fj.png
new file mode 100644
index 000000000..e970fdcc3
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fj.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fk.png
new file mode 100644
index 000000000..cbb15b685
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fm.png
new file mode 100644
index 000000000..197da1873
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fo.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fo.png
new file mode 100644
index 000000000..0c68bdc3f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fo.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fr.png
new file mode 100644
index 000000000..ff08cf2bf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/fr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ga.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ga.png
new file mode 100644
index 000000000..7956c0c91
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ga.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gb.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gb.png
new file mode 100644
index 000000000..70380da74
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gb.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gd.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gd.png
new file mode 100644
index 000000000..1f315e3db
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gd.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ge.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ge.png
new file mode 100644
index 000000000..f98b5746b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ge.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gf.png
new file mode 100644
index 000000000..ff08cf2bf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gh.png
new file mode 100644
index 000000000..bdeadd0e7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gi.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gi.png
new file mode 100644
index 000000000..22f1fc197
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gi.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gl.png
new file mode 100644
index 000000000..22a62910e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gm.png
new file mode 100644
index 000000000..dcddd25da
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gn.png
new file mode 100644
index 000000000..8451d5f67
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gp.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gp.png
new file mode 100644
index 000000000..df4b6a106
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gp.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gq.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gq.png
new file mode 100644
index 000000000..9cde8a667
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gq.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gr.png
new file mode 100644
index 000000000..02387d832
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gs.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gs.png
new file mode 100644
index 000000000..46822eac4
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gs.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gt.png
new file mode 100644
index 000000000..0edc3aa3a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gu.png
new file mode 100644
index 000000000..74de770bd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gw.png
new file mode 100644
index 000000000..9dbebaea2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gy.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gy.png
new file mode 100644
index 000000000..ffa247bc2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/gy.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hk.png
new file mode 100644
index 000000000..0722a7757
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hm.png
new file mode 100644
index 000000000..8995c934c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hn.png
new file mode 100644
index 000000000..d53026ace
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hr.png
new file mode 100644
index 000000000..a55d4d714
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ht.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ht.png
new file mode 100644
index 000000000..47f544777
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ht.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hu.png
new file mode 100644
index 000000000..277e77ae7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/hu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/id.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/id.png
new file mode 100644
index 000000000..987c1d7b0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/id.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ie.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ie.png
new file mode 100644
index 000000000..8b887f965
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ie.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/il.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/il.png
new file mode 100644
index 000000000..f18a8f2ae
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/il.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/in.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/in.png
new file mode 100644
index 000000000..1575f495e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/in.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/io.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/io.png
new file mode 100644
index 000000000..ccd88ed91
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/io.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/iq.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/iq.png
new file mode 100644
index 000000000..30b956418
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/iq.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ir.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ir.png
new file mode 100644
index 000000000..5aa4625df
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ir.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/is.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/is.png
new file mode 100644
index 000000000..73c88900b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/is.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/it.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/it.png
new file mode 100644
index 000000000..28616d238
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/it.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jm.png
new file mode 100644
index 000000000..cd86b7075
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jo.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jo.png
new file mode 100644
index 000000000..de231d84b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jo.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jp.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jp.png
new file mode 100644
index 000000000..ca7774fdc
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/jp.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ke.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ke.png
new file mode 100644
index 000000000..1e2c96de0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ke.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kg.png
new file mode 100644
index 000000000..d422cd06a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kh.png
new file mode 100644
index 000000000..6f118e50d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ki.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ki.png
new file mode 100644
index 000000000..2884a7eda
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ki.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/km.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/km.png
new file mode 100644
index 000000000..fd7905d7e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/km.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kn.png
new file mode 100644
index 000000000..8aa5eadad
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kp.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kp.png
new file mode 100644
index 000000000..ae4ad4368
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kp.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kr.png
new file mode 100644
index 000000000..13704a64a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kw.png
new file mode 100644
index 000000000..cb5177e3f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ky.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ky.png
new file mode 100644
index 000000000..cdb06c373
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ky.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kz.png
new file mode 100644
index 000000000..8d0706386
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/kz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/la.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/la.png
new file mode 100644
index 000000000..c7c57f7ec
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/la.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lb.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lb.png
new file mode 100644
index 000000000..43b6d0e2f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lb.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lc.png
new file mode 100644
index 000000000..a9a9ef29e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/li.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/li.png
new file mode 100644
index 000000000..2499e64ac
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/li.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lk.png
new file mode 100644
index 000000000..dd5d63d3d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lr.png
new file mode 100644
index 000000000..6e52a5ba3
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ls.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ls.png
new file mode 100644
index 000000000..ed627db63
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ls.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lt.png
new file mode 100644
index 000000000..4de54bdcb
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lu.png
new file mode 100644
index 000000000..ba9aa9f5f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lv.png
new file mode 100644
index 000000000..ca93d469e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/lv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ly.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ly.png
new file mode 100644
index 000000000..7c011f0f1
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ly.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ma.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ma.png
new file mode 100644
index 000000000..5fe749547
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ma.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mc.png
new file mode 100644
index 000000000..887e97152
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/md.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/md.png
new file mode 100644
index 000000000..49f39eedd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/md.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/me.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/me.png
new file mode 100644
index 000000000..75e23fc95
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/me.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mg.png
new file mode 100644
index 000000000..4bd69053f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mh.png
new file mode 100644
index 000000000..4032f864a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mk.png
new file mode 100644
index 000000000..bf7a3bad0
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ml.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ml.png
new file mode 100644
index 000000000..7769b4df3
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ml.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mm.png
new file mode 100644
index 000000000..b745f36c9
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mn.png
new file mode 100644
index 000000000..7e2aa8010
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mo.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mo.png
new file mode 100644
index 000000000..4cde9036e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mo.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mp.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mp.png
new file mode 100644
index 000000000..98c7f064f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mp.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mq.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mq.png
new file mode 100644
index 000000000..c1ac5de70
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mq.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mr.png
new file mode 100644
index 000000000..1181f9aa7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ms.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ms.png
new file mode 100644
index 000000000..20cc67e7f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ms.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mt.png
new file mode 100644
index 000000000..5feda5712
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mu.png
new file mode 100644
index 000000000..482570cd1
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mv.png
new file mode 100644
index 000000000..60b5ad9bb
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mw.png
new file mode 100644
index 000000000..d21cb8d98
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mx.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mx.png
new file mode 100644
index 000000000..9f5e5973a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mx.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/my.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/my.png
new file mode 100644
index 000000000..bd30abf88
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/my.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mz.png
new file mode 100644
index 000000000..7c1d0dce7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/mz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/na.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/na.png
new file mode 100644
index 000000000..e1d86f98f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/na.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nc.png
new file mode 100644
index 000000000..75d8f3ff5
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ne.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ne.png
new file mode 100644
index 000000000..a6060d686
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ne.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nf.png
new file mode 100644
index 000000000..fe2b39f6f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ng.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ng.png
new file mode 100644
index 000000000..f1c72d7de
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ng.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ni.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ni.png
new file mode 100644
index 000000000..66d732d5c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ni.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nl.png
new file mode 100644
index 000000000..29b34638f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/no.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/no.png
new file mode 100644
index 000000000..65ab004a2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/no.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/np.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/np.png
new file mode 100644
index 000000000..6a92e23ed
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/np.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nr.png
new file mode 100644
index 000000000..3901ca930
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nu.png
new file mode 100644
index 000000000..188c8bf17
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nz.png
new file mode 100644
index 000000000..7f5276482
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/nz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/om.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/om.png
new file mode 100644
index 000000000..5e76d9502
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/om.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pa.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pa.png
new file mode 100644
index 000000000..4fd0f5e3f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pa.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pe.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pe.png
new file mode 100644
index 000000000..0b823a92d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pe.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pf.png
new file mode 100644
index 000000000..d79a4c225
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pg.png
new file mode 100644
index 000000000..297d2df0b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ph.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ph.png
new file mode 100644
index 000000000..7bc03a569
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ph.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pk.png
new file mode 100644
index 000000000..b72321195
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pl.png
new file mode 100644
index 000000000..7295b6471
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pm.png
new file mode 100644
index 000000000..508335304
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pn.png
new file mode 100644
index 000000000..472312423
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pr.png
new file mode 100644
index 000000000..b2b0015d2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ps.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ps.png
new file mode 100644
index 000000000..32bc7bc01
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ps.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pt.png
new file mode 100644
index 000000000..3f28ed79a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pw.png
new file mode 100644
index 000000000..65b7b6325
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/pw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/py.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/py.png
new file mode 100644
index 000000000..74d3e1f83
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/py.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/qa.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/qa.png
new file mode 100644
index 000000000..78f4135e3
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/qa.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/re.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/re.png
new file mode 100644
index 000000000..ff08cf2bf
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/re.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ro.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ro.png
new file mode 100644
index 000000000..fd0ccab08
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ro.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rs.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rs.png
new file mode 100644
index 000000000..d640d51ca
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rs.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ru.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ru.png
new file mode 100644
index 000000000..a4abc331a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ru.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rw.png
new file mode 100644
index 000000000..797b8392f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/rw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sa.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sa.png
new file mode 100644
index 000000000..27e32ecfd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sa.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sb.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sb.png
new file mode 100644
index 000000000..48af8c47a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sb.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sc.png
new file mode 100644
index 000000000..b5a17f595
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/scotland.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/scotland.png
new file mode 100644
index 000000000..1f64363a5
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/scotland.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sd.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sd.png
new file mode 100644
index 000000000..3ef8d3c51
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sd.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/se.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/se.png
new file mode 100644
index 000000000..301475dc7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/se.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sg.png
new file mode 100644
index 000000000..6501cf1f1
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sh.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sh.png
new file mode 100644
index 000000000..29299a39e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sh.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/si.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/si.png
new file mode 100644
index 000000000..f08f9be7d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/si.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sj.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sj.png
new file mode 100644
index 000000000..65ab004a2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sj.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sk.png
new file mode 100644
index 000000000..f24392bda
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sl.png
new file mode 100644
index 000000000..12901f092
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sm.png
new file mode 100644
index 000000000..76a3fddc3
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sn.png
new file mode 100644
index 000000000..5441692d4
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/so.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/so.png
new file mode 100644
index 000000000..205acee0f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/so.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sr.png
new file mode 100644
index 000000000..b3a020c9f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/st.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/st.png
new file mode 100644
index 000000000..78a37aa8c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/st.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sv.png
new file mode 100644
index 000000000..049c70088
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sy.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sy.png
new file mode 100644
index 000000000..37fc88b2a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sy.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sz.png
new file mode 100644
index 000000000..382281d30
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/sz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tc.png
new file mode 100644
index 000000000..7780a050e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/td.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/td.png
new file mode 100644
index 000000000..fe0219046
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/td.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tf.png
new file mode 100644
index 000000000..ca692123d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tg.png
new file mode 100644
index 000000000..5d0e10d89
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/th.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/th.png
new file mode 100644
index 000000000..8ebc161fe
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/th.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tj.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tj.png
new file mode 100644
index 000000000..ba5daaaf9
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tj.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tk.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tk.png
new file mode 100644
index 000000000..45ab0ecf7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tk.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tl.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tl.png
new file mode 100644
index 000000000..8efcb501c
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tl.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tm.png
new file mode 100644
index 000000000..30db3fb98
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tn.png
new file mode 100644
index 000000000..c82e7500d
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/to.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/to.png
new file mode 100644
index 000000000..7af76ee13
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/to.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tr.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tr.png
new file mode 100644
index 000000000..47a5c213e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tr.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tt.png
new file mode 100644
index 000000000..6e59a5046
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tv.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tv.png
new file mode 100644
index 000000000..79499eb77
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tv.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tw.png
new file mode 100644
index 000000000..da01e48f2
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tz.png
new file mode 100644
index 000000000..41ca84472
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/tz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ua.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ua.png
new file mode 100644
index 000000000..fb4d0021a
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ua.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ug.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ug.png
new file mode 100644
index 000000000..e1f25c98e
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ug.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/um.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/um.png
new file mode 100644
index 000000000..d05cd100f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/um.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/us.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/us.png
new file mode 100644
index 000000000..2a02b44be
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/us.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uy.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uy.png
new file mode 100644
index 000000000..7a459dcbb
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uy.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uz.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uz.png
new file mode 100644
index 000000000..2d48bfe2f
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/uz.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/va.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/va.png
new file mode 100644
index 000000000..48f1bd922
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/va.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vc.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vc.png
new file mode 100644
index 000000000..fb98acf30
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vc.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ve.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ve.png
new file mode 100644
index 000000000..7b8797437
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ve.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vg.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vg.png
new file mode 100644
index 000000000..d1e0364db
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vg.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vi.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vi.png
new file mode 100644
index 000000000..09bded3ac
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vi.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vn.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vn.png
new file mode 100644
index 000000000..9f067fe48
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vn.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vu.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vu.png
new file mode 100644
index 000000000..601ee0b39
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/vu.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wales.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wales.png
new file mode 100644
index 000000000..ac98c4abb
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wales.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wf.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wf.png
new file mode 100644
index 000000000..478f29680
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/wf.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ws.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ws.png
new file mode 100644
index 000000000..ce5fd45a9
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ws.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ye.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ye.png
new file mode 100644
index 000000000..1784ff97b
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/ye.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/yt.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/yt.png
new file mode 100644
index 000000000..58b5cf162
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/yt.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/za.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/za.png
new file mode 100644
index 000000000..92666e053
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/za.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zm.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zm.png
new file mode 100644
index 000000000..d66f31e59
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zm.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zw.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zw.png
new file mode 100644
index 000000000..5fa050fcd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/flags/zw.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/no-image.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/no-image.png
new file mode 100644
index 000000000..62b4406f7
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/no-image.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/assets/images/thumbs/no-image_100.png b/src/Web/Grand.Web.Store/wwwroot/assets/images/thumbs/no-image_100.png
new file mode 100644
index 000000000..e57e25fbd
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/assets/images/thumbs/no-image_100.png differ
diff --git a/src/Web/Grand.Web.Store/wwwroot/favicon.ico b/src/Web/Grand.Web.Store/wwwroot/favicon.ico
new file mode 100644
index 000000000..3cf896f33
Binary files /dev/null and b/src/Web/Grand.Web.Store/wwwroot/favicon.ico differ
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Login/Index.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Login/Index.cshtml
index afad15922..eb20fb71d 100644
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Login/Index.cshtml
+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Login/Index.cshtml
@@ -1,4 +1,5 @@
-@model LoginModel
+@using Grand.Web.AdminShared.Models.Common
+@model LoginModel
@{
//page title
Layout = Constants.LayoutVendorLogin;
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/_VendorLoginLayout.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/_VendorLoginLayout.cshtml
index 831719bdc..0e30f6a34 100644
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/_VendorLoginLayout.cshtml
+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/_VendorLoginLayout.cshtml
@@ -1,4 +1,5 @@
@using Constants = Grand.SharedUIResources.Constants
+@using Grand.Web.AdminShared.Models.Common
@model LoginModel
@{
//page title
diff --git a/src/Web/Grand.Web.Vendor/Controllers/BaseVendorController.cs b/src/Web/Grand.Web.Vendor/Controllers/BaseVendorController.cs
index 090a55674..68c2f1236 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/BaseVendorController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/BaseVendorController.cs
@@ -11,34 +11,5 @@ namespace Grand.Web.Vendor.Controllers;
[AuthorizeMenu]
public abstract class BaseVendorController : BaseController
{
- /// <summary>
- /// Save selected TAB index
- /// </summary>
- /// <param name="index">Index to save; null to automatically detect it</param>
- /// <param name="persistForTheNextRequest">A value indicating whether a message should be persisted for the next request</param>
- protected async Task SaveSelectedTabIndex(int? index = null, bool persistForTheNextRequest = true)
- {
- if (!index.HasValue)
- {
- var form = await HttpContext.Request.ReadFormAsync();
- var tabindex = form["selected-tab-index"];
- if (tabindex.Count > 0)
- {
- if (int.TryParse(tabindex[0], out var tmp)) index = tmp;
- }
- else
- {
- index = 1;
- }
- }
-
- if (index.HasValue)
- {
- var dataKey = "Grand.selected-tab-index";
- if (persistForTheNextRequest)
- TempData[dataKey] = index;
- else
- ViewData[dataKey] = index;
- }
- }
+
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Vendor/Controllers/HomeController.cs b/src/Web/Grand.Web.Vendor/Controllers/HomeController.cs
index c2cd05870..9e14129e8 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/HomeController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/HomeController.cs
@@ -45,7 +45,7 @@ public class HomeController : BaseVendorController
public IActionResult AccessDenied()
{
- _logger.LogInformation("Access denied to user #{CurrentCustomerEmail}", _contextAccessor.WorkContext.CurrentCustomer.Email);
+ _logger.LogInformation("Access denied");
return View();
}
diff --git a/src/Web/Grand.Web.Vendor/Controllers/LoginController.cs b/src/Web/Grand.Web.Vendor/Controllers/LoginController.cs
index 6ab406e8d..e4ee9b923 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/LoginController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/LoginController.cs
@@ -1,180 +1,21 @@
-using Grand.Business.Core.Events.Customers;
-using Grand.Business.Core.Interfaces.Authentication;
+using Grand.Business.Core.Interfaces.Authentication;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
-using Grand.Web.Common.Controllers;
-using Grand.Web.Common.Security.Captcha;
+using Grand.Web.AdminShared.Controllers;
using Grand.Web.Vendor.Extensions;
-using Grand.Web.Vendor.Models.Common;
using MediatR;
using Microsoft.AspNetCore.Mvc;
namespace Grand.Web.Vendor.Controllers;
[Area(Constants.AreaVendor)]
-public class LoginController : BaseController
+public class LoginController : BaseLoginController
{
- private readonly IGrandAuthenticationService _authenticationService;
- private readonly CaptchaSettings _captchaSettings;
- private readonly ICustomerManagerService _customerManagerService;
- private readonly ICustomerService _customerService;
- private readonly CustomerSettings _customerSettings;
- private readonly IMediator _mediator;
- private readonly IMessageProviderService _messageProviderService;
- private readonly ITranslationService _translationService;
- private readonly IContextAccessor _contextAccessor;
-
- public LoginController(
- CustomerSettings customerSettings,
- CaptchaSettings captchaSettings,
- ITranslationService translationService,
- ICustomerManagerService customerManagerService,
- ICustomerService customerService,
- IGrandAuthenticationService authenticationService,
- IMessageProviderService messageProviderService,
- IContextAccessor contextAccessor,
- IMediator mediator)
- {
- _customerSettings = customerSettings;
- _captchaSettings = captchaSettings;
- _translationService = translationService;
- _customerManagerService = customerManagerService;
- _customerService = customerService;
- _authenticationService = authenticationService;
- _messageProviderService = messageProviderService;
- _contextAccessor = contextAccessor;
- _mediator = mediator;
- }
-
- public IActionResult Index()
- {
- var model = new LoginModel {
- UsernamesEnabled = _customerSettings.UsernamesEnabled,
- DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage
- };
- return View(model);
- }
-
- [HttpPost]
- [AutoValidateAntiforgeryToken]
- public virtual async Task<IActionResult> Index(LoginModel model)
- {
- if (ModelState.IsValid)
- {
- var loginResult =
- await _customerManagerService.LoginCustomer(
- _customerSettings.UsernamesEnabled ? model.Username : model.Email, model.Password);
- switch (loginResult)
- {
- case CustomerLoginResults.Successful:
- {
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(model.Username)
- : await _customerService.GetCustomerByEmail(model.Email);
- //sign in
- return await SignInAction(customer, model.RememberMe);
- }
- case CustomerLoginResults.RequiresTwoFactor:
- {
- var userName = _customerSettings.UsernamesEnabled ? model.Username : model.Email;
- HttpContext.Session.SetString("VendorRequiresTwoFactor", userName);
- return RedirectToRoute("TwoFactorAuthorization");
- }
- }
- }
-
- //If we got this far, something failed, redisplay form
- model.UsernamesEnabled = _customerSettings.UsernamesEnabled;
- model.DisplayCaptcha = _captchaSettings.Enabled && _captchaSettings.ShowOnLoginPage;
-
- return View(model);
- }
-
- protected async Task<IActionResult> SignInAction(Customer customer, bool createPersistent)
+ public LoginController(CustomerSettings customerSettings, CaptchaSettings captchaSettings, ITranslationService translationService, ICustomerManagerService customerManagerService, ICustomerService customerService, IGrandAuthenticationService authenticationService, IMessageProviderService messageProviderService, IContextAccessor contextAccessor, IMediator mediator) : base(customerSettings, captchaSettings, translationService, customerManagerService, customerService, authenticationService, messageProviderService, contextAccessor, mediator)
{
- //sign in new customer
- await _authenticationService.SignIn(customer, createPersistent);
-
- //raise event
- await _mediator.Publish(new CustomerLoggedInEvent(customer));
-
- return RedirectToRoute("VendorIndex", new RouteValueDictionary());
- }
-
- public async Task<IActionResult> TwoFactorAuthorization(
- [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
- {
- if (!_customerSettings.TwoFactorAuthenticationEnabled)
- return RedirectToRoute("VendorLogin");
-
- var username = HttpContext.Session.GetString("VendorRequiresTwoFactor");
- if (string.IsNullOrEmpty(username))
- return RedirectToRoute("VendorLogin");
-
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(username)
- : await _customerService.GetCustomerByEmail(username);
- if (customer == null)
- return RedirectToRoute("VendorLogin");
-
- if (!customer.GetUserFieldFromEntity<bool>(SystemCustomerFieldNames.TwoFactorEnabled))
- return RedirectToRoute("VendorLogin");
-
- if (_customerSettings.TwoFactorAuthenticationType != TwoFactorAuthenticationType.AppVerification)
- {
- await twoFactorAuthenticationService.GenerateCodeSetup("", customer, _contextAccessor.WorkContext.WorkingLanguage,
- _customerSettings.TwoFactorAuthenticationType);
- if (_customerSettings.TwoFactorAuthenticationType == TwoFactorAuthenticationType.EmailVerification)
- await _messageProviderService.SendCustomerEmailTokenValidationMessage(customer,
- _contextAccessor.StoreContext.CurrentStore, _contextAccessor.WorkContext.WorkingLanguage.Id);
- }
-
- return View();
- }
-
- [HttpPost]
- public async Task<IActionResult> TwoFactorAuthorization(string token,
- [FromServices] ITwoFactorAuthenticationService twoFactorAuthenticationService)
- {
- if (!_customerSettings.TwoFactorAuthenticationEnabled)
- return RedirectToRoute("VendorLogin");
-
- var username = HttpContext.Session.GetString("VendorRequiresTwoFactor");
- if (string.IsNullOrEmpty(username))
- return RedirectToRoute("HomePage");
-
- var customer = _customerSettings.UsernamesEnabled
- ? await _customerService.GetCustomerByUsername(username)
- : await _customerService.GetCustomerByEmail(username);
- if (customer == null)
- return RedirectToRoute("VendorLogin");
-
- if (string.IsNullOrEmpty(token))
- {
- ModelState.AddModelError("",
- _translationService.GetResource("Account.TwoFactorAuth.SecurityCodeIsRequired"));
- }
- else
- {
- var secretKey = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.TwoFactorSecretKey);
- if (await twoFactorAuthenticationService.AuthenticateTwoFactor(secretKey, token, customer,
- _customerSettings.TwoFactorAuthenticationType))
- {
- //remove session
- HttpContext.Session.Remove("VendorRequiresTwoFactor");
-
- //sign in
- return await SignInAction(customer, false);
- }
-
- ModelState.AddModelError("", _translationService.GetResource("Account.TwoFactorAuth.WrongSecurityCode"));
- }
-
- await _mediator.Publish(new CustomerLoginFailedEvent(customer));
- return View();
}
-}
\ No newline at end of file
+}
diff --git a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs b/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
index c7409c4df..c23f36314 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
@@ -1074,8 +1074,7 @@ public class ProductController : BaseVendorController
#region Product pictures
- [HttpPost]
- [IgnoreAntiforgeryToken]
+ [HttpPost]
public async Task<IActionResult> ProductPictureAdd(
IFormFileCollection files,
Reference reference, string objectId,
diff --git a/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj b/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj
index adbba7829..aa2c86140 100644
--- a/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj
+++ b/src/Web/Grand.Web.Vendor/Grand.Web.Vendor.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
+<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\Build\Grand.Common.props" />
<PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
@@ -20,6 +20,6 @@
<ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
<ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
<ProjectReference Include="..\Grand.SharedUIResources\Grand.SharedUIResources.csproj" />
- <ProjectReference Include="..\Grand.Web.Common\Grand.Web.Common.csproj" />
+ <ProjectReference Include="..\Grand.Web.AdminShared\Grand.Web.AdminShared.csproj" />
</ItemGroup>
</Project>
diff --git a/src/Web/Grand.Web.Vendor/Models/Common/LoginModel.cs b/src/Web/Grand.Web.Vendor/Models/Common/LoginModel.cs
deleted file mode 100644
index e798cf701..000000000
--- a/src/Web/Grand.Web.Vendor/Models/Common/LoginModel.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Grand.Infrastructure.ModelBinding;
-using Grand.Infrastructure.Models;
-using System.ComponentModel.DataAnnotations;
-
-namespace Grand.Web.Vendor.Models.Common;
-
-public class LoginModel : BaseModel
-{
- [DataType(DataType.EmailAddress)]
- [GrandResourceDisplayName("Account.Login.Fields.Email")]
- public string Email { get; set; }
-
- public bool UsernamesEnabled { get; set; }
-
- [GrandResourceDisplayName("Account.Login.Fields.UserName")]
- public string Username { get; set; }
-
- [DataType(DataType.Password)]
- [GrandResourceDisplayName("Account.Login.Fields.Password")]
- public string Password { get; set; }
-
- [GrandResourceDisplayName("Account.Login.Fields.RememberMe")]
- public bool RememberMe { get; set; }
-
- public bool DisplayCaptcha { get; set; }
-
- public ICaptchaValidModel Captcha { get; set; } = new CaptchaModel();
-}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs
index ed2c4afe8..98c1fffef 100644
--- a/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs
+++ b/src/Web/Grand.Web.Vendor/Services/ShipmentViewModelService.cs
@@ -300,7 +300,7 @@ public class ShipmentViewModelService : IShipmentViewModelService
var orderItems = order.OrderItems;
//a vendor should have access only to his products
- if (_contextAccessor.WorkContext.CurrentVendor != null && !await _groupService.IsStaff(_contextAccessor.WorkContext.CurrentCustomer))
+ if (_contextAccessor.WorkContext.CurrentVendor != null && !await _groupService.IsStoreManager(_contextAccessor.WorkContext.CurrentCustomer))
orderItems = orderItems.Where(_contextAccessor.WorkContext.HasAccessToOrderItem).ToList();
foreach (var orderItem in orderItems)
diff --git a/src/Web/Grand.Web.Vendor/Validators/Common/LoginValidator.cs b/src/Web/Grand.Web.Vendor/Validators/Common/LoginValidator.cs
deleted file mode 100644
index f6564f9b6..000000000
--- a/src/Web/Grand.Web.Vendor/Validators/Common/LoginValidator.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using FluentValidation;
-using Grand.Business.Core.Events.Customers;
-using Grand.Business.Core.Interfaces.Common.Directory;
-using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Interfaces.Customers;
-using Grand.Domain.Customers;
-using Grand.Infrastructure.Models;
-using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
-using Grand.Web.Common.Validators;
-using Grand.Web.Vendor.Models.Common;
-using MediatR;
-
-namespace Grand.Web.Vendor.Validators.Common;
-
-public class LoginValidator : BaseGrandValidator<LoginModel>
-{
- public LoginValidator(
- IEnumerable<IValidatorConsumer<LoginModel>> validators,
- IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
- ICustomerService customerService, IGroupService groupService, IEncryptionService encryptionService,
- ITranslationService translationService, CustomerSettings customerSettings, CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator)
- : base(validators)
- {
- if (!customerSettings.UsernamesEnabled)
- {
- RuleFor(x => x.Email).NotEmpty()
- .WithMessage(translationService.GetResource("Account.Login.Fields.Email.Required"));
-
- RuleFor(x => x.Email).EmailAddress().WithMessage(translationService.GetResource("Common.WrongEmail"));
- }
- else
- {
- RuleFor(x => x.Username).NotEmpty()
- .WithMessage(translationService.GetResource("Account.Login.Fields.UserName.Required"));
- }
-
- RuleFor(x => x.Password).NotEmpty()
- .WithMessage(translationService.GetResource("Account.Login.Fields.Password.Required"));
-
- RuleFor(x => x).CustomAsync(async (x, context, _) =>
- {
- var customer = customerSettings.UsernamesEnabled
- ? await customerService.GetCustomerByUsername(x.Username)
- : await customerService.GetCustomerByEmail(x.Email);
-
- switch (customer)
- {
- case null:
- context.AddFailure(
- translationService.GetResource("Account.Login.WrongCredentials.CustomerNotExist"));
- break;
- case { Deleted: true }:
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials.Deleted"));
- break;
- case { Active: false }:
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials.NotActive"));
- break;
- case not null when !await groupService.IsRegistered(customer):
- context.AddFailure(
- translationService.GetResource("Account.Login.WrongCredentials.NotRegistered"));
- break;
- case not null when !await groupService.IsVendor(customer):
- context.AddFailure(
- translationService.GetResource("Account.Login.WrongPortal.Vendor"));
- break;
- case { CannotLoginUntilDateUtc: not null }
- when customer!.CannotLoginUntilDateUtc.Value > DateTime.UtcNow:
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials.LockedOut"));
- break;
- case not null:
- {
- var pwd = customer.PasswordFormatId switch {
- PasswordFormat.Clear => x.Password,
- PasswordFormat.Encrypted =>
- encryptionService.EncryptText(x.Password, customer.PasswordSalt),
- PasswordFormat.Hashed => encryptionService.CreatePasswordHash(x.Password,
- customer.PasswordSalt,
- customerSettings.HashedPasswordFormat),
- _ => throw new Exception("PasswordFormat not supported")
- };
- var isValid = pwd == customer.Password;
- if (!isValid)
- {
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials"));
- await contextAccessor.HttpContext!.RequestServices.GetRequiredService<IMediator>()
- .Publish(new CustomerLoginFailedEvent(customer), _);
- }
-
- break;
- }
- }
- });
-
- if (captchaSettings.Enabled && captchaSettings.ShowOnLoginPage)
- {
- RuleFor(x => x.Captcha).NotNull()
- .WithMessage(translationService.GetResource("Account.Captcha.Required"));
-
- RuleFor(x => x.Captcha)
- .SetValidator(new CaptchaValidator(validatorsCaptcha, contextAccessor, googleReCaptchaValidator));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
index 85f6fe227..4f8c27afa 100644
Binary files a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml and b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml differ
diff --git a/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs b/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs
index d88e88b67..0cb3a943b 100644
--- a/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs
+++ b/src/Web/Grand.Web/Commands/Handler/Contact/ContactUsSendCommandHandler.cs
@@ -2,7 +2,6 @@
using Grand.Business.Core.Interfaces.Marketing.Contacts;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Domain.Common;
-using Grand.Domain.Stores;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
using Grand.Web.Commands.Models.Contact;
@@ -46,7 +45,7 @@ public class ContactUsSendCommandHandler : IRequestHandler<ContactUsSendCommand,
return request.Model;
}
- private async Task<ContactUsModel> SendContactUs(ContactUsSendCommand request, Store store)
+ private async Task<ContactUsModel> SendContactUs(ContactUsSendCommand request, Domain.Stores.Store store)
{
var subject = _commonSettings.SubjectFieldOnContactUsForm ? request.Model.Subject : null;
var body = FormatText.ConvertText(request.Model.Enquiry);
diff --git a/src/Web/Grand.Web/Commands/Models/Contact/ContactAttributeChangeCommand.cs b/src/Web/Grand.Web/Commands/Models/Contact/ContactAttributeChangeCommand.cs
index ebdef7245..0c72b8ed1 100644
--- a/src/Web/Grand.Web/Commands/Models/Contact/ContactAttributeChangeCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Contact/ContactAttributeChangeCommand.cs
@@ -1,5 +1,4 @@
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Common.Models;
using MediatR;
@@ -10,5 +9,5 @@ public class
{
public IList<CustomAttributeModel> Attributes { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Contact/ContactUsCommand.cs b/src/Web/Grand.Web/Commands/Models/Contact/ContactUsCommand.cs
index 318d1d818..47b03cbbc 100644
--- a/src/Web/Grand.Web/Commands/Models/Contact/ContactUsCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Contact/ContactUsCommand.cs
@@ -1,6 +1,5 @@
using Grand.Domain.Customers;
using Grand.Domain.Localization;
-using Grand.Domain.Stores;
using Grand.Web.Models.Contact;
using MediatR;
@@ -9,7 +8,7 @@ namespace Grand.Web.Commands.Models.Contact;
public class ContactUsCommand : IRequest<ContactUsModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public ContactUsModel Model { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/CustomerRegisteredCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/CustomerRegisteredCommand.cs
index 19fa61867..364800e76 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/CustomerRegisteredCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/CustomerRegisteredCommand.cs
@@ -1,6 +1,5 @@
using Grand.Domain.Common;
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Models.Customer;
using MediatR;
@@ -9,7 +8,7 @@ namespace Grand.Web.Commands.Models.Customers;
public class CustomerRegisteredCommand : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public RegisterModel Model { get; set; }
public IList<CustomAttribute> CustomerAttributes { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/DeleteAccountCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/DeleteAccountCommand.cs
index f679f837a..33040d4bd 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/DeleteAccountCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/DeleteAccountCommand.cs
@@ -1,5 +1,4 @@
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using MediatR;
namespace Grand.Web.Commands.Models.Customers;
@@ -7,6 +6,6 @@ namespace Grand.Web.Commands.Models.Customers;
public class DeleteAccountCommand : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public string IpAddress { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/PasswordRecoverySendCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/PasswordRecoverySendCommand.cs
index dc9992d47..a05506551 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/PasswordRecoverySendCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/PasswordRecoverySendCommand.cs
@@ -1,6 +1,5 @@
using Grand.Domain.Customers;
using Grand.Domain.Localization;
-using Grand.Domain.Stores;
using Grand.Web.Models.Customer;
using MediatR;
@@ -10,6 +9,6 @@ public class PasswordRecoverySendCommand : IRequest<bool>
{
public PasswordRecoveryModel Model { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/SubAccountAddCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/SubAccountAddCommand.cs
index ac0659a2a..903a76ede 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/SubAccountAddCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/SubAccountAddCommand.cs
@@ -1,5 +1,4 @@
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Models.Customer;
using MediatR;
@@ -8,6 +7,6 @@ namespace Grand.Web.Commands.Models.Customers;
public class SubAccountAddCommand : IRequest
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public SubAccountCreateModel Model { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/SubAccountEditCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/SubAccountEditCommand.cs
index c233fc861..de42db97b 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/SubAccountEditCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/SubAccountEditCommand.cs
@@ -1,5 +1,4 @@
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Models.Customer;
using MediatR;
@@ -8,6 +7,6 @@ namespace Grand.Web.Commands.Models.Customers;
public class SubAccountEditCommand : IRequest<bool>
{
public Customer CurrentCustomer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public SubAccountEditModel EditModel { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Customers/UpdateCustomerInfoCommand.cs b/src/Web/Grand.Web/Commands/Models/Customers/UpdateCustomerInfoCommand.cs
index 43718c732..103505c05 100644
--- a/src/Web/Grand.Web/Commands/Models/Customers/UpdateCustomerInfoCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Customers/UpdateCustomerInfoCommand.cs
@@ -1,6 +1,5 @@
using Grand.Domain.Common;
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Models.Customer;
using MediatR;
@@ -9,7 +8,7 @@ namespace Grand.Web.Commands.Models.Customers;
public class UpdateCustomerInfoCommand : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public CustomerInfoModel Model { get; set; }
public IList<CustomAttribute> CustomerAttributes { get; set; }
public Customer OriginalCustomerIfImpersonated { get; set; }
diff --git a/src/Web/Grand.Web/Commands/Models/Products/InsertProductReviewCommand.cs b/src/Web/Grand.Web/Commands/Models/Products/InsertProductReviewCommand.cs
index d269b8896..f08ae9a04 100644
--- a/src/Web/Grand.Web/Commands/Models/Products/InsertProductReviewCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Products/InsertProductReviewCommand.cs
@@ -1,6 +1,5 @@
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using Grand.Web.Models.Catalog;
using MediatR;
@@ -8,7 +7,7 @@ namespace Grand.Web.Commands.Models.Products;
public class InsertProductReviewCommand : IRequest<ProductReview>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public Product Product { get; set; }
public ProductReviewsModel Model { get; set; }
diff --git a/src/Web/Grand.Web/Commands/Models/Products/SendProductAskQuestionMessageCommand.cs b/src/Web/Grand.Web/Commands/Models/Products/SendProductAskQuestionMessageCommand.cs
index 291373221..9a8d56a3d 100644
--- a/src/Web/Grand.Web/Commands/Models/Products/SendProductAskQuestionMessageCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Products/SendProductAskQuestionMessageCommand.cs
@@ -1,7 +1,6 @@
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Localization;
-using Grand.Domain.Stores;
using Grand.Web.Models.Catalog;
using MediatR;
@@ -10,7 +9,7 @@ namespace Grand.Web.Commands.Models.Products;
public class SendProductAskQuestionMessageCommand : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Product Product { get; set; }
public ProductAskQuestionModel Model { get; set; }
diff --git a/src/Web/Grand.Web/Commands/Models/Products/SendProductEmailAFriendMessageCommand.cs b/src/Web/Grand.Web/Commands/Models/Products/SendProductEmailAFriendMessageCommand.cs
index 147e9ae0a..f64173c09 100644
--- a/src/Web/Grand.Web/Commands/Models/Products/SendProductEmailAFriendMessageCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Products/SendProductEmailAFriendMessageCommand.cs
@@ -1,7 +1,6 @@
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Localization;
-using Grand.Domain.Stores;
using Grand.Web.Models.Catalog;
using MediatR;
@@ -10,7 +9,7 @@ namespace Grand.Web.Commands.Models.Products;
public class SendProductEmailAFriendMessageCommand : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Product Product { get; set; }
public ProductEmailAFriendModel Model { get; set; }
diff --git a/src/Web/Grand.Web/Commands/Models/ShoppingCart/SaveCheckoutAttributesCommand.cs b/src/Web/Grand.Web/Commands/Models/ShoppingCart/SaveCheckoutAttributesCommand.cs
index 361f67ec6..3083f6eff 100644
--- a/src/Web/Grand.Web/Commands/Models/ShoppingCart/SaveCheckoutAttributesCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/ShoppingCart/SaveCheckoutAttributesCommand.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Commands.Models.ShoppingCart;
public class SaveCheckoutAttributesCommand : IRequest<IList<CustomAttribute>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
public IList<CustomAttributeModel> SelectedAttributes { get; set; }
diff --git a/src/Web/Grand.Web/Commands/Models/Vendors/ContactVendorSendCommand.cs b/src/Web/Grand.Web/Commands/Models/Vendors/ContactVendorSendCommand.cs
index 47fceab24..47df125c5 100644
--- a/src/Web/Grand.Web/Commands/Models/Vendors/ContactVendorSendCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Vendors/ContactVendorSendCommand.cs
@@ -7,7 +7,7 @@ namespace Grand.Web.Commands.Models.Vendors;
public class ContactVendorSendCommand : IRequest<ContactVendorModel>
{
public Domain.Vendors.Vendor Vendor { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public ContactVendorModel Model { get; set; }
public string IpAddress { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Commands/Models/Vendors/InsertVendorReviewCommand.cs b/src/Web/Grand.Web/Commands/Models/Vendors/InsertVendorReviewCommand.cs
index 277215514..96f639e91 100644
--- a/src/Web/Grand.Web/Commands/Models/Vendors/InsertVendorReviewCommand.cs
+++ b/src/Web/Grand.Web/Commands/Models/Vendors/InsertVendorReviewCommand.cs
@@ -8,6 +8,6 @@ namespace Grand.Web.Commands.Models.Vendors;
public class InsertVendorReviewCommand : IRequest<VendorReview>
{
public Domain.Vendors.Vendor Vendor { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public VendorReviewsModel Model { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Components/EmailWishlist.cs b/src/Web/Grand.Web/Components/EmailWishlist.cs
index 47dfd2ec2..3faad0e9e 100644
--- a/src/Web/Grand.Web/Components/EmailWishlist.cs
+++ b/src/Web/Grand.Web/Components/EmailWishlist.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Domain.Permissions;
+using Grand.Domain.Common;
using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Common.Components;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Models.ShoppingCart;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web/Components/ProductEmailAFriend.cs b/src/Web/Grand.Web/Components/ProductEmailAFriend.cs
index 80d7e49d9..b0e704c4f 100644
--- a/src/Web/Grand.Web/Components/ProductEmailAFriend.cs
+++ b/src/Web/Grand.Web/Components/ProductEmailAFriend.cs
@@ -1,9 +1,9 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Infrastructure;
using Grand.Web.Common.Components;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Models.Catalog;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web/Controllers/CommonController.cs b/src/Web/Grand.Web/Controllers/CommonController.cs
index 61fffb317..9c4d14b15 100644
--- a/src/Web/Grand.Web/Controllers/CommonController.cs
+++ b/src/Web/Grand.Web/Controllers/CommonController.cs
@@ -271,7 +271,7 @@ public class CommonController : BasePublicController
return Redirect(returnUrl);
- void SetStoreCookie(Store store)
+ void SetStoreCookie(Domain.Stores.Store store)
{
if (store == null)
return;
diff --git a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
index 7912b5a29..de16e61d0 100644
--- a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
+++ b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
@@ -5,20 +5,20 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Domain.Permissions;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Knowledgebase;
using Grand.Domain.Localization;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Infrastructure.Caching;
+using Grand.SharedKernel.Attributes;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Events.Cache;
using Grand.Web.Extensions;
using Grand.Web.Models.Knowledgebase;
using Microsoft.AspNetCore.Mvc;
-using Grand.SharedKernel.Attributes;
namespace Grand.Web.Controllers;
@@ -306,7 +306,7 @@ public class KnowledgebaseController : BasePublicController
await PrepareKnowledgebaseArticleModel(model, article, customerService);
return View("Article", model);
}
-
+
private async Task<IList<KnowledgebaseCategory>> GetCategoryBreadCrumb(KnowledgebaseCategory category, bool showHidden = false)
{
ArgumentNullException.ThrowIfNull(category);
diff --git a/src/Web/Grand.Web/Controllers/WishlistController.cs b/src/Web/Grand.Web/Controllers/WishlistController.cs
index b8d6afdfd..050c6bf34 100644
--- a/src/Web/Grand.Web/Controllers/WishlistController.cs
+++ b/src/Web/Grand.Web/Controllers/WishlistController.cs
@@ -4,6 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Business.Core.Utilities.Checkout;
+using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
@@ -11,7 +12,6 @@ using Grand.SharedKernel.Attributes;
using Grand.SharedKernel.Extensions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.ShoppingCart;
using Grand.Web.Models.ShoppingCart;
using MediatR;
diff --git a/src/Web/Grand.Web/Events/ChangeStoreEvent.cs b/src/Web/Grand.Web/Events/ChangeStoreEvent.cs
index 892cf54d8..c03e6e90d 100644
--- a/src/Web/Grand.Web/Events/ChangeStoreEvent.cs
+++ b/src/Web/Grand.Web/Events/ChangeStoreEvent.cs
@@ -1,17 +1,16 @@
using Grand.Domain.Customers;
-using Grand.Domain.Stores;
using MediatR;
namespace Grand.Web.Events;
public class ChangeStoreEvent : INotification
{
- public ChangeStoreEvent(Customer customer, Store store)
+ public ChangeStoreEvent(Customer customer, Domain.Stores.Store store)
{
Customer = customer;
Store = store;
}
public Customer Customer { get; private set; }
- public Store Store { get; private set; }
+ public Domain.Stores.Store Store { get; private set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Handlers/Blogs/GetBlogPostHandler.cs b/src/Web/Grand.Web/Features/Handlers/Blogs/GetBlogPostHandler.cs
index da6743ad1..93a84f808 100644
--- a/src/Web/Grand.Web/Features/Handlers/Blogs/GetBlogPostHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Blogs/GetBlogPostHandler.cs
@@ -5,10 +5,10 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Domain.Blogs;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Media;
using Grand.Infrastructure;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.Blogs;
using Grand.Web.Models.Blogs;
using Grand.Web.Models.Media;
diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetVendorHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetVendorHandler.cs
index 57650ce92..cff9f763c 100644
--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetVendorHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetVendorHandler.cs
@@ -4,9 +4,9 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Business.Core.Queries.Catalog;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Domain.Media;
using Grand.Domain.Vendors;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.Catalog;
using Grand.Web.Features.Models.Common;
using Grand.Web.Features.Models.Products;
diff --git a/src/Web/Grand.Web/Features/Handlers/Common/GetAddressModelHandler.cs b/src/Web/Grand.Web/Features/Handlers/Common/GetAddressModelHandler.cs
index d0615c2dc..48dc80747 100644
--- a/src/Web/Grand.Web/Features/Handlers/Common/GetAddressModelHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Common/GetAddressModelHandler.cs
@@ -7,7 +7,6 @@ using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Directory;
using Grand.Domain.Localization;
-using Grand.Domain.Stores;
using Grand.Web.Features.Models.Common;
using Grand.Web.Models.Common;
using MediatR;
@@ -65,7 +64,7 @@ public class GetAddressModelHandler : IRequestHandler<GetAddressModel, AddressMo
bool prePopulateWithCustomerFields = false,
Customer customer = null,
Language language = null,
- Store store = null)
+ Domain.Stores.Store store = null)
{
if (!excludeProperties && address != null)
{
@@ -120,8 +119,7 @@ public class GetAddressModelHandler : IRequestHandler<GetAddressModel, AddressMo
//countries and states
if (_addressSettings.CountryEnabled && loadCountries != null)
{
- model.AvailableCountries.Add(new SelectListItem
- { Text = _translationService.GetResource("Address.SelectCountry"), Value = "" });
+ model.AvailableCountries.Add(new SelectListItem { Text = _translationService.GetResource("Address.SelectCountry"), Value = "" });
foreach (var c in loadCountries())
model.AvailableCountries.Add(new SelectListItem {
Text = c.GetTranslation(x => x.Name, language?.Id),
@@ -137,8 +135,7 @@ public class GetAddressModelHandler : IRequestHandler<GetAddressModel, AddressMo
.GetStateProvincesByCountryId(
!string.IsNullOrEmpty(model.CountryId) ? model.CountryId : store.DefaultCountryId, language?.Id);
- model.AvailableStates.Add(new SelectListItem
- { Text = _translationService.GetResource("Address.SelectState"), Value = "" });
+ model.AvailableStates.Add(new SelectListItem { Text = _translationService.GetResource("Address.SelectState"), Value = "" });
foreach (var s in states)
model.AvailableStates.Add(new SelectListItem {
@@ -211,41 +208,41 @@ public class GetAddressModelHandler : IRequestHandler<GetAddressModel, AddressMo
case AttributeControlType.DropdownList:
case AttributeControlType.RadioList:
case AttributeControlType.Checkboxes:
- {
- if (selectedAddressAttributes != null)
{
- //clear default selection
- foreach (var item in attributeModel.Values)
- item.IsPreSelected = false;
+ if (selectedAddressAttributes != null)
+ {
+ //clear default selection
+ foreach (var item in attributeModel.Values)
+ item.IsPreSelected = false;
- //select new values
- var selectedValues =
- await _addressAttributeParser.ParseAddressAttributeValues(selectedAddressAttributes);
- foreach (var attributeValue in selectedValues)
- if (attributeModel.Id == attributeValue.AddressAttributeId)
- foreach (var item in attributeModel.Values)
- if (attributeValue.Id == item.Id)
- item.IsPreSelected = true;
+ //select new values
+ var selectedValues =
+ await _addressAttributeParser.ParseAddressAttributeValues(selectedAddressAttributes);
+ foreach (var attributeValue in selectedValues)
+ if (attributeModel.Id == attributeValue.AddressAttributeId)
+ foreach (var item in attributeModel.Values)
+ if (attributeValue.Id == item.Id)
+ item.IsPreSelected = true;
+ }
}
- }
break;
case AttributeControlType.ReadonlyCheckboxes:
- {
- //do nothing
- //values are already pre-set
- }
+ {
+ //do nothing
+ //values are already pre-set
+ }
break;
case AttributeControlType.TextBox:
case AttributeControlType.MultilineTextbox:
- {
- if (selectedAddressAttributes != null)
{
- var enteredText = selectedAddressAttributes.Where(x => x.Key == attribute.Id)
- .Select(x => x.Value).ToList();
- if (enteredText.Any())
- attributeModel.DefaultValue = enteredText[0];
+ if (selectedAddressAttributes != null)
+ {
+ var enteredText = selectedAddressAttributes.Where(x => x.Key == attribute.Id)
+ .Select(x => x.Value).ToList();
+ if (enteredText.Any())
+ attributeModel.DefaultValue = enteredText[0];
+ }
}
- }
break;
case AttributeControlType.ColorSquares:
case AttributeControlType.ImageSquares:
diff --git a/src/Web/Grand.Web/Features/Handlers/Customers/GetRegisterHandler.cs b/src/Web/Grand.Web/Features/Handlers/Customers/GetRegisterHandler.cs
index 06937da2c..4017120e3 100644
--- a/src/Web/Grand.Web/Features/Handlers/Customers/GetRegisterHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Customers/GetRegisterHandler.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Tax;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.Customers;
using Grand.Web.Models.Customer;
using Grand.Web.Models.Newsletter;
@@ -85,8 +85,7 @@ public class GetRegisterHandler : IRequestHandler<GetRegister, RegisterModel>
//countries and states
if (_customerSettings.CountryEnabled)
{
- model.AvailableCountries.Add(new SelectListItem
- { Text = _translationService.GetResource("Address.SelectCountry"), Value = "" });
+ model.AvailableCountries.Add(new SelectListItem { Text = _translationService.GetResource("Address.SelectCountry"), Value = "" });
foreach (var c in await _countryService.GetAllCountries(request.Language.Id, request.Store.Id))
model.AvailableCountries.Add(new SelectListItem {
@@ -99,12 +98,12 @@ public class GetRegisterHandler : IRequestHandler<GetRegister, RegisterModel>
{
//states
var states = await _countryService.GetStateProvincesByCountryId(model.CountryId, request.Language.Id);
- model.AvailableStates.Add(new SelectListItem
- { Text = _translationService.GetResource("Address.SelectState"), Value = "" });
+ model.AvailableStates.Add(new SelectListItem { Text = _translationService.GetResource("Address.SelectState"), Value = "" });
foreach (var s in states)
model.AvailableStates.Add(new SelectListItem {
- Text = s.GetTranslation(x => x.Name, request.Language.Id), Value = s.Id,
+ Text = s.GetTranslation(x => x.Name, request.Language.Id),
+ Value = s.Id,
Selected = s.Id == model.StateProvinceId
});
}
diff --git a/src/Web/Grand.Web/Features/Handlers/News/GetNewsItemHandler.cs b/src/Web/Grand.Web/Features/Handlers/News/GetNewsItemHandler.cs
index 76292a6df..3ab884cf7 100644
--- a/src/Web/Grand.Web/Features/Handlers/News/GetNewsItemHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/News/GetNewsItemHandler.cs
@@ -3,11 +3,11 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Media;
using Grand.Domain.News;
using Grand.Infrastructure;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.News;
using Grand.Web.Models.Media;
using Grand.Web.Models.News;
diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
index 518a7cf35..4b48eb054 100644
--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
@@ -12,18 +12,16 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Media;
using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
using Grand.Domain.Seo;
-using Grand.Domain.Stores;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
using Grand.Infrastructure.Caching;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Events.Cache;
using Grand.Web.Extensions;
using Grand.Web.Features.Models.Catalog;
@@ -145,7 +143,7 @@ public class GetProductDetailsPageHandler : IRequestHandler<GetProductDetailsPag
request.IsAssociatedProduct);
}
- private async Task<ProductDetailsModel> PrepareProductDetailsModel(Store store, Product product,
+ private async Task<ProductDetailsModel> PrepareProductDetailsModel(Domain.Stores.Store store, Product product,
ShoppingCartItem updateCartItem, bool isAssociatedProduct)
{
ArgumentNullException.ThrowIfNull(product);
@@ -560,8 +558,8 @@ public class GetProductDetailsPageHandler : IRequestHandler<GetProductDetailsPag
private async Task<(PictureModel defaultPictureModel, List<PictureModel> pictureModels)>
PrepareProductPictureModel(Product product, int defaultPictureSize, bool isAssociatedProduct, string name)
{
- var defaultPicture = product.ProductPictures.OrderByDescending(p => p.IsDefault)
- .ThenBy(p => p.DisplayOrder)
+ var defaultPicture = product.ProductPictures.OrderByDescending(p => p.IsDefault)
+ .ThenBy(p => p.DisplayOrder)
.FirstOrDefault() ?? new ProductPicture();
var picture = await _pictureService.GetPictureById(defaultPicture.PictureId);
@@ -688,7 +686,8 @@ public class GetProductDetailsPageHandler : IRequestHandler<GetProductDetailsPag
if (product.BasepriceEnabled)
model.BasePricePAngV = await _mediator.Send(new GetFormatBasePrice {
- Currency = _contextAccessor.WorkContext.WorkingCurrency, Product = product,
+ Currency = _contextAccessor.WorkContext.WorkingCurrency,
+ Product = product,
ProductPrice = finalPriceWithDiscount
});
@@ -969,68 +968,68 @@ public class GetProductDetailsPageHandler : IRequestHandler<GetProductDetailsPag
case AttributeControlType.Checkboxes:
case AttributeControlType.ColorSquares:
case AttributeControlType.ImageSquares:
- {
- if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
{
- //clear default selection
- foreach (var item in attributeModel.Values)
- item.IsPreSelected = false;
-
- //select new values
- var selectedValues = product.ParseProductAttributeValues(updatecartitem.Attributes);
- foreach (var attributeValue in selectedValues)
- foreach (var item in attributeModel.Values)
- if (attributeValue.Id == item.Id)
- item.IsPreSelected = true;
+ if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
+ {
+ //clear default selection
+ foreach (var item in attributeModel.Values)
+ item.IsPreSelected = false;
+
+ //select new values
+ var selectedValues = product.ParseProductAttributeValues(updatecartitem.Attributes);
+ foreach (var attributeValue in selectedValues)
+ foreach (var item in attributeModel.Values)
+ if (attributeValue.Id == item.Id)
+ item.IsPreSelected = true;
+ }
}
- }
break;
case AttributeControlType.ReadonlyCheckboxes:
- {
- //do nothing
- //values are already pre-set
- }
+ {
+ //do nothing
+ //values are already pre-set
+ }
break;
case AttributeControlType.TextBox:
case AttributeControlType.MultilineTextbox:
- {
- if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
{
- var enteredText =
- ProductExtensions.ParseValues(updatecartitem.Attributes, attribute.Id);
- if (enteredText.Any())
- attributeModel.DefaultValue = enteredText[0];
+ if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
+ {
+ var enteredText =
+ ProductExtensions.ParseValues(updatecartitem.Attributes, attribute.Id);
+ if (enteredText.Any())
+ attributeModel.DefaultValue = enteredText[0];
+ }
}
- }
break;
case AttributeControlType.Datepicker:
- {
- //keep in mind my that the code below works only in the current culture
- var selectedDateStr =
- ProductExtensions.ParseValues(updatecartitem.Attributes, attribute.Id);
- if (selectedDateStr.Any())
- if (DateTime.TryParseExact(selectedDateStr[0], "D", CultureInfo.CurrentCulture,
- DateTimeStyles.None, out var selectedDate))
- {
- //successfully parsed
- attributeModel.SelectedDay = selectedDate.Day;
- attributeModel.SelectedMonth = selectedDate.Month;
- attributeModel.SelectedYear = selectedDate.Year;
- }
- }
+ {
+ //keep in mind my that the code below works only in the current culture
+ var selectedDateStr =
+ ProductExtensions.ParseValues(updatecartitem.Attributes, attribute.Id);
+ if (selectedDateStr.Any())
+ if (DateTime.TryParseExact(selectedDateStr[0], "D", CultureInfo.CurrentCulture,
+ DateTimeStyles.None, out var selectedDate))
+ {
+ //successfully parsed
+ attributeModel.SelectedDay = selectedDate.Day;
+ attributeModel.SelectedMonth = selectedDate.Month;
+ attributeModel.SelectedYear = selectedDate.Year;
+ }
+ }
break;
case AttributeControlType.FileUpload:
- {
- if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
{
- var downloadGuidStr = ProductExtensions
- .ParseValues(updatecartitem.Attributes, attribute.Id).FirstOrDefault();
- Guid.TryParse(downloadGuidStr, out var downloadGuid);
- var download = await _downloadService.GetDownloadByGuid(downloadGuid);
- if (download != null)
- attributeModel.DefaultValue = download.DownloadGuid.ToString();
+ if (updatecartitem.Attributes != null && updatecartitem.Attributes.Any())
+ {
+ var downloadGuidStr = ProductExtensions
+ .ParseValues(updatecartitem.Attributes, attribute.Id).FirstOrDefault();
+ Guid.TryParse(downloadGuidStr, out var downloadGuid);
+ var download = await _downloadService.GetDownloadByGuid(downloadGuid);
+ if (download != null)
+ attributeModel.DefaultValue = download.DownloadGuid.ToString();
+ }
}
- }
break;
}
@@ -1137,8 +1136,8 @@ public class GetProductDetailsPageHandler : IRequestHandler<GetProductDetailsPag
bundleProduct.PriceValue = productprice.productprice;
}
- var productPicture = p1.ProductPictures.OrderByDescending(p => p.IsDefault)
- .ThenBy(p => p.DisplayOrder)
+ var productPicture = p1.ProductPictures.OrderByDescending(p => p.IsDefault)
+ .ThenBy(p => p.DisplayOrder)
.FirstOrDefault() ?? new ProductPicture();
var picture = await _pictureService.GetPictureById(productPicture.PictureId);
diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductReviewsHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductReviewsHandler.cs
index d2ebebf42..c9e3c29e8 100644
--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductReviewsHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductReviewsHandler.cs
@@ -3,8 +3,8 @@ using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.Products;
using Grand.Web.Models.Catalog;
using MediatR;
diff --git a/src/Web/Grand.Web/Features/Handlers/Vendors/GetVendorReviewsHandler.cs b/src/Web/Grand.Web/Features/Handlers/Vendors/GetVendorReviewsHandler.cs
index 6ef1f1207..cc73e6642 100644
--- a/src/Web/Grand.Web/Features/Handlers/Vendors/GetVendorReviewsHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Vendors/GetVendorReviewsHandler.cs
@@ -1,10 +1,10 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Features.Models.Vendors;
using Grand.Web.Models.Vendors;
using MediatR;
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetBrand.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetBrand.cs
index 3c606d9d7..be2fbfa96 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetBrand.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetBrand.cs
@@ -11,7 +11,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetBrand : IRequest<BrandModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
public Brand Brand { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetBrandAll.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetBrandAll.cs
index b55156466..daa929381 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetBrandAll.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetBrandAll.cs
@@ -8,7 +8,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetBrandAll : IRequest<BrandListModel>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
public BrandPagingModel Command { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCategory.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCategory.cs
index ad869cc86..bccdaf7e9 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCategory.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCategory.cs
@@ -11,7 +11,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCategory : IRequest<CategoryModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
public Category Category { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryAll.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryAll.cs
index 7c1e9d6f9..766c0cdb5 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryAll.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryAll.cs
@@ -8,7 +8,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCategoryAll : IRequest<CategoryListModel>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
public CategoryPagingModel Command { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryFeaturedProducts.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryFeaturedProducts.cs
index af01c4ebc..a1c13aa82 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryFeaturedProducts.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryFeaturedProducts.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCategoryFeaturedProducts : IRequest<IList<CategoryModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryNavigation.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryNavigation.cs
index 10bbe03fe..f9c676622 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryNavigation.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCategoryNavigation.cs
@@ -9,7 +9,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCategoryNavigation : IRequest<CategoryNavigationModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public string CurrentCategoryId { get; set; }
public string CurrentProductId { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCategorySimple.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCategorySimple.cs
index a8d72588c..3386d026e 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCategorySimple.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCategorySimple.cs
@@ -9,7 +9,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCategorySimple : IRequest<IList<CategorySimpleModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public string CurrentCategoryId { get; set; } = "";
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetChildCategoryIds.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetChildCategoryIds.cs
index 0c7c9b56c..bd6e40880 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetChildCategoryIds.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetChildCategoryIds.cs
@@ -8,5 +8,5 @@ public class GetChildCategoryIds : IRequest<IList<string>>
{
public string ParentCategoryId { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCollection.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCollection.cs
index bb684a41d..2bd7e4748 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCollection.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCollection.cs
@@ -11,7 +11,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCollection : IRequest<CollectionModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
public Collection Collection { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionAll.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionAll.cs
index 840a78b64..1bb7b38f8 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionAll.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionAll.cs
@@ -8,7 +8,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCollectionAll : IRequest<CollectionListModel>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
public CollectionPagingModel Command { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionFeaturedProducts.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionFeaturedProducts.cs
index fb783f9b5..b8caec851 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionFeaturedProducts.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionFeaturedProducts.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetCollectionFeaturedProducts : IRequest<IList<CollectionModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionNavigation.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionNavigation.cs
index 0d0f34105..2fdd9c3a1 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionNavigation.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetCollectionNavigation.cs
@@ -10,6 +10,6 @@ public class GetCollectionNavigation : IRequest<CollectionNavigationModel>
{
public string CurrentCollectionId { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageBrands.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageBrands.cs
index db4d052e7..d82fecd9c 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageBrands.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageBrands.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetHomepageBrands : IRequest<IList<BrandModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCategory.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCategory.cs
index 2f8a49513..696072572 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCategory.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCategory.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetHomepageCategory : IRequest<IList<CategoryModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCollections.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCollections.cs
index 54e8a26f4..2712a2def 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCollections.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetHomepageCollections.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetHomepageCollections : IRequest<IList<CollectionModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetMenu.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetMenu.cs
index 35871fe92..fa54cfd08 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetMenu.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetMenu.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetMenu : IRequest<MenuModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetPopularProductTags.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetPopularProductTags.cs
index ef6741dbf..7b6332e32 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetPopularProductTags.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetPopularProductTags.cs
@@ -8,5 +8,5 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetPopularProductTags : IRequest<PopularProductTagsModel>
{
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetProductTagsAll.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetProductTagsAll.cs
index f169e3db7..9fafc6b58 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetProductTagsAll.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetProductTagsAll.cs
@@ -8,5 +8,5 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetProductTagsAll : IRequest<PopularProductTagsModel>
{
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetProductsByTag.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetProductsByTag.cs
index b8c92b5f6..67ed97162 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetProductsByTag.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetProductsByTag.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetProductsByTag : IRequest<ProductsByTagModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public ProductTag ProductTag { get; set; }
public CatalogPagingFilteringModel Command { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetSearch.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetSearch.cs
index 6035b7bc9..90da20b94 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetSearch.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetSearch.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetSearch : IRequest<SearchModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
public SearchModel Model { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetSearchAutoComplete.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetSearchAutoComplete.cs
index 60f755a70..bd02efa61 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetSearchAutoComplete.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetSearchAutoComplete.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetSearchAutoComplete : IRequest<IList<SearchAutoCompleteModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
public string Term { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetSearchBox.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetSearchBox.cs
index 896537de5..65be4fee1 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetSearchBox.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetSearchBox.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetSearchBox : IRequest<SearchBoxModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Catalog/GetVendor.cs b/src/Web/Grand.Web/Features/Models/Catalog/GetVendor.cs
index 1d2c31378..d37e06814 100644
--- a/src/Web/Grand.Web/Features/Models/Catalog/GetVendor.cs
+++ b/src/Web/Grand.Web/Features/Models/Catalog/GetVendor.cs
@@ -9,7 +9,7 @@ namespace Grand.Web.Features.Models.Catalog;
public class GetVendor : IRequest<VendorModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public Domain.Vendors.Vendor Vendor { get; set; }
public CatalogPagingFilteringModel Command { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetBillingAddress.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetBillingAddress.cs
index e327eabdc..a197aeee7 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetBillingAddress.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetBillingAddress.cs
@@ -17,7 +17,7 @@ public class GetBillingAddress : IRequest<CheckoutBillingAddressModel>
public bool PrePopulateNewAddressWithCustomerFields { get; set; }
public IList<CustomAttribute> OverrideAttributes { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetConfirmOrder.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetConfirmOrder.cs
index 097495674..a875159ad 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetConfirmOrder.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetConfirmOrder.cs
@@ -11,6 +11,6 @@ public class GetConfirmOrder : IRequest<CheckoutConfirmModel>
{
public Customer Customer { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetMinOrderPlaceIntervalValid.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetMinOrderPlaceIntervalValid.cs
index 5ef6b6af9..a841fe1b4 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetMinOrderPlaceIntervalValid.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetMinOrderPlaceIntervalValid.cs
@@ -7,5 +7,5 @@ namespace Grand.Web.Features.Models.Checkout;
public class GetMinOrderPlaceIntervalValid : IRequest<bool>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetPaymentMethod.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetPaymentMethod.cs
index 9ce70df9a..d0ba60581 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetPaymentMethod.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetPaymentMethod.cs
@@ -11,7 +11,7 @@ namespace Grand.Web.Features.Models.Checkout;
public class GetPaymentMethod : IRequest<CheckoutPaymentMethodModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
public Language Language { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetShippingAddress.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetShippingAddress.cs
index d5e3060a5..e2d0ee53d 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetShippingAddress.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetShippingAddress.cs
@@ -14,7 +14,7 @@ public class GetShippingAddress : IRequest<CheckoutShippingAddressModel>
public bool PrePopulateNewAddressWithCustomerFields { get; set; }
public IList<CustomAttribute> OverrideAttributes { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Checkout/GetShippingMethod.cs b/src/Web/Grand.Web/Features/Models/Checkout/GetShippingMethod.cs
index aa8302b62..9b4afb012 100644
--- a/src/Web/Grand.Web/Features/Models/Checkout/GetShippingMethod.cs
+++ b/src/Web/Grand.Web/Features/Models/Checkout/GetShippingMethod.cs
@@ -14,7 +14,7 @@ public class GetShippingMethod : IRequest<CheckoutShippingMethodModel>
public IList<ShoppingCartItem> Cart { get; set; }
public Address ShippingAddress { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Common/GetAddressModel.cs b/src/Web/Grand.Web/Features/Models/Common/GetAddressModel.cs
index 9471d6973..1faa52187 100644
--- a/src/Web/Grand.Web/Features/Models/Common/GetAddressModel.cs
+++ b/src/Web/Grand.Web/Features/Models/Common/GetAddressModel.cs
@@ -17,6 +17,6 @@ public class GetAddressModel : IRequest<AddressModel>
public bool PrePopulateWithCustomerFields { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public IList<CustomAttribute> OverrideAttributes { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Common/GetPrivacyPreference.cs b/src/Web/Grand.Web/Features/Models/Common/GetPrivacyPreference.cs
index 7f23818cf..77dcdea70 100644
--- a/src/Web/Grand.Web/Features/Models/Common/GetPrivacyPreference.cs
+++ b/src/Web/Grand.Web/Features/Models/Common/GetPrivacyPreference.cs
@@ -8,5 +8,5 @@ namespace Grand.Web.Features.Models.Common;
public class GetPrivacyPreference : IRequest<IList<PrivacyPreferenceModel>>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Common/GetSitemap.cs b/src/Web/Grand.Web/Features/Models/Common/GetSitemap.cs
index af20709e2..3bbb4f0f4 100644
--- a/src/Web/Grand.Web/Features/Models/Common/GetSitemap.cs
+++ b/src/Web/Grand.Web/Features/Models/Common/GetSitemap.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Common;
public class GetSitemap : IRequest<SitemapModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetAddressList.cs b/src/Web/Grand.Web/Features/Models/Customers/GetAddressList.cs
index 36df8d9bf..6c53fc24d 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetAddressList.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetAddressList.cs
@@ -8,7 +8,7 @@ namespace Grand.Web.Features.Models.Customers;
public class GetAddressList : IRequest<CustomerAddressListModel>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetCourses.cs b/src/Web/Grand.Web/Features/Models/Customers/GetCourses.cs
index fc1d3f5a5..25b87d2ff 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetCourses.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetCourses.cs
@@ -8,5 +8,5 @@ namespace Grand.Web.Features.Models.Customers;
public class GetCourses : IRequest<CoursesModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetDownloadableProducts.cs b/src/Web/Grand.Web/Features/Models/Customers/GetDownloadableProducts.cs
index f2ac488b4..f7a7b8d72 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetDownloadableProducts.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetDownloadableProducts.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Customers;
public class GetDownloadableProducts : IRequest<CustomerDownloadableProductsModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetInfo.cs b/src/Web/Grand.Web/Features/Models/Customers/GetInfo.cs
index ccd4ffa63..c27422cf7 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetInfo.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetInfo.cs
@@ -11,7 +11,7 @@ public class GetInfo : IRequest<CustomerInfoModel>
{
public CustomerInfoModel Model { get; set; }
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public bool ExcludeProperties { get; set; }
public IList<CustomAttribute> OverrideCustomCustomerAttributes { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetNavigation.cs b/src/Web/Grand.Web/Features/Models/Customers/GetNavigation.cs
index 786f3b736..d74bc7bb4 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetNavigation.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetNavigation.cs
@@ -11,6 +11,6 @@ public class GetNavigation : IRequest<CustomerNavigationModel>
public int SelectedTabId { get; set; }
public Customer Customer { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Domain.Vendors.Vendor Vendor { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetRegister.cs b/src/Web/Grand.Web/Features/Models/Customers/GetRegister.cs
index bffa3b16c..09f7283bb 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetRegister.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetRegister.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Features.Models.Customers;
public class GetRegister : IRequest<RegisterModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public RegisterModel Model { get; set; }
public bool ExcludeProperties { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Customers/GetTwoFactorAuthentication.cs b/src/Web/Grand.Web/Features/Models/Customers/GetTwoFactorAuthentication.cs
index a71dd2958..b6eabafa6 100644
--- a/src/Web/Grand.Web/Features/Models/Customers/GetTwoFactorAuthentication.cs
+++ b/src/Web/Grand.Web/Features/Models/Customers/GetTwoFactorAuthentication.cs
@@ -10,5 +10,5 @@ public class GetTwoFactorAuthentication : IRequest<CustomerInfoModel.TwoFactorAu
{
public Customer Customer { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Orders/GetCustomerLoyaltyPoints.cs b/src/Web/Grand.Web/Features/Models/Orders/GetCustomerLoyaltyPoints.cs
index 6efc420a1..d61631edf 100644
--- a/src/Web/Grand.Web/Features/Models/Orders/GetCustomerLoyaltyPoints.cs
+++ b/src/Web/Grand.Web/Features/Models/Orders/GetCustomerLoyaltyPoints.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Orders;
public class GetCustomerLoyaltyPoints : IRequest<CustomerLoyaltyPointsModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Orders/GetCustomerOrderList.cs b/src/Web/Grand.Web/Features/Models/Orders/GetCustomerOrderList.cs
index 3ef084bfc..35a5873d7 100644
--- a/src/Web/Grand.Web/Features/Models/Orders/GetCustomerOrderList.cs
+++ b/src/Web/Grand.Web/Features/Models/Orders/GetCustomerOrderList.cs
@@ -9,7 +9,7 @@ namespace Grand.Web.Features.Models.Orders;
public class GetCustomerOrderList : IRequest<CustomerOrderListModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
public OrderPagingModel Command { get; set; } = new();
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturn.cs b/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturn.cs
index 59c457c20..d72a545f2 100644
--- a/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturn.cs
+++ b/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturn.cs
@@ -10,5 +10,5 @@ public class GetMerchandiseReturn : IRequest<MerchandiseReturnModel>
{
public Order Order { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturns.cs b/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturns.cs
index 8ce315ca2..409d515c7 100644
--- a/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturns.cs
+++ b/src/Web/Grand.Web/Features/Models/Orders/GetMerchandiseReturns.cs
@@ -9,6 +9,6 @@ namespace Grand.Web.Features.Models.Orders;
public class GetMerchandiseReturns : IRequest<CustomerMerchandiseReturnsModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Language Language { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsAttributeChange.cs b/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsAttributeChange.cs
index 1216f21a7..2438d788d 100644
--- a/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsAttributeChange.cs
+++ b/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsAttributeChange.cs
@@ -11,7 +11,7 @@ public class GetProductDetailsAttributeChange : IRequest<ProductDetailsAttribute
{
public Customer Customer { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Product Product { get; set; }
public ProductModel Model { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsPage.cs b/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsPage.cs
index dc6f26647..0f5ad2659 100644
--- a/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsPage.cs
+++ b/src/Web/Grand.Web/Features/Models/Products/GetProductDetailsPage.cs
@@ -8,7 +8,7 @@ namespace Grand.Web.Features.Models.Products;
public class GetProductDetailsPage : IRequest<ProductDetailsModel>
{
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Product Product { get; set; }
public ShoppingCartItem UpdateCartItem { get; set; }
public bool IsAssociatedProduct { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/Products/GetProductReviewOverview.cs b/src/Web/Grand.Web/Features/Models/Products/GetProductReviewOverview.cs
index ded50e0e2..7e5ff2553 100644
--- a/src/Web/Grand.Web/Features/Models/Products/GetProductReviewOverview.cs
+++ b/src/Web/Grand.Web/Features/Models/Products/GetProductReviewOverview.cs
@@ -10,5 +10,5 @@ public class GetProductReviewOverview : IRequest<ProductReviewOverviewModel>
{
public Product Product { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/Products/GetProductReviews.cs b/src/Web/Grand.Web/Features/Models/Products/GetProductReviews.cs
index ddb13deeb..cb692ff65 100644
--- a/src/Web/Grand.Web/Features/Models/Products/GetProductReviews.cs
+++ b/src/Web/Grand.Web/Features/Models/Products/GetProductReviews.cs
@@ -11,7 +11,7 @@ public class GetProductReviews : IRequest<ProductReviewsModel>
{
public Product Product { get; set; }
public Language Language { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Customer Customer { get; set; }
public int Size { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetAddToCart.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetAddToCart.cs
index f91dc8874..45c270f9b 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetAddToCart.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetAddToCart.cs
@@ -17,7 +17,7 @@ public class GetAddToCart : IRequest<AddToCartModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public ShoppingCartItem ShoppingCartItem { get; set; }
public TaxDisplayType TaxDisplayType { get; set; }
public int Quantity { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShipping.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShipping.cs
index 20518ea69..9028aa331 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShipping.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShipping.cs
@@ -13,7 +13,7 @@ public class GetEstimateShipping : IRequest<EstimateShippingModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
public bool SetEstimateShippingDefaultAddress { get; set; } = true;
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShippingResult.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShippingResult.cs
index 2d4d0d9e4..ded678cca 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShippingResult.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetEstimateShippingResult.cs
@@ -10,7 +10,7 @@ namespace Grand.Web.Features.Models.ShoppingCart;
public class GetEstimateShippingResult : IRequest<EstimateShippingResultModel>
{
public Customer Customer { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public Currency Currency { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniShoppingCart.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniShoppingCart.cs
index 640fde7e7..eb6f38d6e 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniShoppingCart.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniShoppingCart.cs
@@ -13,6 +13,6 @@ public class GetMiniShoppingCart : IRequest<MiniShoppingCartModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public TaxDisplayType TaxDisplayType { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniWishlist.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniWishlist.cs
index e7e295957..625f14d3d 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniWishlist.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetMiniWishlist.cs
@@ -13,6 +13,6 @@ public class GetMiniWishlist : IRequest<MiniWishlistModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetOrderTotals.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetOrderTotals.cs
index 05574081a..6153ad987 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetOrderTotals.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetOrderTotals.cs
@@ -14,7 +14,7 @@ public class GetOrderTotals : IRequest<OrderTotalsModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public TaxDisplayType TaxDisplayType { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
public bool IsEditable { get; set; }
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetShoppingCart.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetShoppingCart.cs
index e1d9c802f..c2a36f38c 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetShoppingCart.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetShoppingCart.cs
@@ -14,7 +14,7 @@ public class GetShoppingCart : IRequest<ShoppingCartModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public TaxDisplayType TaxDisplayType { get; set; }
public IList<ShoppingCartItem> Cart { get; set; }
public bool IsEditable { get; set; } = true;
diff --git a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetWishlist.cs b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetWishlist.cs
index 89fa5175a..f64394702 100644
--- a/src/Web/Grand.Web/Features/Models/ShoppingCart/GetWishlist.cs
+++ b/src/Web/Grand.Web/Features/Models/ShoppingCart/GetWishlist.cs
@@ -14,7 +14,7 @@ public class GetWishlist : IRequest<WishlistModel>
public Customer Customer { get; set; }
public Language Language { get; set; }
public Currency Currency { get; set; }
- public Store Store { get; set; }
+ public Domain.Stores.Store Store { get; set; }
public TaxDisplayType TaxDisplayType { get; set; }
public bool IsEditable { get; set; } = true;
public IList<ShoppingCartItem> Cart { get; set; }
diff --git a/src/Web/Grand.Web/Grand.Web.csproj b/src/Web/Grand.Web/Grand.Web.csproj
index 85d10ff9e..f0c2420e1 100644
--- a/src/Web/Grand.Web/Grand.Web.csproj
+++ b/src/Web/Grand.Web/Grand.Web.csproj
@@ -25,6 +25,7 @@
<ProjectReference Include="..\Grand.Web.Common\Grand.Web.Common.csproj" />
<ProjectReference Include="..\Grand.Web.Admin\Grand.Web.Admin.csproj" />
<ProjectReference Include="..\Grand.Web.Vendor\Grand.Web.Vendor.csproj" />
+ <ProjectReference Include="..\Grand.Web.Store\Grand.Web.Store.csproj" />
</ItemGroup>
<ItemGroup>
diff --git a/src/Web/Grand.Web/Validators/Blogs/AddBlogCommentValidator.cs b/src/Web/Grand.Web/Validators/Blogs/AddBlogCommentValidator.cs
index 02a5bca21..467c24388 100644
--- a/src/Web/Grand.Web/Validators/Blogs/AddBlogCommentValidator.cs
+++ b/src/Web/Grand.Web/Validators/Blogs/AddBlogCommentValidator.cs
@@ -4,10 +4,11 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Blogs;
+using Grand.Domain.Common;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Blogs;
@@ -19,7 +20,7 @@ public class AddBlogCommentValidator : BaseGrandValidator<AddBlogCommentModel>
IEnumerable<IValidatorConsumer<AddBlogCommentModel>> validators,
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
CaptchaSettings captchaSettings, IHttpContextAccessor httpcontextAccessor,
- GoogleReCaptchaValidator googleReCaptchaValidator,
+ IGoogleReCaptchaValidator googleReCaptchaValidator,
BlogSettings blogSettings,
IGroupService groupService, IContextAccessor contextAccessor, IBlogService blogService, IAclService aclService,
ITranslationService translationService)
diff --git a/src/Web/Grand.Web/Validators/Catalog/ProductAskQuestionSimpleValidator.cs b/src/Web/Grand.Web/Validators/Catalog/ProductAskQuestionSimpleValidator.cs
index 7cb9ea957..8328a9a7e 100644
--- a/src/Web/Grand.Web/Validators/Catalog/ProductAskQuestionSimpleValidator.cs
+++ b/src/Web/Grand.Web/Validators/Catalog/ProductAskQuestionSimpleValidator.cs
@@ -2,9 +2,10 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Catalog;
@@ -17,7 +18,7 @@ public class ProductAskQuestionSimpleValidator : BaseGrandValidator<ProductAskQu
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
CaptchaSettings captchaSettings, CatalogSettings catalogSettings,
IProductService productService,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Catalog/ProductEmailAFriendValidator.cs b/src/Web/Grand.Web/Validators/Catalog/ProductEmailAFriendValidator.cs
index 3c1ca0544..4fa2705ff 100644
--- a/src/Web/Grand.Web/Validators/Catalog/ProductEmailAFriendValidator.cs
+++ b/src/Web/Grand.Web/Validators/Catalog/ProductEmailAFriendValidator.cs
@@ -3,6 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
diff --git a/src/Web/Grand.Web/Validators/Catalog/ProductReviewsValidator.cs b/src/Web/Grand.Web/Validators/Catalog/ProductReviewsValidator.cs
index 3345ba399..9779647a5 100644
--- a/src/Web/Grand.Web/Validators/Catalog/ProductReviewsValidator.cs
+++ b/src/Web/Grand.Web/Validators/Catalog/ProductReviewsValidator.cs
@@ -4,11 +4,12 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Catalog;
+using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Catalog;
@@ -40,7 +41,7 @@ public class ProductReviewsValidator : BaseGrandValidator<ProductReviewsModel>
IProductReviewService productReviewService,
CaptchaSettings captchaSettings, CatalogSettings catalogSettings,
IContextAccessor contextAccessor,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Contact/ContactUsValidator.cs b/src/Web/Grand.Web/Validators/Contact/ContactUsValidator.cs
index dc1b29109..e9a54cb81 100644
--- a/src/Web/Grand.Web/Validators/Contact/ContactUsValidator.cs
+++ b/src/Web/Grand.Web/Validators/Contact/ContactUsValidator.cs
@@ -7,6 +7,7 @@ using Grand.Domain.Common;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Security.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Contact;
@@ -28,7 +29,7 @@ public class ContactUsValidator : BaseGrandValidator<ContactUsModel>
IContextAccessor contextAccessor,
ITranslationService translationService, CommonSettings commonSettings,
CaptchaSettings captchaSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator)
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator)
: base(validators)
{
_contactAttributeParser = contactAttributeParser;
diff --git a/src/Web/Grand.Web/Validators/Customer/LoginValidator.cs b/src/Web/Grand.Web/Validators/Customer/LoginValidator.cs
index 2fc0cbcc6..ba33fa992 100644
--- a/src/Web/Grand.Web/Validators/Customer/LoginValidator.cs
+++ b/src/Web/Grand.Web/Validators/Customer/LoginValidator.cs
@@ -4,10 +4,11 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Customer;
using MediatR;
@@ -21,7 +22,7 @@ public class LoginValidator : BaseGrandValidator<LoginModel>
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
ICustomerService customerService, IGroupService groupService, IEncryptionService encryptionService,
ITranslationService translationService, CustomerSettings customerSettings, CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator)
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator)
: base(validators)
{
if (!customerSettings.UsernamesEnabled)
@@ -66,24 +67,24 @@ public class LoginValidator : BaseGrandValidator<LoginModel>
context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials.LockedOut"));
break;
case not null:
- {
- var pwd = customer.PasswordFormatId switch {
- PasswordFormat.Clear => x.Password,
- PasswordFormat.Encrypted => encryptionService.EncryptText(x.Password, customer.PasswordSalt),
- PasswordFormat.Hashed => encryptionService.CreatePasswordHash(x.Password, customer.PasswordSalt,
- customerSettings.HashedPasswordFormat),
- _ => throw new Exception("PasswordFormat not supported")
- };
- var isValid = pwd == customer.Password;
- if (!isValid)
{
- context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials"));
- await contextAccessor.HttpContext!.RequestServices.GetRequiredService<IMediator>()
- .Publish(new CustomerLoginFailedEvent(customer), _);
- }
+ var pwd = customer.PasswordFormatId switch {
+ PasswordFormat.Clear => x.Password,
+ PasswordFormat.Encrypted => encryptionService.EncryptText(x.Password, customer.PasswordSalt),
+ PasswordFormat.Hashed => encryptionService.CreatePasswordHash(x.Password, customer.PasswordSalt,
+ customerSettings.HashedPasswordFormat),
+ _ => throw new Exception("PasswordFormat not supported")
+ };
+ var isValid = pwd == customer.Password;
+ if (!isValid)
+ {
+ context.AddFailure(translationService.GetResource("Account.Login.WrongCredentials"));
+ await contextAccessor.HttpContext!.RequestServices.GetRequiredService<IMediator>()
+ .Publish(new CustomerLoginFailedEvent(customer), _);
+ }
- break;
- }
+ break;
+ }
}
});
diff --git a/src/Web/Grand.Web/Validators/Customer/PasswordRecoveryValidator.cs b/src/Web/Grand.Web/Validators/Customer/PasswordRecoveryValidator.cs
index c1fa62981..9cc23f971 100644
--- a/src/Web/Grand.Web/Validators/Customer/PasswordRecoveryValidator.cs
+++ b/src/Web/Grand.Web/Validators/Customer/PasswordRecoveryValidator.cs
@@ -1,9 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Common;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Customer;
@@ -15,7 +16,7 @@ public class PasswordRecoveryValidator : BaseGrandValidator<PasswordRecoveryMode
IEnumerable<IValidatorConsumer<PasswordRecoveryModel>> validators,
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
ICustomerService customerService, CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Customer/RegisterValidator.cs b/src/Web/Grand.Web/Validators/Customer/RegisterValidator.cs
index 249b3a623..9bd0bb8c5 100644
--- a/src/Web/Grand.Web/Validators/Customer/RegisterValidator.cs
+++ b/src/Web/Grand.Web/Validators/Customer/RegisterValidator.cs
@@ -2,12 +2,13 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
+using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
+using Grand.SharedKernel.Captcha;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Common.Security.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Features.Models.Customers;
using Grand.Web.Models.Customer;
@@ -23,7 +24,7 @@ public class RegisterValidator : BaseGrandValidator<RegisterModel>
ITranslationService translationService,
ICountryService countryService,
CustomerSettings customerSettings, CaptchaSettings captchaSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
IMediator mediator, ICustomerAttributeParser customerAttributeParser,
ICustomerService customerService,
IGroupService groupService, IContextAccessor contextAccessor
@@ -129,8 +130,7 @@ public class RegisterValidator : BaseGrandValidator<RegisterModel>
RuleFor(x => x).CustomAsync(async (x, context, _) =>
{
- var customerAttributes = await mediator.Send(new GetParseCustomAttributes
- { SelectedAttributes = x.SelectedAttributes }, _);
+ var customerAttributes = await mediator.Send(new GetParseCustomAttributes { SelectedAttributes = x.SelectedAttributes }, _);
var customerAttributeWarnings = await customerAttributeParser.GetAttributeWarnings(customerAttributes);
foreach (var error in customerAttributeWarnings) context.AddFailure(error);
diff --git a/src/Web/Grand.Web/Validators/Knowledgebase/KnowledgebaseArticleValidator.cs b/src/Web/Grand.Web/Validators/Knowledgebase/KnowledgebaseArticleValidator.cs
index b4df9aa77..1d1697e24 100644
--- a/src/Web/Grand.Web/Validators/Knowledgebase/KnowledgebaseArticleValidator.cs
+++ b/src/Web/Grand.Web/Validators/Knowledgebase/KnowledgebaseArticleValidator.cs
@@ -2,11 +2,12 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
using Grand.Domain.Knowledgebase;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Knowledgebase;
@@ -20,7 +21,7 @@ public class KnowledgebaseArticleValidator : BaseGrandValidator<KnowledgebaseArt
IContextAccessor contextAccessor, IGroupService groupService,
IKnowledgebaseService knowledgebaseService, KnowledgebaseSettings knowledgebaseSettings,
CaptchaSettings captchaSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/News/AddNewsCommentValidator.cs b/src/Web/Grand.Web/Validators/News/AddNewsCommentValidator.cs
index 7bbdf7eca..8ce21145c 100644
--- a/src/Web/Grand.Web/Validators/News/AddNewsCommentValidator.cs
+++ b/src/Web/Grand.Web/Validators/News/AddNewsCommentValidator.cs
@@ -2,11 +2,12 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
using Grand.Domain.News;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.News;
@@ -19,7 +20,7 @@ public class AddNewsCommentValidator : BaseGrandValidator<AddNewsCommentModel>
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
IContextAccessor contextAccessor, IGroupService groupService, INewsService newsService,
CaptchaSettings captchaSettings, NewsSettings newsSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/ShoppingCart/WishlistEmailAFriendValidator.cs b/src/Web/Grand.Web/Validators/ShoppingCart/WishlistEmailAFriendValidator.cs
index 6827dd83c..4ef80b569 100644
--- a/src/Web/Grand.Web/Validators/ShoppingCart/WishlistEmailAFriendValidator.cs
+++ b/src/Web/Grand.Web/Validators/ShoppingCart/WishlistEmailAFriendValidator.cs
@@ -1,11 +1,12 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.ShoppingCart;
@@ -18,7 +19,7 @@ public class WishlistEmailAFriendValidator : BaseGrandValidator<WishlistEmailAFr
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
IContextAccessor contextAccessor, IGroupService groupService,
CaptchaSettings captchaSettings, ShoppingCartSettings shoppingCartSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Vendors/ApplyVendorValidator.cs b/src/Web/Grand.Web/Validators/Vendors/ApplyVendorValidator.cs
index 9c2126cf9..1d3fbbd2d 100644
--- a/src/Web/Grand.Web/Validators/Vendors/ApplyVendorValidator.cs
+++ b/src/Web/Grand.Web/Validators/Vendors/ApplyVendorValidator.cs
@@ -1,10 +1,11 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
+using Grand.Domain.Common;
using Grand.Domain.Vendors;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Vendors;
@@ -18,7 +19,7 @@ public class ApplyVendorValidator : BaseGrandValidator<ApplyVendorModel>
IEnumerable<IValidatorConsumer<VendorAddressModel>> addressvalidators,
ITranslationService translationService, ICountryService countryService,
CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
VendorSettings addressSettings)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Vendors/ContactVendorValidator.cs b/src/Web/Grand.Web/Validators/Vendors/ContactVendorValidator.cs
index 30a2fe345..0d886b193 100644
--- a/src/Web/Grand.Web/Validators/Vendors/ContactVendorValidator.cs
+++ b/src/Web/Grand.Web/Validators/Vendors/ContactVendorValidator.cs
@@ -3,6 +3,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Common;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Security.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Vendors;
@@ -15,7 +16,7 @@ public class ContactVendorValidator : BaseGrandValidator<ContactVendorModel>
IEnumerable<IValidatorConsumer<ContactVendorModel>> validators,
IEnumerable<IValidatorConsumer<ICaptchaValidModel>> validatorsCaptcha,
CaptchaSettings captchaSettings,
- IHttpContextAccessor contextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor contextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService, CommonSettings commonSettings)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Validators/Vendors/VendorReviewsValidator.cs b/src/Web/Grand.Web/Validators/Vendors/VendorReviewsValidator.cs
index f561e664c..e70eda3bc 100644
--- a/src/Web/Grand.Web/Validators/Vendors/VendorReviewsValidator.cs
+++ b/src/Web/Grand.Web/Validators/Vendors/VendorReviewsValidator.cs
@@ -3,12 +3,13 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Queries.Checkout.Orders;
+using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
using Grand.Infrastructure.Models;
using Grand.Infrastructure.Validators;
-using Grand.Web.Common.Security.Captcha;
+using Grand.SharedKernel.Captcha;
using Grand.Web.Common.Validators;
using Grand.Web.Models.Vendors;
using MediatR;
@@ -23,7 +24,7 @@ public class VendorReviewsValidator : BaseGrandValidator<VendorReviewsModel>
IMediator mediator,
IGroupService groupService, IContextAccessor contextAccessor, IVendorService vendorService,
CaptchaSettings captchaSettings, VendorSettings vendorSettings,
- IHttpContextAccessor httpcontextAccessor, GoogleReCaptchaValidator googleReCaptchaValidator,
+ IHttpContextAccessor httpcontextAccessor, IGoogleReCaptchaValidator googleReCaptchaValidator,
ITranslationService translationService)
: base(validators)
{
diff --git a/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml b/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
index 7d717a23b..3af7bd23a 100644
--- a/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
@@ -11,6 +11,7 @@
var isCustomerImpersonated = contextAccessor.WorkContext.OriginalCustomerIfImpersonated != null;
var isAdminAccess = await permissionService.Authorize(StandardPermission.ManageAccessAdminPanel);
var isVendor = contextAccessor.WorkContext.CurrentVendor != null;
+ var isStaffStore = contextAccessor.WorkContext.CurrentCustomer.StaffStoreId != null;
}
@await Component.InvokeAsync("Widget", new { widgetZone = "header_links_before" })
@@ -39,7 +40,13 @@
<span class="text text-uppercase ml-3">@Loc["vendor.portal"]</span>
</a>
}
-
+ @if (isStaffStore)
+ {
+ <a class="btn btn-outline-secondary w-100 mb-2" href="@Url.Content("~/Store")">
+ <b-icon icon="gear"></b-icon>
+ <span class="text text-uppercase ml-3">@Loc["store.portal"]</span>
+ </a>
+ }
@if (!string.IsNullOrEmpty(pagebuilder.EditPageUrl))
{
<a target="_blank" class="btn btn-outline-secondary w-100 mb-2" href="@pagebuilder.EditPageUrl">