I am trying to add the product name to the sku when the sku is empty using the following method. So far this works but the last thing is, how do I call the product name within this code?
add_action( 'woocommerce_add_order_item_meta', 'so_28193771', 10, 3 );
function so_28193771( $item_id, $values, $cart_item_key ) {
$item_sku .= get_post_meta( $values[ 'product_id' ], '_sku', true );
if ( empty( $item_sku ) ) {
wc_add_order_item_meta( $item_id, 'sku', $item_sku , false );
}
}