Skip Navigation

[Resuelto] Improve compatibility with Woocommerce fields

This support ticket is created hace 6 años, 11 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

Etiquetado: 

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Minesh hace 6 años, 11 meses.

Asistido por: Minesh.

Autor
Mensajes
#595366

Hi, as the title says. The main point of improvement being:
when adding a WC country field to CRED --> the cred field should be a default country select field, not a free text field. Woocmmerce (or mainly other applications that use this country info, like UPS) won't validate/recognize the input if not correct written (most make mistakes to free fields; mainly language-related mistakes)

Until that is solved: is there a way to generate by hand in the code a select list of the necessairy countries, in such way that it will be recognized? Thanks!

#595481

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - as I understand, could you please confirm that you are talking about the "billing_country" field and where you are using country field, with CRED post form or CRED user forms?

#595620

Hi, that's correct Minesh: billing_country - used with cred user forms.
Thanks!

#595820

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Well - there is no such feature exists to sync WooCoomerce fields with CRED form but there is a way I can show you that may help you.

You should add CRED generic select field - Generic select field accepts JSON as source:

For example:

[cred_generic_field field='billing_country' type='select' class='' urlparam='']
{
"required":0,
"validate_format":0,
"default":[],
"options":[
{"value":"USA","label":"1"},
{"value":"UK","label":"2"}
]
}
[/cred_generic_field]

More info:
=> https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

So, to generate dynamic options for generic select fields, you can use view's to generate the JSON output and assign the view's shortcode to generic select field "options" attribute:

Check this related ticket that may help you:
=> https://toolset.com/forums/topic/how-use-a-shortcode-instead-of-options-for-cred-forms/

#596048

Hi Minesh,

"Well - there is no such feature exists to sync WooCoomerce fields with CRED form "
--> well that's strange cause i did so already before i wrote this topic, even according your own instructions at some other topic of another user, and it works fine.
Only thing is that the user input field is not a select but free text field; and that countries must be written by their two-letter official country code...

So i'm going to try your solution above instead, hope that solves it!

Thanks!

#596137

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Yes - I may guide you with solution before but what I mean to say is there is no automatic sync feature available. I may guide you with same process and if you have that solution handy you should follow the same process.