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.

Fix for format price with currency code

KrzysztofPajak236fdca3310b
diff --git a/src/Business/Grand.Business.Catalog/Services/Prices/PriceFormatter.cs b/src/Business/Grand.Business.Catalog/Services/Prices/PriceFormatter.cs
index 8ef14e94b..e2a745722 100644
--- a/src/Business/Grand.Business.Catalog/Services/Prices/PriceFormatter.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Prices/PriceFormatter.cs
@@ -139,7 +139,7 @@ namespace Grand.Business.Catalog.Services.Prices
/// <returns>Price</returns>
public virtual async Task<string> FormatPrice(double price, string currencyCode, Language language, bool priceIncludesTax)
{
- var currency = string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
+ var currency = !string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
return FormatPrice(price, currency, language, priceIncludesTax);
}
@@ -242,7 +242,7 @@ namespace Grand.Business.Catalog.Services.Prices
/// <returns>Price</returns>
public virtual async Task<string> FormatShippingPrice(double price, string currencyCode, Language language, bool priceIncludesTax)
{
- var currency = string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
+ var currency = !string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
return FormatShippingPrice(price, currency, language, priceIncludesTax);
}
@@ -336,7 +336,7 @@ namespace Grand.Business.Catalog.Services.Prices
public virtual async Task<string> FormatPaymentMethodAdditionalFee(double price,
string currencyCode, Language language, bool priceIncludesTax)
{
- var currency = string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
+ var currency = !string.IsNullOrEmpty(currencyCode) ? await _currencyService.GetCurrencyByCode(currencyCode) : null;
return FormatPaymentMethodAdditionalFee(price, currency,
language, priceIncludesTax);
}