a
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudanti.
a
Follow Me
Search
Display origin Shop name next to Product in Order interface - WooCommerce MultiSite Global Cart
15046
post-template-default,single,single-post,postid-15046,single-format-standard,cookies-not-set,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-5.0.1,vc_responsive
 

Display origin Shop name next to Product in Order interface

WooCommerce MultiSite Global Cart / Articles  / Display origin Shop name next to Product in Order interface
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

Display origin Shop name next to Product in Order interface

The WooCommerce Global Cart facilitate a unique cart implementation within a network of shops. Any product can be add to the cart and carry over to other shops. On check-out, depending on set-up type, the products are included in a single order on a specific shop, or spread to all shops which had a product in the cart.
Within dashboard, when view an order, all checked-out products are listed:

Origin shop o each product can be fond in the link of each product. To make it easier the shop name can be listed under each product:

This can be achieved through a custom code, the following lines should be saved within a file on wp-content/mu-plugins folder:

add_action('woocommerce_before_order_itemmeta', 'custom_woocommerce_before_order_itemmeta', 99, 3);
function custom_woocommerce_before_order_itemmeta( $item_id, $item, $product ) 
    {
        $meta_blog_id   =   $item->get_meta('blog_id');
        
        if  ( empty ( $meta_blog_id ) )
            return;
        
        $site_data   =  get_blog_details( $meta_blog_id );

        ?><p>Shop <a href="<?php echo $site_data->siteurl ?>"><?php  echo $site_data->blogname ?></a></p><?php
        
    }