Change my downloads template if product link is invalid
An order from a shop in the network become visible for customer through My Account -> Orders in all shops once the WooCommerce Multisite Global Cart plugin is activated. Some themes are not MultiSite capable, so downloadable Product link might be invalid:
The default template file used for this area is located within your theme at /woocommerce/order/order-downloads.php If the file dos not exists, it should be copied from WooCommerce plugin, from /templates/order/order-downloads.php
The order-downloads.php file contain the following:
... switch ( $column_id ) { case 'download-product' : ?> <a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo esc_html( $download['product_name'] ); ?></a> <?php break; ...
This need a bit of update to include the switch_to_blog() and restore_current_blog() so add the 2 new lines:
... switch ( $column_id ) { case 'download-product' : ?> <a href="<?php if(isset($download['blog_id']) && $download['blog_id'] > 0) switch_to_blog( $download['blog_id'] ); echo esc_url( get_permalink( $download['product_id'] ) ); if(isset($download['blog_id']) && $download['blog_id'] > 0) restore_current_blog(); ?>"><?php echo esc_html( $download['product_name'] ); ?></a> <?php break; ...
Once code updated, the Product name should link to correct url, to shop where was native created.