Skip Navigation

[Resolved] Dropdwon list from Tags

This support ticket is created 6 years, 5 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 Minesh 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#914988

Hi,
I am trying to create dropdown list of product_type in Toolset Form (cred)
i want that user select the product type by selecting from the dropdown "simple Product" or "variable Product" is it even possible to do this?

this what i tried. it works with Taxonomies this way but with Tags it doesn't change anything.

<div class="form-group">
		<label>Product Type</label>
		[cred_field field='product_type' display='select' single_select='true']
		[cred_field field='product_type_popular' taxonomy='product_type' type='show_popular']
	</div>
#915194

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - As you can see with [cred_field] shortcode argument - the attribute display='select' only supported for the Hierarchical Taxonomies.

More info:
=> https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

What if you try to build your custom select box using Generic filed:
=> https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

#915250

If i understand right, i can add a generic field to my product post form, but normally generic fields don't save any data in the database. this means if i want this generic field to save a value of another third party field (in our case WooCommerce field "product_type") in the database i will need to write cred hook code?

cred hook should be this? https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data

#915280

Minesh
Supporter

Languages: English (English )

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

Well - If I'm not wrong - the thing is that product_type is hidden taxonomy managed by Woocommerce.

So - whatever selected option you select from generic select field - you need to use hook cred_save_data to attach the selected option as taxonomy term with the post you created using form.

More info:
https://toolset.com/documentation/programmer-reference/cred-api/#csd

Please check following link that may help you - that illustrates how you attach taxonomy term:
=> https://toolset.com/forums/topic/set-default-category-for-posts/#post-389868

#916187

Minesh
Supporter

Languages: English (English )

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

Do you need help here? if no: would you mind to close this 🙂

#916194

Hi Minesh! yes i still need help with this. i actually didnt find the right code to save product_type selection with a generic field.

Lets say i have created a new generic field. called it product-type-generic. so now the selected option need to be saved in product_type when form is submitted and this is the hard step for me!

[cred_generic_field field='product-type-generic' type='select' class='' urlparam='']
{
"required":0,
"validate_format":0,
"default":[""],
"options":[
{"value":"","label":"all"},
{"value":"simple","label":"simple product"},
{"value":"variable","label":"variable"}
]
}
[/cred_generic_field]
#916561

Minesh
Supporter

Languages: English (English )

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

could you please share problem URL where you added CRED form and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.