Ok I have solved the translation thing, using the filters to change the labels of every address field, and using the labels instead of the placeholders.
however, since my country is not the US or Canada, I am getting an error saying that I am missing a required field, which I suspect it’s the State…
When I choose Portugal the state disappears (which is right), but when I click submit even with all the fields with data, it’s saying I’m missing a field
UPDATE: I have tried to turn the ADDRESS field optional, and the form works fine like that. But I need the field to be mandatory, the only field that’s not being filled is the State/Prov/Region part, that “disappears” when I choose Portugal. I have tried to use the code:
function yikes_mailchimp_default_state( $default_state_value, $form_id ) {
return ‘N/A’;
};
add_filter ( ‘yikes-mailchimp-default-state’, ‘yikes_mailchimp_default_state’, 10, 2 );
But I still am not able to submit the form, it always returns “A required field is missing.”
How can I solve this?
Hi @asantana75,
We have a filter that allows you to ignore the “required field” check on certain fields. You should be able to do the following:
add_filter(
'yikes-mailchimp-ignore-required-array-field',
function ($fields, $form_id) {
$fields[] = 'state';
return $fields;
},
10,
2
);
That would prevent the state field from being checked to see if it is empty. You can also use the $form_id to only exempt the state on certain forms. For example, forms in English you may want to leave the state field, but forms in Portuguese you’d ignore that field.
Let me know if that helps,
Jon
Hi Jon,
I have added that code to the functions.php file and it is still not allowing me to subscribe when I have the address fields on the form… I want the address to be mandatory, just not the state field, and it’s not working like that ๐
All the other things I was having trouble with I was able to solve using your help files, just not this one….
Thanks
Ana
Any idea on how to solve this?
This is really a big problem for me, I really need the address fields to be mandatory, minus the state.
Hello @jpowersdev
Are there any news on this?
I am still having this problem and I need this solved before I send this site to its live version.
Thanks
Ana Sofia Santana
@liljimmi, @jpowersdev can anyone help? ๐
Thank you!
Hi @asantana75
Try this instead:
add_filter(
'yikes-mailchimp-ignore-required-array-field',
function ($fields, $form_id) {
$fields['state'] = true;
return $fields;
},
10,
2
);
Let me know if that helps,
Jon
Hello @jpowersdev !
That worked, thank you!!!
It does help ๐
Ana
Hi @asantana75,
Fantastic! Glad to hear it.
Let us know if you need anything else,
Jon