Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.x
Multi-store. Franchise. Facilitator. AI tools.
Everything your marketplace needs - now in one platform.
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

-
DAYS
-
HOURS
-
MINUTES
-
SECONDS
20% Off Is Temporary. The Benefits Aren't.

HAPPY20

How to get the tracking number to get order details

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #236154
      l.gan
      Participant

      HI, THANKS FOR THE NEW FEATURE.
      Version 4.2.4 – Customers can now view the order tracking information shared by vendors directly from their order details page #849.

      I have a question:

      Earlier you shared the code to get order details for certain order statuses.
      Please tell me how to get the tracking number inside (if there is one) and get a tracking link (if there is one).
      + How to get a link to a suborder located at:
      my-account / view-order / suborder number /

      https://multivendorx.com/support-forum/topic/how-to-get-the-details-of-suborders-status-processing/#post-192367

      add_action( 'woocommerce_after_my_account', 'mvx_woocommerce_account_content_action' );
      function mvx_woocommerce_account_content_action(){
           $customer = wp_get_current_user();
          // Get all customer orders
          $customer_orders = get_posts(array(
              'numberposts' => -1,
              'meta_key' => '_customer_user',
              'orderby' => 'date',
              'order' => 'DESC',
              'meta_value' => get_current_user_id(),
              'post_type' => wc_get_order_types(),
              'post_status' => array('wc-processing', 'wc-onhold'),
              'fields'  => 'ids',
          ));
          if ($customer_orders) {
              foreach ($customer_orders as $customer_order) {
                  $mvx_suborders = get_posts( array( 
                      'post_parent' => $customer_order,
                      'posts_per_page' => -1,
                      'post_status' => array('wc-processing', 'wc-onhold'),
                      'post_type' => wc_get_order_types(),
                      'fields'  => 'ids',
                  ));
                  if ($mvx_suborders) {
                      foreach ($mvx_suborders as $mvx_suborder) {
                          $order = wc_get_order($mvx_suborder);
                          $order_id = $order->id;
                          $shipping_method = $order->get_shipping_method();
      
                          // data to show
                          echo $order_id . '<br>';
                          // // Get and Loop Over Order Items
                          foreach ( $order->get_items() as $item_id => $item ) {
                              $product_name = $item->get_name();
                              echo $product_name . '<br>';
                              $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $item->get_product_id() ), 'single-post-thumbnail' );
                              
                              echo '<img src="'. $image_url[0] .'" width="40" height="40"/>';
                          }
                          
                          echo $shipping_method .'<br>';
                      }  
                  }
              }
          }
      }

      Thank you

    • #236155

      Thanks for getting back. Kindly provide us some time to check this and we will get back to you accordingly.

    • #236166

      @l.gan, We understand your requirements. However, implementing the custom flow you are looking for would require a significant amount of custom coding, which falls outside the scope of our free support. Hope you understand.

      That said, we’d be happy to assist by providing guidance on any hooks or filters that might help with your customization. Please let us know how we can support you with this.

    • #237789

      We haven’t heard back from you in a while and presume that your query has been resolved. As such, we’ll be closing this support thread.

      If you require assistance or encounter any issues in the future, please feel free to create a new support thread, and we’ll be happy to help.

Viewing 3 reply threads
  • The topic ‘How to get the tracking number to get order details’ is closed to new replies.
Shopping Cart
Launch Your Marketplace
in Days, Not Month
Get expert guidance to build, scale, and grow your MultiVendorX marketplace
Book Free Strategy Call
Trusted by 10000+ marketplace Owners
Scroll to Top