Skip Navigation

[Resolved] Need help with select type user field

This thread is resolved. Here is a description of the problem and solution.

Problem:
The issue here is that the customer wanted to use a custom field for user's to select their predetermined currency that they wanted to view his shop in.

Solution:

Unfortunately this isn't possible natively as you will need to write some custom code to determine which option the user has set on their profile.

For help with such custom coding you can contact a contractor from our list in the link below.
https://toolset.com/contractors/

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Robert Campbell 6 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#615256

I need to create a user field with the select (drop down). Here is an example of the standard use.

Display text, Custom field content
British Pound (£), £
Euro (€), €

But I need to store an additional custom field as follows:-

Display text, Custom field content, Extra custom field
British Pound (£), £, GBP
Euro (€), €, EUR

Is there any way to do this?

Regards

Robert

#615331

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Thank you for contacting our support forum.

I'm not entirely sure what you want to achieve, could you provide a bit more details on this for me.

Thanks,
Shane

#615376

Hi Shane

Okay, I am building a site which allows users to put up items for sale.
So each user gets to chose their default currency.
So in the drop down selector you might have a choice between:-
British Pound
Euro
US Dollar

However for each of these choices I also need to store two associated custom fields.

So let's say the user chooses 'British Pound'

I also need to store (for that user):-

'GBP'
'£'

But of course I don't want to have to ask the user to select another two drop downs.

I need these fields for other uses within the site.

Regards

Robert

#615413

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

So you essentially want users to define a currency.

To do this just add a Select field and then populate it with the currency symbols so the user has a choice to select the currency.

So after you allow them to select the appropriate currency you can also create another custom field with the symbol and then use the conditional group for the custom fields to only display the appropriate field as per the user's selection.

https://toolset.com/documentation/user-guides/using-custom-fields/

Also take a look at the link below for the conditional display for the fields.
https://toolset.com/documentation/user-guides/types-custom-fields-conditional-display/

Please let me know if this helps.
Thanks,
Shane

#615601

Hi Shane

So I created the user Select field with the currency names, e.g.

British Pound
Euro
US Dollar

This is how the user selects their desired currency and that value will be stored within their user profile.

So when that user logs in, I want all prices to be shown in that currency but using the correct currency symbol.user select

So e.g. if the user has selected, British Pound, then I need all the prices to be shown using the £ symbol.

So I created a second custom user select field to store all the currency symbols e.g.

£

US$

But I don't understand how to link them together?

I know that Conditional Display is not supported for User Groups but I'm not sure if that's what you meant?

Regards

Robert

#615685

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I get what you're saying now. At first I wasn't so clear.

So you want when your user's sign up they should be able to see their preferred currency based on what was selected at registration.

So if the selected USD then all the prices on the site would be in USD and so on.

Actually this won't be possible with just the use of custom fields, thats because we have to take into consideration the currency conversion, so 100 usd is not the same as £ 100.

If you're using the woocommerce plugin you can try using this plugin.
https://wordpress.org/plugins/woocommerce-currency-switcher/

Thanks,
Shane

#615783

Hi Shane
Thanks for the advice. I have a currency convertor plug in so that's not the issue.
Anyway I have written a php function which takes in the currency name selected by the user and then stores the correct currency symbol in another custom user field for the user.
All sorted!
Regards
Robert