Forums
Home / Plugin: Download PDF Invoices for WooCommerce Orders / Sku in pdf
(@dariolg)
8 months, 3 weeks ago
Hello, how do I insert the product SKU in the PDF?
I’ve added and it works!
foreach ( $order_items as $item_id => $order_item ) {$product_id = $order_item[‘product_id’];$product = wc_get_product( $product_id );$sku = $product->get_sku();$html .= ” . $order_item->get_name() . ” . $product->get_sku() . ” . number_format( $order_item->get_quantity(), 2, ‘.’, ” ) . ” . $currency . ‘ ‘ . number_format( $order_item->get_total(), 2, ‘.’, ” ) . ”;}