Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter diyoz

    (@diyoz)

    I had already implement for multiple sku printing.

    214             // support printing for multiple product sku
    215             $order_meta['sku'] = '';
    216             $items = $order->get_items();
    217             foreach ($items as $item) {
    218                 $product_qty = $item['qty'];
    219                 $product_variation_id = $item['variation_id'];
    220                 // Check if product has variation.
    221                 if ($product_variation_id) {
    222                     $product = new WC_Product($item['variation_id']);
    223                 } else {
    224                     $product = new WC_Product($item['product_id']);
    225                 }
    226                 $sku = $product->get_sku();
    227                 $order_meta['sku'] = $order_meta['sku'] . $sku . ' * ' . $product_qty . ' + ';
    228             }
    229             $order_meta['sku'] = rtrim($order_meta['sku'], "+ ");
Viewing 1 replies (of 1 total)