Price information is not reasonably displayable to users

Bug #1258542 reported by dobey on 2013-12-06
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Click Package Index
Low
James Tait

Bug Description

The current way that price information is returned in the JSON in the search and package details endpoints, does not give the client enough information to make a rational choice of how to display the data. The "price" field is a float, without any currency information. The "prices" field is a dict that contains the currency string and the associate price in a float for it. However, there is also no field which tells the client which currency should be displayed.

Even with that information, it will still be very difficult to display correctly, as different langauges and regions require different currencies to be displayed in different ways. For example, in AR, USD must be shown as USD, while ARS is shown as $. But in the US, USD must be shown as $. Position of the currency type related to the value, may also need changed depending on locale. Some may require the currency to be displayed after the value, rather than before it, as well as the issue with RTL languages.

dobey (dobey) wrote :

The best solution for this, I think, is to have a "display_price" returned from the server, which already contains the correctly translated string for the user's currency/location, based on Accept-Lang and GeoIP detection, and keeping the "price" field a float, though ensuring it matches the value used in the "display_price" field, so that it can be used for comparisons.

James Tait (jamestait) on 2014-03-06
Changed in click-package-index:
status: New → Triaged
importance: Undecided → Low
Alejandro J. Cura (alecu) wrote :

> and keeping the "price" field a float, though ensuring it matches the value used in the "display_price" field, so that it can be used for comparisons.

I like this, but if we end up showing prices with different currencies in a given result list, the float "price" field should be normalized by converting to a common currency.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers