Replace product name by SKU and variation name in Woocommerce admin orders pages
-
Photo —>> https://ibb.co/ZT4Y1GL
Use this code to replace the product name with its SKU.
Now I would like to add the size / name of the variation of the product sold.
Can anybody help me ??
function filter_order_item_get_name( $item_name, $order_item ) { if ( is_admin() && $order_item->is_type('line_item') ) { $product = $order_item->get_product(); if( $sku = $product->get_sku() ) { $item_name = $sku; } } return $item_name; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Replace product name by SKU and variation name in Woocommerce admin orders pages’ is closed to new replies.