Hi Team,
I have created one MVC widget to show product information, in that I have to show price too.
I tried using following properties to display price value:
DisplayPrice DisplayPriceFormatted DisplayPriceWithVatAndSale DisplayTaxInPrice Price
But when I change the Currencydropdoenlist to some other currency, price value doesn't change it remains as it is.
Whereas the price value which is displayed using Sitefinity product list template changes successfully.
Please let me know how to change the price on currency change using MVC widget.
Regards,
Mateen
var priceUk = EcommerceCurrencyFormatter.ToCurrencyString(50,
"en"
,
"GBP"
);
var priceEu = EcommerceCurrencyFormatter.ToCurrencyString(50,
"de"
"EUR"
var priceUsa = EcommerceCurrencyFormatter.ToCurrencyString(50,
"USD"
EcommerceExchangeRateConverter exchangeRateUtilities =
new
EcommerceExchangeRateConverter();
var convPriceUk = exchangeRateUtilities.ConvertPrice(50,
var convPriceEu = exchangeRateUtilities.ConvertPrice(50,
var convPriceUsa = exchangeRateUtilities.ConvertPrice(50,
Thanks Nikola,
Through this code price is getting converted successfully.
Can you please tell how to get current selected currency name through code to pass as a parameter to EcommerceExchangeRateConverter e.g "USD" or "EUR".
Thanks
List<
string
> currencies = EcommerceSettings.Currencies.SupportedCurrencies.Values.Where(ca => ca.IsActive).Select(ca => ca.Name).ToList();
$(
".sfcurrenciesDropDownList option[selected]"
).val()
Hi Nikola,
I am facing the same issue.
How can I get the selected currency of default currency selector in code instead of script?
By using your code I am able to fetch the active currencies but not the currently selected one.
Chaitanya
Thanks Nikola
It is working fine now :)
Okay so you can get the current currency from the cookie and I assume you can set the cookie value, but how do you actually change the selected currency in C#?