- This topic has 3 replies, 2 voices, and was last updated 1 year, 5 months ago by
Sangita Support Squad.
-
AuthorPosts
-
-
October 15, 2024 at 7:19 PM #236154
l.gan
ParticipantHI, 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 /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
-
October 15, 2024 at 7:52 PM #236155
Sangita Support Squad
KeymasterThanks for getting back. Kindly provide us some time to check this and we will get back to you accordingly.
-
October 16, 2024 at 11:17 AM #236166
Sangita Support Squad
Keymaster@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.
-
December 16, 2024 at 10:10 AM #237789
Sangita Support Squad
KeymasterWe 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.
-
-
AuthorPosts
- The topic ‘How to get the tracking number to get order details’ is closed to new replies.



