Shortcode for Getting a WooCommerce Product

add_shortcode('rm_product', 'get_wc_product_simple');

function get_wc_product_simple($atts) {
  $a = shortcode_atts( array(
      'product_ids' => ''
  ), $atts );
  $product_ids = explode(',', $a['product_ids']);
  
  ob_start();
  $count = 1;
  $product_list = '<ul class="product_list_widget">';
  foreach ($product_ids as $product_id) {
    $product_list .= rm_get_product($product_id, $count);
    $count++;
  }
  $product_list .= '</ul>';
  return $product_list;
}
//confirmation for amanda 262418893 
//confirmation for support 104156488
function rm_get_product($product_id, $count) {

  $product = wc_get_product( $product_id );
  $product_html = '<li class="one-fourth ';
  if ($count == 1) {
    $product_html .= 'first';
  }
  $product_html .= '">';
  $product_html .= '<a href="' . $product->get_permalink() . '"">';
  $product_html .= wp_get_attachment_image( get_post_thumbnail_id($product_id), $size='medium' );
  $product_html .= '</a>';
  $product_html .= '</li>';
  return $product_html;
}