How do I echo Sku?
-
I’m trying to echo sku on a custom pdf packing slip. I’m using this code:
<?php $items = $orderData->get_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : if(get_post_meta($item['product_id'],'_warehouse',true)==$VendorID): $_product = apply_filters( 'woocommerce_order_item_product', $orderData->get_product_from_item( $item ), $item ); $item_meta = new WC_Order_Item_Meta( $item, $_product ); ?>
with this piece of code not working
<?php echo $item['sku']; ?>
but this one does
<?php echo $item['product_id']; ?>
Can someone please explain to me in layman’s terms what I am doing wrong here? I’m not very knowledgeable in PHP so any placement help would be much appreciated as well. Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How do I echo Sku?’ is closed to new replies.