Friday, September 2, 2022
HomeWordPress Developmentwoocommerce offtopic - How you can add product picture to a Gravity...

woocommerce offtopic – How you can add product picture to a Gravity Kind from {the catalogue} web page?


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.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments