In views exposed filter, i am not able to filter results by different currency than default.

I have Czech koruna as default currency, and EUR as secondary currency.
I added this filter in views:
filter criteria -> add new -> Commerce Product: Price (amount)
then "EUR" in currency select list, but filter works for amount in Czech koruna instead EUR.

The point is, when user choose different currency than default, he should be able filter results by this currency. Actualy, i can only sort products by price, but can't filter by price range. Any idea how i can solve this?

Comments

das-peter’s picture

Category: bug » feature

This is a tricky one because, depending on the multicurrency strategy you use, the currency prices aren't stored in the DB and thus can't easy filtered by views.
And even if you use the dedicated currency price fields approach you need something that decides to which field the filter has to be applied to.
The only other workaround I can imagine would be to alter the values to filter with before handing them over to the views filter. That way the user can enter the filter value in the user currency but the view gets the value in the default currency.
However, all this needs custom code atm. I won't start writing this but I'd definitely support everyone that gives it a try as good as possible to create a generic solution which could be added to the module.

varuntaliyan’s picture

Hello,

I am also facing the same issue. Has anyone found a solution for the same.

In my case there are 2 currencies, USD and INR where INR is default currency. I am displaying all the Prices in INR to the end user.

The ugly workaround i am using right now is that i have created a new field say "calculated price" where i am saving price after converting to default currency(INR) and using exposed filter based on that field.

Problem with this approach is that i have to run a script at least every 24hrs to update the value of that field.

If anyone has any solution . Please help

maxrossello’s picture

Category: Feature request » Bug report
Issue summary: View changes

Why would this be a feature request?
The filter (exposed, grouped) requires a currency which is completely ignored. For example, I have products with price expressed in EUR and INR. I create the filter indicating EUR. The result is that the filter is applied to the raw amount whatever the product price's currency, so 1000 INR are not considered below 200 EUR.
What's the purpose for the currency indicated in the filter then? This is clearly a bug.
Using commerce_multicurrency 7.x-1.4.