I’ve managed so as to add the product picture to the shape when the shape is opened from throughout the product web page, however I would like so as to add the product picture when the identical type is opened from {the catalogue} product record web page.
That is what I’ve thus far:
add_filter( 'gform_pre_render', 'add_product_image' );
operate add_product_image($type) {
world $publish;
if ($type['id'] != 12) {
return $type;
}
foreach ($type["fields"] as &$subject) {
if ($subject["id"] == 19) {
$subject["content"] = '<img src="' . get_the_post_thumbnail_url($post->ID, 'small') . '" alt="Product Picture" />';
}
}
return $type;
}
When opening the shape from {the catalogue} web page it at all times renders the primary product picture not the clicked one.
Hope that is sensible.