• Resolved LuukDriessen

    (@luukdriessen)


    Hi Bas,

    We would like to add the SKU per product on the invoice.
    Is this possible? On the packing slip it is working fine.

    We tried to copy/edit our template but it never showed up and also our columns got another position.

    Is there also a possibility to add the SKU of a Variation product?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m inquiring on the same thing.

    I’m really surprised this plugin doesn’t feature it.

    Plugin Author Bas Elbers

    (@baaaaas)

    Add below function to your functions.php and it will show sku as meta data below product description.

    
    /**
    		 * Display SKU as item meta.
    		 *
    		 * @param WC_Order_Item_Product $item order item object.
    		 * @param WC_Order              $order order object.
    		 */
    		function display_sku_as_meta_data( $item, $order ) {
    			$product = BEWPI_WC_Order_Compatibility::get_product( $order, $item );
    			$sku     = $product && BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) ? BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) : '-';
    			?>
    			<br>
    			<ul>
    				<li>
    					<strong><?php esc_html_e( 'SKU:', 'woocommerce-pdf-invoices' ); ?></strong> <?php echo esc_html( $sku ); ?>
    				</li>
    			</ul>
    			<?php
    		}
    add_action( 'wpi_order_item_meta_start', 'display_sku_as_meta_data', 10, 2 );
    

    Let me know if you have anymore questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add SKU to invoice PDF’ is closed to new replies.