Skip Navigation

[Resolved] Field to be updated based on number of addresses

This support ticket is created 3 years, 10 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by AlimB3245 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1677351

Tell us what you are trying to do? I have a custom post type ORGANISATIONS with a SELECT field that has 2 choices Single Store or Multiple Store.. In ORGANISATION when I can add multiple ADDRESS as it's a REPEATABLE field.. so if I add just one address then the SELECT field should change to SINGLE STORE and if I add more than 1 address this SELECT field should change to Multiple Store.. the DEFAULT for the SELECT field is NULL.. How do I achieve this?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?hidden link

#1677993

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Alim,

Thank you for getting in touch.

Unfortunately this won't be possible because the settings for the Single/Multiple instance of the address field as this is controlled by our Types plugin which needs to be set in the Field group.

A workaround is that you can create 2 address fields one being able to have multiple instance and the other only having one instance.

Now you can go even further to set field conditions on these so that it is based on the checkbox, so you can set the Single instance to only display when single is checked and vice versa.

Once you've set this up in Types you will then need to add the fields on your frontend form in a conditional statement as well in order for the correct field to show up.

Finally on your content template, if you are using our Blocks plugin you can add the field to a conditional block that checks what the user had selected. If the user selected single, then the conditional block that you would've added the single address field would display. You will have a second conditional block that would display if the user selected multiple.

Please let me know if this instruction is clear or if further clarification is needed.

Thanks,
Shane

#1678633

Hi Shane

Thanks for the update..:-)..

Your workaround sounds good to me.. but I think this would mean I would have 2 google map displays.. right? Please do confirm..

I'll probably keep this option for later and revisit it some other time.. will wait for your confirmation about the 2 google map displays if I had to have 2 instances of addresses.. that wouldn't be ideal.. but at least I'd know..;-)..

Have a nice day..:-)..

Regards,
Alim

#1680673

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Alim,

That is correct, you will need to have 2 maps on the page and add it to a conditional block similarly to your custom fields.

This will ensure that only the correct map is loaded as per the field being loaded.

Thanks,
Shane

#1681411

My issue is resolved now. Thank you!

I will try it soon and get back in case of any issues..:-)..

Have a nice day..:-)..

Regards,
Alim

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