If an online store uses several shipping methods then you might be tracking some information about these orders. Instead of digging through order details you can straight away get it when these details are appended to order numbers. Let’s check out this woocommerce customization that allows owners to get an instant view of which shipment providers are been chosen by the customer right from the admin orders page.
add_filter( 'woocommerce_order_number', 'ts_add_shipping_method_to_order_number', 1, 2 ); function ts_add_shipping_method_to_order_number( $order_id, $order ) { // Get shipping method $shipping_method = $order->get_shipping_method(); // Concatenate shipping method with order ID $order_number_with_shipping = $shipping_method . '-' . $order_id; return $order_number_with_shipping; }
Output
Instead of the standard order numbers, they will now include information about the shipping providers chosen by customers. The shipping method can be added as a prefix or suffix based on your specific implemntation. For example, if a customer selects a shipping method provided by UPS, the order number might appear as “UPS-1234” or “1234-UPS”.
![How to Add the Shipping Method To WooCommerce Order Numbers? 1 How to Add the Shipping Method To WooCommerce Order Numbers? - Tyche Softwares](https://media.tychesoftwares.com/wp-content/uploads/Shipping-Method-added-to-WooCommerce-Order-Numbers-4-1024x590.png)
If you want to further enhance your order tracking related to payments, instead of appending shipping, you can add payment methods to your order IDs. This helps you understand customer payment preferences and decide which options to promote or discontinue, streamlining payment processes.