• Resolved Ana Sofia Santana

    (@asantana75)


    I am working on a website using Mailchimp and Easy Mailchimp Forms. One of the required fields are the Address fields, which in Mailchimp have been translated to Portuguese, as seen here: https://eepurl.com/hAzJDz

    When using Easy Mailchimp Forms, the Address fields don’t show the labels in Portuguese, and when I submit the form, it doesn’t allow the information to go through because it’s expecting a USA zip code (even though I add an address in Portuguese, and choose Portugal as the country).

    Is there a way to solve this?

    Thank you!
    Ana Sofia Santana

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Ana Sofia Santana

    (@asantana75)

    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

    Thread Starter Ana Sofia Santana

    (@asantana75)

    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

    Thread Starter Ana Sofia Santana

    (@asantana75)

    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

    Thread Starter Ana Sofia Santana

    (@asantana75)

    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.

    Thread Starter Ana Sofia Santana

    (@asantana75)

    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

    Thread Starter Ana Sofia Santana

    (@asantana75)

    @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

    Thread Starter Ana Sofia Santana

    (@asantana75)

    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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Problems with Address Fields’ is closed to new replies.