function dotirating_function( $attr ) {
91
  $args = shortcode_atts( array('id' => '4081',), $attr );
92
    
93
    $product_id = $args['id'];
94
    $product = new WC_product($product_id);
95
    $attachment_ids = $product->get_gallery_image_ids();
96
    
97
//  echo $Original_image_url = wp_get_attachment_url( $attachment_ids[0] );
98
    return wp_get_attachment_image($attachment_ids[0], 'large');
99
    
100
//   foreach( $attachment_ids as $attachment_id ) 
101
//         {
102
//           // Display the image URL
103
//           echo $Original_image_url = wp_get_attachment_url( $attachment_id );
104
​
105
//           // Display Image instead of URL
106
//           echo wp_get_attachment_image($attachment_id, 'full');
107
​
108
//         }
109
    
110
}
111
​
112
add_shortcode('dotirating', 'dotirating_function');