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 }