Skip to content

Multicurrency - Filter by Price block doesn't convert the prices #6024

Open
@kmanijak

Description

Describe the bug

When the user is switched to the geolocation currency (once the option for an auto switch is enabled), the Filter by Price still displays the values in default store currency.

To Reproduce

  1. Make sure to have plugins: WC Payments, WC Blocks installed
  2. In WC Payments settings enable currency switch based on geolocation
  3. Change the default store currency to different one than your local currency
  4. Create a new post
  5. Add Filter by Price and Products blocks
  6. Save and go to frontend
  7. Add a product to the cart
  8. Refresh the page

Actual behavior

While all the products display the prices in your local currency and prices are converted, Filter by Price displays the correct currency, but value is not converted and still in store default currency.

Expected behavior

Filter by Price should display min and max price converted to the geolocated currency.

Example:

In this example: USD to PLN exchange is ~4.5. The max price of the store is 60 USD, so after conversion to PLN:

Expected: In PLN it should be 60 * 4.5 = 290 zł
Actual: Filter by Price still displays 60 zł (red rectangle)

image

Keep in mind there are two problems:

  1. Currency will be picked up once the user session is established. That can be mimicked by adding a product to the store (allowing the filter to pick up the currency without the session is covered in this issue: Multicurrency - Geolocation users do not see Product Filter block picking up switched currency #5996)
  2. The scope of this particular issue: value is not converted even though

Additional context

POC

This issue involves WC Payments and WC Blocks. Here's a POC showcasing a possible solution:

Ref

More details available in per0F9-yg-p2

Metadata

Assignees

Labels

category: coreWC Payments core related issues, where it’s obvious.focus: multi-currencypriority: mediumThe issue/PR is medium priority—non-critical functionality loss, minimal effect on usabilitytype: bugThe issue is a confirmed bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions