Skip Navigation

[Resuelto] How can I include a country selection field for user registration?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created hace 7 años, 5 meses. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 6 respuestas, tiene 2 mensajes.

Última actualización por Francisco Ramón Molina Busquiel hace 7 años, 5 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#540911

On the User Registration form, how can I include a country selection field compatible with the country field of WooCommerce?
Thanks for your help.
Best regards,
Francisco R.

#541164

Hi, I'm not sure I understand what you mean by compatible. If you mean you want the same options and option values, then I can help you set up a select field with those option names and values. However, I can't guarantee these will always stay in sync with WooCommerce's field. For example, if a country changes abbreviations or splits into two new countries, your field will be out of sync as soon as WooCommerce updates their field. Believe it or not, this happens more often than you might think.

I also can't help with a typeahead, multi-select interface like the WooCommerce country field. The select field I can help you set up is a basic HTML select field.

Here's how I would go about doing something like this. Gather the option names and values from the WooCommerce select field. Add these into a CSV file. Next, create your custom field in Types, and add a couple of options manually. Then you can export this custom field using Toolset Import / Export. Open the generated XML file and insert your options here. You may be able to transform a CSV file with all the appropriate information into a valid XML structure. This isn't a supported feature of Toolset, so it's not something I would be able to assist you with. Save the XML file and re-import this field using Toolset Import / Export. Your new options will appear.

Another ticket discusses this approach and includes some code samples:
https://toolset.com/forums/topic/import-custom-fields-from-pre-defined-list/

Let me know if you have any specific questions and I will try to help.

#541301

But this is a basic functionality of member management plugins to synchronize the data of woocommerce with those of the user. This should be a feature base on Toolset, since Toolset is a plugin for user management, access and woocommerce.
When I create a user with Toolset, their data should be available from WooCommerce.
Thanks for your help.
Best regards,
Francisco R.

#541542

But this is a basic functionality of member management plugins to synchronize the data of woocommerce with those of the user.
Let me make sure I understand what you're trying to accomplish so I can come up with a good solution for you. When an order is submitted in WooCommerce, if the user elects to create an account, their billing address is added to the usermeta table in the database. The country from this address is saved as 'billing_country', and is a field managed by WooCommerce, meaning that if I go to a User's profile in wp-admin I will not see this field displayed.
- Is this is the country selection you are referring to? If not, which country selection are you referring to, exactly?
- Would you like to allow users to predefine their billing_country, using CRED, during User Registration?
- What purpose will this serve? Will you be relying on this billing_country value elsewhere on the site, using it as a default shipping address for future orders, or other?

#541547
2017-06-26_19-34-51.jpg

and is a field managed by WooCommerce, meaning that if I go to a User's profile in wp-admin I will not see this field displayed.
As you can see in the screenshot in the user profile you see the data of woocommerce.
- Is this is the country selection you are referring to?
Yes.
- Would you like to allow users to predefine their billing_country, using CRED, during User Registration?
Yes.
- What purpose will this serve? Will you be relying on this billing_country value elsewhere on the site, using it as a default shipping address for future orders?
Yes.

UserPro has this system and other member management plugins also have this system.

Thanks for your help.
Best regards,
Francisco R.

#541652

Okay I understand better now, thanks. I don't think it's well integrated like this in the current CRED system but I will reach out to our developers to see if they are aware of a way to accomplish what you're looking for, while staying in sync with WooCommerce. Hopefully they will have a good solution for you, so please stand by and I will update you as soon as I have more information to share.

#541867

Do not worry, I've already asked for a refund of my money. Apparently the developers of Toolset do not see the products of the competition. Toolset user management needs a lot of love to be something similar to other member management products.

El foro ‘Types Community Support’ está cerrado y no se permiten nuevos debates ni respuestas.