I am trying to: create a new product and set the Product Gallery with CRED
I visited this URL: https://toolset.com/documentation/user-guides/creating-woocommerce-products-using-cred-forms/
I expected to see: how to set the Product Gallery with CRED
Instead, I got: just a message that says "Product Gallery needs to be saved using a CRED hook. If you need a non-code solution, add product images using custom fields defined in Types."
I didn't find any information regarding that "CRED hook" and the type of field that I should use (an Image repeater field maybe?)
I need to use the WooCommerce field, I must not create a custom field. I can manage some PHP without problem. I have no problems with the other fields of the product at the moment.
Dear stefano,
Yes, it needs custom PHP codes, for your question:
I didn't find any information regarding that "CRED hook" and the type of field that I should use (an Image repeater field maybe?)
You can try with CRED action hook:
cred_save_data
This hook allows doing a custom action when post data is saved to database.
https://toolset.com/documentation/user-guides/cred-api/#csd
Yes, I agree with you that an Image repeater field is better for this case.
And in the database , Woocommerce plugin is using a custom field "_product_image_gallery" to store the media IDs.
For your reference.
Now the problem is that I can't find out how to create a generic repeater field. If I click on "add generic fields" and then on "Image", I don't have any option that allows me to set the field as a repeater. How can I do that?
There isn't such a feature that can create a generic repeater field. see our document:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field
I suggest you create a custom repeating image field:
https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/repeating-fields/
Put it into your CRED form for user to submit images, after user submit the form, use action hook cred_save_data to store them as "Product Gallery"