Skip Navigation

[Closed] Product modify form – Dropdown list to select which product to modify

This support ticket is created 3 years, 11 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 3 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1878517

I have a products modify form embedded in a page.
I am trying to put a dropdown field at the top of the page that already has all the products in the shop.
Selecting the product from the dropdown should automatically update the modify form on the page and allows me to modify the selected product.

#1878591

Hello, there's not really a built-in way to accomplish this in Forms. The recommended workflow is to place the Edit Post Form inside an unassigned Content Template, then create Edit Post Links and display them to the User. When the User clicks those links they will be redirected to a separate page containing the Edit Post Form.

If you want to include the Form on the same page instead and use a select field to choose a product to edit, it will require some custom programming. There is no AJAX or JavaScript API for Forms, so reloading the page is required when the User selects a product. When the page reloads, a URL parameter must be added to the page indicating the product ID the User wishes to modify, like this, where the selected product ID to edit is 12345:
https://yoursite.com/page-with-edit-form/?pid=12345

Then you could use Forms and Views shortcodes to pass that product ID from the URL parameter into the Form shortcode, so the Form is aware of the desired product ID to edit:

[cred_form form="Your Form Name or numeric ID" post="[wpv-search-term param='pid']"]

You would have to generate the Product Select field in the page using custom code, then use custom JavaScript to reload the page with the appropriate URL parameter when the User changes the select field.

https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_form
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term

The topic ‘[Closed] Product modify form – Dropdown list to select which product to modify’ is closed to new replies.