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.

Update shipping methods to support multi-store context (#707)

Krzysztof Pajak57ced169cd59
diff --git a/src/Plugins/Shipping.ByWeight/ByWeightShippingProvider.cs b/src/Plugins/Shipping.ByWeight/ByWeightShippingProvider.cs
index ae5873311..484f70d6c 100644
--- a/src/Plugins/Shipping.ByWeight/ByWeightShippingProvider.cs
+++ b/src/Plugins/Shipping.ByWeight/ByWeightShippingProvider.cs
@@ -230,8 +230,7 @@ public class ByWeightShippingCalcPlugin : IShippingRateCalculationProvider
var weight = await GetTotalWeight(getShippingOptionRequest);
- var shippingMethods =
- await _shippingMethodService.GetAllShippingMethods(countryId, _contextAccessor.WorkContext.CurrentCustomer);
+ var shippingMethods = await _shippingMethodService.GetAllShippingMethods(countryId, _contextAccessor.WorkContext.CurrentCustomer, _contextAccessor.StoreContext.CurrentStore.Id);
foreach (var shippingMethod in shippingMethods)
{
double? rate = null;
diff --git a/src/Plugins/Shipping.FixedRateShipping/FixedRateShippingProvider.cs b/src/Plugins/Shipping.FixedRateShipping/FixedRateShippingProvider.cs
index 1323187b8..87280904a 100644
--- a/src/Plugins/Shipping.FixedRateShipping/FixedRateShippingProvider.cs
+++ b/src/Plugins/Shipping.FixedRateShipping/FixedRateShippingProvider.cs
@@ -63,8 +63,7 @@ public class FixedRateShippingProvider : IShippingRateCalculationProvider
!string.IsNullOrEmpty(getShippingOptionRequest.ShippingAddress.CountryId)
? getShippingOptionRequest.ShippingAddress.CountryId
: "";
- var shippingMethods =
- await _shippingMethodService.GetAllShippingMethods(restrictByCountryId, getShippingOptionRequest.Customer);
+ var shippingMethods = await _shippingMethodService.GetAllShippingMethods(restrictByCountryId, getShippingOptionRequest.Customer, _contextAccessor.StoreContext.CurrentStore.Id);
foreach (var shippingMethod in shippingMethods)
{
var shippingOption = new ShippingOption {