Search
Display the Order Products shops, within the Super Admin Orders ( all ) interface - WP Global Cart
15924
documentation-template-default,single,single-documentation,postid-15924,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,wpb-js-composer js-comp-ver-6.3.0,vc_responsive
 

Display the Order Products shops, within the Super Admin Orders ( all ) interface

WP Global Cart / Display the Order Products shops, within the Super Admin Orders ( all ) interface
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

Display the Order Products shops, within the Super Admin Orders ( all ) interface

The WooCommerce Global Cart includes the global Orders interface where orders across all shops in the network are listed in a single place. The interface is similar to the default WooCommerce order and includes all default functions to maintain Process, Complete, View etc.

To make it easy to figure out through the Orders interface, what each of the orders contain, an additional column can be included programmatically to show all Shop names that the included products belong to. This is useful when using the Single Site Check-out type:

        add_filter('wogc/admin/manage_shop_order_columns',  'custom_wogc_admin_manage_shop_order_columns');
    function custom_wogc_admin_manage_shop_order_columns( $columns )
        {
             
            $columns['origin_blogs']  =   __( 'Shops', 'woocommerce' );
                
            return $columns;   
        }
        
    add_action('wogc/admin/manage_shop_order_column_data', 'custom_wogc_admin_manage_shop_order_column_data', 10, 2);
    function custom_wogc_admin_manage_shop_order_column_data( $post, $column_name )
        {
             
            if ( $column_name != 'origin_blogs')
                return;
                 
            $order  =   wc_get_order( $post->ID );
            foreach( $order->get_items() as  $key    =>  $order_item )
                {
                    $site_data  =   get_blog_details( $order_item->get_meta('blog_id') );
                     
                    printf( '<b>%s</b><br />', esc_html( $site_data->blogname ) );        

                }
     
        }
0
Would love your thoughts, please comment.x
()
x