Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1b6cc76
Add ShippingController to Grand.Web.Store for delivery dates, warehou…
Copilot May 25, 2026
398a544
Address code review: clarify PickupPoint CanManage logic with comments
Copilot May 25, 2026
56d1a1b
Refactor DeliveryDate and Warehouse to single-store StoreId pattern; …
Copilot May 25, 2026
0dff22b
Remove outdated comment about LimitedToStores/Stores in ShippingContr…
Copilot May 25, 2026
ce90981
Add full CRUD (create/edit/delete) for warehouse, delivery date, pick…
Copilot May 25, 2026
d383629
Address code review: use service storeId parameter in list actions; f…
Copilot May 25, 2026
259c519
Remove cache from GetAllDeliveryDates
Copilot May 27, 2026
c3e5885
Remove cache from GetAllWarehouses/GetAllPickupPoints; move Where bef…
Copilot May 27, 2026
df69743
Refactor storeId filtering and pagination logic
KrzysztofPajak May 27, 2026
88a4c54
Add StoreId support to Admin Warehouse/DeliveryDate/PickupPoint shipp…
Copilot May 27, 2026
29ed403
Add pageable configuration to grids in multiple files
KrzysztofPajak May 27, 2026
f623ad4
Add GetStatesByCountryId action to HomeController
KrzysztofPajak May 27, 2026
d34747a
Merge branch 'copilot/add-delivery-dates-warehouses-pickup-points-con…
KrzysztofPajak May 27, 2026
d5e3c3f
Potential fix for pull request finding 'Nested 'if' statements can be…
KrzysztofPajak May 27, 2026
4a4af4c
Add Shipping Settings to Grand.Web.Store ShippingController
Copilot May 27, 2026
42aaa67
Potential fix for pull request finding 'Dereferenced variable may be …
KrzysztofPajak May 27, 2026
c769562
Potential fix for pull request finding 'Missed ternary opportunity'
KrzysztofPajak May 27, 2026
cc9c849
Add Shipping Providers to Grand.Web.Store ShippingController
Copilot May 27, 2026
f631067
Refactor ShippingController to use CurrentStoreId
KrzysztofPajak May 27, 2026
eaaddf6
Merge branch 'copilot/add-delivery-dates-warehouses-pickup-points-con…
KrzysztofPajak May 27, 2026
382b65f
Changes before error encountered
Copilot May 27, 2026
55c7849
Revert "Changes before error encountered"
KrzysztofPajak May 27, 2026
d6d21ea
Add shipping methods with StoreId support to Grand.Web.Store and Gran…
Copilot May 27, 2026
75f6546
Add StoreName to DeliveryDate, Warehouse, PickupPoint list views in A…
Copilot May 31, 2026
12a1699
Optimize store lookup using dictionary in shipping list actions
Copilot May 31, 2026
4fa9b0f
Update permissions in StandardAdminSiteMap
KrzysztofPajak May 31, 2026
ab6ed3e
Remove Premium Themes section from settings page
KrzysztofPajak May 31, 2026
3f98c82
Remove cache from ShippingMethodService.GetAllShippingMethods and use…
Copilot May 31, 2026
5db0bf9
Merge branch 'copilot/add-delivery-dates-warehouses-pickup-points-con…
KrzysztofPajak May 31, 2026
ae7c504
Refactor ProductViewModelService and ProductController
KrzysztofPajak May 31, 2026
9fd16d2
Potential fix for pull request finding
KrzysztofPajak May 31, 2026
0861bce
Add StoreName to shipping methods list; add per-store Restrictions to…
Copilot May 31, 2026
e8dde44
Revert changes
KrzysztofPajak May 31, 2026
cf16ab7
Fix admin-label to use StoreId in shipping partials; improve SaveRest…
Copilot May 31, 2026
e6e5e2b
Store Shipping Restrictions: filter to store-owner methods only
Copilot May 31, 2026
869f2cc
Potential fix for pull request finding 'Inefficient use of ContainsKey'
KrzysztofPajak May 31, 2026
8bea088
Potential fix for pull request finding 'Inefficient use of ContainsKey'
KrzysztofPajak May 31, 2026
ee2ae0e
Merge branch 'copilot/add-delivery-dates-warehouses-pickup-points-con…
KrzysztofPajak May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Data;
using Grand.Domain;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Caching.Constants;
Expand Down Expand Up @@ -51,16 +52,19 @@ public virtual Task<DeliveryDate> GetDeliveryDateById(string deliveryDateId)
/// <summary>
/// Gets all delivery dates
/// </summary>
/// <param name="storeId">Store identifier; empty to return all delivery dates</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Delivery dates</returns>
public virtual async Task<IList<DeliveryDate>> GetAllDeliveryDates()
public virtual async Task<IPagedList<DeliveryDate>> GetAllDeliveryDates(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue)
{
return await _cacheBase.GetAsync(CacheKey.DELIVERYDATE_ALL, async () =>
{
var query = from dd in _deliveryDateRepository.Table
orderby dd.DisplayOrder
select dd;
return await Task.FromResult(query.ToList());
});
var query = _deliveryDateRepository.Table;

if (!string.IsNullOrEmpty(storeId))
query = query.Where(dd => dd.StoreId == storeId);
query = query.OrderBy(dd => dd.DisplayOrder);
Comment thread
KrzysztofPajak marked this conversation as resolved.

return await PagedList<DeliveryDate>.Create(query, pageIndex, pageSize);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Data;
using Grand.Domain;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Caching.Constants;
Expand Down Expand Up @@ -51,16 +52,19 @@ public virtual Task<PickupPoint> GetPickupPointById(string pickupPointId)
/// <summary>
/// Gets all pickup points
/// </summary>
/// <param name="storeId">Store identifier; empty to return all pickup points</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Warehouses</returns>
public virtual async Task<IList<PickupPoint>> GetAllPickupPoints()
public virtual async Task<IPagedList<PickupPoint>> GetAllPickupPoints(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue)
{
return await _cacheBase.GetAsync(CacheKey.PICKUPPOINTS_ALL, async () =>
{
var query = from pp in _pickupPointsRepository.Table
orderby pp.DisplayOrder
select pp;
return await Task.FromResult(query.ToList());
});
var query = _pickupPointsRepository.Table;

if (!string.IsNullOrEmpty(storeId))
query = query.Where(pp => pp.StoreId == storeId);

Comment thread
KrzysztofPajak marked this conversation as resolved.
query = query.OrderBy(pp => pp.DisplayOrder);
return await PagedList<PickupPoint>.Create(query, pageIndex, pageSize);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ public virtual Task<ShippingMethod> GetShippingMethodById(string shippingMethodI
/// </summary>
/// <param name="filterByCountryId">The country ident to filter by</param>
/// <param name="customer"></param>
/// <param name="storeId">The store identifier to filter by</param>
/// <returns>Shipping methods</returns>
public virtual async Task<IList<ShippingMethod>> GetAllShippingMethods(string filterByCountryId = "",
Customer customer = null)
Customer customer = null, string storeId = "")
{
var shippingMethods = await _cacheBase.GetAsync(CacheKey.SHIPPINGMETHOD_ALL, async () =>
{
var query = from sm in _shippingMethodRepository.Table
orderby sm.DisplayOrder
select sm;
return await Task.FromResult(query.ToList());
});
var query = _shippingMethodRepository.Table;

if (!string.IsNullOrEmpty(storeId))
query = query.Where(sm => sm.StoreId == storeId || string.IsNullOrEmpty(sm.StoreId));

query = query.OrderBy(sm => sm.DisplayOrder);

var shippingMethods = await Task.FromResult(query.ToList());

if (!string.IsNullOrEmpty(filterByCountryId))
shippingMethods = shippingMethods.Where(x => !x.CountryRestrictionExists(filterByCountryId)).ToList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Data;
using Grand.Domain;
using Grand.Domain.Shipping;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Caching.Constants;
Expand Down Expand Up @@ -51,16 +52,19 @@ public virtual Task<Warehouse> GetWarehouseById(string warehouseId)
/// <summary>
/// Gets all warehouses
/// </summary>
/// <param name="storeId">Store identifier; empty to return all warehouses</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Warehouses</returns>
public virtual async Task<IList<Warehouse>> GetAllWarehouses()
public virtual async Task<IPagedList<Warehouse>> GetAllWarehouses(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue)
{
return await _cacheBase.GetAsync(CacheKey.WAREHOUSES_ALL, async () =>
{
var query = from wh in _warehouseRepository.Table
orderby wh.DisplayOrder
select wh;
return await Task.FromResult(query.ToList());
});
var query = _warehouseRepository.Table;

if (!string.IsNullOrEmpty(storeId))
query = query.Where(wh => wh.StoreId == storeId);
query = query.OrderBy(wh => wh.DisplayOrder);
Comment thread
KrzysztofPajak marked this conversation as resolved.

return await PagedList<Warehouse>.Create(query, pageIndex, pageSize);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grand.Domain.Shipping;
using Grand.Domain;
using Grand.Domain.Shipping;

namespace Grand.Business.Core.Interfaces.Checkout.Shipping;

Expand All @@ -14,8 +15,11 @@ public interface IDeliveryDateService
/// <summary>
/// Gets all delivery dates
/// </summary>
/// <param name="storeId">Store identifier; empty to return all delivery dates</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Delivery dates</returns>
Task<IList<DeliveryDate>> GetAllDeliveryDates();
Task<IPagedList<DeliveryDate>> GetAllDeliveryDates(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue);

/// <summary>
/// Inserts a delivery date
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grand.Domain.Shipping;
using Grand.Domain;
using Grand.Domain.Shipping;

namespace Grand.Business.Core.Interfaces.Checkout.Shipping;

Expand All @@ -14,8 +15,11 @@ public interface IPickupPointService
/// <summary>
/// Gets all pickup points
/// </summary>
/// <param name="storeId">Store identifier; empty to return all pickup points</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>PickupPoints</returns>
Task<IList<PickupPoint>> GetAllPickupPoints();
Task<IPagedList<PickupPoint>> GetAllPickupPoints(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue);

/// <summary>
/// Gets active pickup points
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public interface IShippingMethodService
/// </summary>
/// <param name="filterByCountryId">The country identifier to filter by</param>
/// <param name="customer"></param>
/// <param name="storeId">The store identifier to filter by</param>
/// <returns>Shipping methods</returns>
Task<IList<ShippingMethod>> GetAllShippingMethods(string filterByCountryId = "", Customer customer = null);
Task<IList<ShippingMethod>> GetAllShippingMethods(string filterByCountryId = "", Customer customer = null, string storeId = "");

/// <summary>
/// Inserts a shipping method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grand.Domain.Shipping;
using Grand.Domain;
using Grand.Domain.Shipping;

namespace Grand.Business.Core.Interfaces.Checkout.Shipping;

Expand All @@ -14,8 +15,11 @@ public interface IWarehouseService
/// <summary>
/// Gets all warehouses
/// </summary>
/// <param name="storeId">Store identifier; empty to return all warehouses</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Warehouses</returns>
Task<IList<Warehouse>> GetAllWarehouses();
Task<IPagedList<Warehouse>> GetAllWarehouses(string storeId = "", int pageIndex = 0, int pageSize = int.MaxValue);

/// <summary>
/// Inserts a warehouse
Expand Down
5 changes: 5 additions & 0 deletions src/Core/Grand.Domain/Shipping/DeliveryDate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ public class DeliveryDate : BaseEntity, ITranslationEntity
/// Gets or sets the collection of locales
/// </summary>
public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();

/// <summary>
/// Gets or sets the store identifier. Empty means available to all stores.
/// </summary>
public string StoreId { get; set; }
}
5 changes: 5 additions & 0 deletions src/Core/Grand.Domain/Shipping/ShippingMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ public virtual ICollection<string> RestrictedGroups {
/// Gets or sets the collection of locales
/// </summary>
public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();

/// <summary>
/// Gets or sets the store identifier. Empty means available to all stores.
/// </summary>
public string StoreId { get; set; }
}
5 changes: 5 additions & 0 deletions src/Core/Grand.Domain/Shipping/Warehouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ public class Warehouse : BaseEntity
/// Gets or sets the display order
/// </summary>
public int DisplayOrder { get; set; }

/// <summary>
/// Gets or sets the store identifier. Empty means available to all stores.
/// </summary>
public string StoreId { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Grand.Business.Core.Interfaces.Storage;
using Grand.Data;
using Grand.Data.Tests.MongoDb;
using Grand.Domain;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Directory;
Expand Down Expand Up @@ -117,8 +118,8 @@ public async Task ExecuteTest_Import_Insert()

_deliveryDateServiceMock.Setup(c => c.GetDeliveryDateById(It.IsAny<string>()))
.Returns(Task.FromResult(new DeliveryDate()));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates())
.Returns(Task.FromResult<IList<DeliveryDate>>(new List<DeliveryDate> { new() }));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<DeliveryDate>>(new PagedList<DeliveryDate>(new List<DeliveryDate> { new() }, 0, int.MaxValue)));

_taxServiceMock.Setup(c => c.GetTaxCategoryById(It.IsAny<string>()))
.Returns(Task.FromResult(new TaxCategory()));
Expand All @@ -127,8 +128,8 @@ public async Task ExecuteTest_Import_Insert()

_warehouseServiceMock.Setup(c => c.GetWarehouseById(It.IsAny<string>()))
.Returns(Task.FromResult(new Warehouse()));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses())
.Returns(Task.FromResult<IList<Warehouse>>(new List<Warehouse> { new() }));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<Warehouse>>(new PagedList<Warehouse>(new List<Warehouse> { new() }, 0, int.MaxValue)));

