Woocommerce product name [closed]

Assuming you can retrieve the order ID, you can do this

  $order = new WC_Order($order_id);
  $items = $order->get_items();

Then you can loop through results to add the product name to your array.

  foreach($items as $item){
         $product_names .= $item['name'] .' ';
  }