Skip Navigation

[Resolved] Dynamic form field

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

This topic contains 6 replies, has 2 voices.

Last updated by pabloQ-2 5 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1282795

Tell us what you are trying to do?

I am planning a -really- complex site with a custom post types and fields. I'm just wondering what's the best way to achieve one functionality before the development starts.

I have "Products" post type (the site is not an ecommerce, just a catalog). This products will have variations (like color and measures). I want to display a form in the product page to help the users asking for more information.

I want to generate one field in that form that display only the variations for the current product the user is viewing.

I was wondering if it's better to use a repeatable field for the variations or create a new custom post type and link it to the "Product" post type. And I was wondering if there is some documentation or tutorial to create a form that displays one field dynamically.

Is there any documentation that you are following?

I have searched in the Toolset docs and in the forum, but I didn't find a solution.

Thank you!

#1282869

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you add product variations as custom taxonomy? Because, Basically WooCommerce handles the product variations as taxonomy, so what if you setup your product variations as taxonomy?

What you display the form and add taxonomy field it will automatically populate all taxonomy terms you added.

As you still do not start the development - I would advise you to create a test site using one of our available reference site on discover-wp.com and try and play with the feature you want to implement and check what will be the suitable way for you to go with.
=> https://toolset.com/faq/how-and-why-to-create-a-test-site-in-discover-wp/

Here are all available reference sites:
https://discover-wp.com/site-templates/

#1282887

Thanks Minesh 🙂

That's a great idea I didn't think of! When you say "What you display the form and add taxonomy field it will automatically populate all taxonomy terms you added" I understand that the front-end form field will only display the terms involved in the current product, is that correct?

I will make a test for sure in the discover-wp playground 🙂

Regards

#1282917

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

"What you display the form and add taxonomy field it will automatically populate all taxonomy terms you added" I understand that the front-end form field will only display the terms involved in the current product, is that correct?
=> no, it will display all terms belongs to the taxonomy.

#1282939

I don't want to display all the terms that belongs to the taxonomy, I only want to display the terms that applies to that product.

For example, the A table has two widths availables: 120cm and 180cm. And the B table has 150cm and 200cm. I want that in the form of the A table the user can choose between 120cm and 180cm, not between all the widths availables in the hole site.

Is there a way to do that? Just as a reminder, I'm not using WooCommerce, it's a catalog 🙂

Thanks!

#1282943

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

There is no such way to remove specific taxonomy term until and unless you add some custom JS/javascript code to remove the terms which do not belong to the product.

Is there a way to do that? Just as a reminder, I'm not using WooCommerce, it's a catalog 🙂
I know 🙂

#1283363

Ok Minesh! Thank you for your support and have a nice day 🙂