_measureServiceMock.Setup(c => c.GetMeasureUnitById(It.IsAny<string>()))
.Returns(Task.FromResult(new MeasureUnit()));
Expand Down Expand Up @@ -180,8 +181,8 @@ public async Task ExecuteTest_Import_Update()

_deliveryDateServiceMock.Setup(c => c.GetDeliveryDateById(It.IsAny<string>()))
.Returns(Task.FromResult(new DeliveryDate()));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates())
.Returns(Task.FromResult<IList<DeliveryDate>>(new List<DeliveryDate> { new() }));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<DeliveryDate>>(new PagedList<DeliveryDate>(new List<DeliveryDate> { new() }, 0, int.MaxValue)));

_taxServiceMock.Setup(c => c.GetTaxCategoryById(It.IsAny<string>()))
.Returns(Task.FromResult(new TaxCategory()));
Expand All @@ -190,8 +191,8 @@ public async Task ExecuteTest_Import_Update()

_warehouseServiceMock.Setup(c => c.GetWarehouseById(It.IsAny<string>()))
.Returns(Task.FromResult(new Warehouse()));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses())
.Returns(Task.FromResult<IList<Warehouse>>(new List<Warehouse> { new() }));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<Warehouse>>(new PagedList<Warehouse>(new List<Warehouse> { new() }, 0, int.MaxValue)));

