Skip Navigation

[Resolved] Improve compatibility with Woocommerce fields

This support ticket is created 6 years, 4 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
- 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)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Minesh 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#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

Languages: English (English )

Timezone: 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

Languages: English (English )

Timezone: 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

Languages: English (English )

Timezone: 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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.