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 FormatPrice with currencycode

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