Display the SKU for WooCommerce products within re-order interface

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInPrint this page

Using the Advanced Post Types Order plugin, WooCommerce products can be easily and precisely sorted within categories. Even if a product belong to multiple terms/categories, the saved order will be preserved within each one.

The default re-order interface include a product thumbnail, title and object ID. Additional details can be included through a simple code, the following will show the SKU field:

    add_filter('apto_reorder_item_additional_details', 'theme_apto_reorder_item_additional_details', 10, 2); 
    function  theme_apto_reorder_item_additional_details( $item_additional_details, $post_data )
            //we need that only for products
            if( $post_data->post_type   !=  'product' )
                return $item_additional_details;    
            //retirve the custom field 
            $custom_field_value = get_post_meta($post_data->ID, '_sku', TRUE);
            if( ! empty( $custom_field_value ) )
                    $item_additional_details .=  ' <small>SKU : <b>' . $custom_field_value . '</b></small>';

            return $item_additional_details;

The results show as following:

Notify of
Inline Feedbacks
View all comments