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.

Shipping point - fix display shipping rate for other currency

support3bbef49146c1
diff --git a/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs b/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
index ab36f46ae..f343b77f9 100644
--- a/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Controllers/SelectedShippingPointController.cs
@@ -1,5 +1,6 @@
using Grand.Business.Catalog.Interfaces.Prices;
using Grand.Business.Common.Interfaces.Directory;
+using Grand.Infrastructure;
using Microsoft.AspNetCore.Mvc;
using Shipping.ShippingPoint.Models;
using Shipping.ShippingPoint.Services;
@@ -11,22 +12,34 @@ namespace Shipping.ShippingPoint.Controllers
private readonly IShippingPointService _shippingPointService;
private readonly ICountryService _countryService;
private readonly IPriceFormatter _priceFormatter;
+ private readonly IWorkContext _workContext;
+ private readonly ICurrencyService _currencyService;
- public SelectedShippingPointController(IShippingPointService shippingPointService, ICountryService countryService, IPriceFormatter priceFormatter)
+ public SelectedShippingPointController(
+ IShippingPointService shippingPointService,
+ ICountryService countryService,
+ IPriceFormatter priceFormatter,
+ IWorkContext workContext,
+ ICurrencyService currencyService)
{
_shippingPointService = shippingPointService;
_countryService = countryService;
_priceFormatter = priceFormatter;
+ _workContext = workContext;
+ _currencyService = currencyService;
}
public async Task<IActionResult> Get(string shippingOptionId)
{
var shippingPoint = await _shippingPointService.GetStoreShippingPointById(shippingOptionId);
if (shippingPoint != null)
{
+ double rateBase = await _currencyService.ConvertFromPrimaryStoreCurrency(shippingPoint.PickupFee, _workContext.WorkingCurrency);
+ var fee = _priceFormatter.FormatShippingPrice(rateBase);
+
var viewModel = new PointModel() {
ShippingPointName = shippingPoint.ShippingPointName,
Description = shippingPoint.Description,
- PickupFee = _priceFormatter.FormatShippingPrice(shippingPoint.PickupFee),
+ PickupFee = fee,
OpeningHours = shippingPoint.OpeningHours,
Address1 = shippingPoint.Address1,
City = shippingPoint.City,
diff --git a/src/Plugins/Shipping.ShippingPoint/Manifest.cs b/src/Plugins/Shipping.ShippingPoint/Manifest.cs
index c7f749b71..7404fa8b8 100644
--- a/src/Plugins/Shipping.ShippingPoint/Manifest.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Manifest.cs
@@ -8,5 +8,5 @@ using Shipping.ShippingPoint;
SystemName = ShippingPointRateDefaults.ProviderSystemName,
SupportedVersion = GrandVersion.SupportedPluginVersion,
Author = "grandnode team",
- Version = "1.00"
+ Version = "1.01"
)]
\ No newline at end of file