Do you mean that you have custom validations added to your form? If yes - could you please tell me what are those?
And once you uploaded a few images to your form field "Additional Picture" and you validate those custom validation, once the form is validated - it's not displaying the uploaded images?
Well - it seems the screenshot you shared is from backend.
Could you please send me exact step information I need to follow that will help me to reproduce the issue as well as 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.
Hi,
When I save the form after validation, the images I added cannot be found in the Gallery of the product
and I cannot display the fields relationship in the form.
Well - my question is what data I should use for which form fields to display to invalidate the form? Do you have any specific custom validations added? as form is validated using javascript - have you added any custom validations using Forms hook cred_form_validate?
The only thing I would like is to add multiple pictures in the form.
These pictures should be linked to the product. This is not the case now.
Second thing is that I would like the relationship "Product Designer" to appear in the form.
So people can choose to see the products from only one specific designer.
Could you please kindly give me information what I asked and that will help me to understand your issue as well as to guide you in right direction. Could you please answer following questions:
my question is:
- what data I should use for which form fields to display to invalidate the form?
-Do you have any specific custom validations added? as form is validated using javascript
- have you added any custom validations using Forms hook cred_form_validate?
The only thing I would like is to add multiple pictures in the form.
These pictures should be linked to the product. This is not the case now.
==> Is it the case that even though you uploaded the images using "Additional Picture" but its not showing in the backend after you submit the product?
Additionally, the access details you shared in not working. Please share working access details.
I have set the next reply to private which means only you and I have access to it.
I've added following code to your current theme's functions.php file so whatever additional images you upload it will be linked to product gallery field:
/**
* Create product image gallery during Forms submission
*
*/
add_action('cred_save_data', 'func_add_product_gallery_image',10,2);
function func_add_product_gallery_image($post_id, $form_data)
{
global $wpdb;
// if a specific form
if ($form_data['id']==14407)
{
if (isset($_POST['wpcf-additional_images']))
{
$list_ids = array();
foreach($_POST['wpcf-additional_images'] as $url) {
$item_id = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $url ));
$list_ids[] = $item_id[0];
}
update_post_meta($post_id, '_product_image_gallery', implode($list_ids,','));
// delete_post_meta($post_id, 'wpcf-product-gallery-image-cred');
}
}
}
Now, once you upload the additional images - the same images will be assigned to product gallery image as well.
Regarding your any additional questions, please kindly open a new ticket as it will help us to write the correct ticket resolution summery as well as help other users searching on the forum the same issue.
Thanks for your help.
I can not do it, it is to give the possibility to the visitor to link a designer to the product in the form.
I searched on the internet but I did not find anything