Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

display SKU on product bundle

$
0
0

Replies: 0

Hi suport,

I need to display the SKU when I’m adding a simple product to the bundle product. Because I have the same products but the only difference is the SKU, so when I add a simple product i need to know that, I have chosen the right product.
And i know that I can search a product with the SKU but I need this function for efficiency.
For instance I would like to have the same function that I implemented in order list item :

add_action( 'woocommerce_thankyou', 'order_created_get_skus', 10 );

function order_created_get_skus($order_id){

  $item_sku = array();
  $order = wc_get_order( $order_id ); 

  foreach ($order->get_items() as $item) {
    $product = wc_get_product($item->get_product_id());
    $item_sku[] = $product->get_sku();
  }

}

Thanks for your answer,

Kind regards.

  • This topic was modified 11 minutes ago by natelvl.
  • This topic was modified 7 minutes ago by natelvl.

Viewing all articles
Browse latest Browse all 59525

Trending Articles