Listing attribute in currency format

Hi there,

is it possible to create a custom attribute for a listing that displays something such as a currency value?

I know I can create an attribute with a numeric value, but then it just appears as an integer. I’d like for that number to automatically add a period or comma when the user is typing digits and for this number to be either prefixed or followed by a currency symbol such as $ or €.

What I mean is that for example, when a user types 1000, one of the symbols (a period or a comma) is inserted automatically, so even though they only typed the four digits, it actually looks like one of the following formats:
€1.000
€1,000
1.000€
1,000€

This would also have to work the same way with 10.000, 1.000.000, etc.

Is that possible somehow? It’s okay if the currency symbol is hardcoded.

Hi! When you make a price attribute with numbers, just use this in the “Format field”:

%label%: € %value%
In this sample, the label will show the attribute name, the value is the price numbers, and the currency symbol.
This will show: Price: € 1000

2 Likes

Hi Fabricator,

thanks for the quick reply! I just tried it your suggestion, but it doesn’t show up in the search filters:

Also, how can I solve the problem of the dot or comma inbetween the digits?

In the search field, it can’t display, only the numbers. So if you want to show for the users, this price is in euro, I recommend use this attribute name: Price (€)
The “dots” in the price value can be set up when you make the attribute, how many dots you want between the digits. (under the placeholder field, “Decimals” )

Alright, I’ll use the € symbol in the attribute name for now.

I entered “3” under the placeholder field “Decimals”, but in the search field, the values still show up as shown in the screenshot from my reply above. Do they also not get shown in the search field?

What I need to accomplish is that if the user types 1000 in the field, it shows as 1.000. If the user types 100000, it shows as 100.000. And if the user types 1000000, it shows as 1.000.000. How do I do that?

Hi! I tested it on my own website, and it seems not showing the decimals (dots) in the filter field. It maybe need a php snippet or modification, but I’am not familiar with that so you need an official support.

Yeah I think you’re right, it’ll need some custom modifications. Thanks for looking into it anyways!

Hello, it’s over a month now this question was asked, no official support yet?

Also, user must have a way to select their currency from a list of currencies.

Hi,

We did not provide an answer because the Fabricator correctly answered that you need to add two attributes and specify one in the display value of the other. There is no currency attribute in the day version, but thanks for the suggestion, we will think about adding it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.