_measureServiceMock.Setup(c => c.GetMeasureUnitById(It.IsAny<string>()))
.Returns(Task.FromResult(new MeasureUnit()));
Expand Down Expand Up @@ -234,8 +235,8 @@ public async Task ExecuteTest_Import_Insert_Update()

_deliveryDateServiceMock.Setup(c => c.GetDeliveryDateById(It.IsAny<string>()))
.Returns(Task.FromResult(new DeliveryDate()));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates())
.Returns(Task.FromResult<IList<DeliveryDate>>(new List<DeliveryDate> { new() }));
_deliveryDateServiceMock.Setup(c => c.GetAllDeliveryDates(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<DeliveryDate>>(new PagedList<DeliveryDate>(new List<DeliveryDate> { new() }, 0, int.MaxValue)));

_taxServiceMock.Setup(c => c.GetTaxCategoryById(It.IsAny<string>()))
.Returns(Task.FromResult(new TaxCategory()));
Expand All @@ -244,8 +245,8 @@ public async Task ExecuteTest_Import_Insert_Update()

_warehouseServiceMock.Setup(c => c.GetWarehouseById(It.IsAny<string>()))
.Returns(Task.FromResult(new Warehouse()));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses())
.Returns(Task.FromResult<IList<Warehouse>>(new List<Warehouse> { new() }));
_warehouseServiceMock.Setup(c => c.GetAllWarehouses(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns(Task.FromResult<IPagedList<Warehouse>>(new PagedList<Warehouse>(new List<Warehouse> { new() }, 0, int.MaxValue)));

_measureServiceMock.Setup(c => c.GetMeasureUnitById(It.IsAny<string>()))
.Returns(Task.FromResult(new MeasureUnit()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
title: "@Loc["Admin.Configuration.Shipping.DeliveryDates.Fields.Name"]",
width: 300,
template: '<a class="k-link" href="EditDeliveryDate/#=Id#">#=kendo.htmlEncode(Name)#</a>',
}, {
field: "StoreName",
title: "@Loc["Admin.Configuration.Shipping.DeliveryDates.Fields.Store"]",
width: 200
}, {
field: "DisplayOrder",
title: "@Loc["Admin.Configuration.Shipping.DeliveryDates.Fields.DisplayOrder"]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
field: "Description",
title: "@Loc["Admin.Configuration.Shipping.Methods.Fields.Description"]",
width: 400
}, {
field: "StoreName",
title: "@Loc["Admin.Configuration.Shipping.Methods.Fields.Store"]",
width: 200
},{
field: "DisplayOrder",
title: "@Loc["Admin.Configuration.Shipping.Methods.Fields.DisplayOrder"]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
<span asp-validation-for="DisplayOrder"></span>
</div>
</div>
<div class="form-group">
<admin-label asp-for="StoreId"/>
<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>
</div>
<vc:admin-widget widget-zone="delivery_date_details_bottom" additional-data="Model"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
<span asp-validation-for="DisplayOrder"></span>
</div>
</div>
<div class="form-group">
<admin-label asp-for="StoreId"/>
<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>
Comment thread
KrzysztofPajak marked this conversation as resolved.
</div>
</div>
<vc:admin-widget widget-zone="shipping_method_details_bottom" additional-data="Model"/>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
<span asp-validation-for="DisplayOrder"></span>
</div>
</div>
<div class="form-group">
<admin-label asp-for="StoreId"/>
<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>
<vc:admin-widget widget-zone="warehouse_details_bottom" additional-data="Model"/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
title: "@Loc["Admin.Configuration.Shipping.PickupPoint.Fields.Name"]",
template: '<a class="k-link" href="EditPickupPoint/#=Id#">#=kendo.htmlEncode(Name)#</a>',
},
{
field: "StoreName",
title: "@Loc["Admin.Configuration.Shipping.PickupPoint.Fields.Stores"]",
},
{
field: "Description",
title: "@Loc["Admin.Configuration.Shipping.PickupPoint.Fields.Description"]"
Expand Down
Loading
Loading