a
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudanti.
a
Follow Me
Search
Change my orders template if order from other shops are not visible - WooCommerce MultiSite Global Cart
14231
documentation-template-default,single,single-documentation,postid-14231,eltd-core-1.1,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
 

Change my orders template if order from other shops are not visible

WooCommerce MultiSite Global Cart / Change my orders template if order from other shops are not visible
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

Change my orders template if order from other shops are not visible

As default the orders of a customer should be available and visible on front side, within My Account at Orders section. It happens for certain orders to be ignored since the theme is not aware of orders being available across whole network. The default template file is located at woocommerce/myaccount/orders.php within your theme. If the file does not exist we recommend to copy over from woocommerce plugin.

The template file contain the following:

            <?php foreach ( $customer_orders->orders as $customer_order ) :
                $order      = wc_get_order( $customer_order );
                $item_count = $order->get_item_count();
                ?>
                <tr class="order">
                    <?php foreach ( wc_get_account_orders_columns() as $column_id => $column_name ) : ?>
                       
                       ... more code ...
                       
                    <?php endforeach; ?>
                </tr>
            <?php endforeach; ?>

This need a bit of update to include the switch_to_blog() and restore_current_blog() so add the 2 new lines:

            <?php foreach ( $customer_orders->orders as $customer_order ) :
                switch_to_blog($customer_order->blog_id);
                $order      = wc_get_order( $customer_order );
                $item_count = $order->get_item_count();
                ?>
                <tr class="order">
                    <?php foreach ( wc_get_account_orders_columns() as $column_id => $column_name ) : ?>
                       
                       ... more code ...
                       
                    <?php endforeach; ?>
                </tr>
                <?php restore_current_blog(); ?>
            <?php endforeach; ?>

At his point All orders from any shops will be included everywhere in network at Orders section.