be well
be well

Reputation: 335

Displaying the shipping method of the order in "Thank you" page

In WooCommerce, I would like to display the name of chosen shipping method for the current order in "Thank you" (order received) page…

How can I get the name of this chosen shipping methods in Thank you page?

All I can get is the shipping address, instead I would like to display the shipping method name.

Upvotes: 3

Views: 1595

Answers (1)

LoicTheAztec
LoicTheAztec

Reputation: 253901

If you look in WC_Abstract_Order available methods, you have get_shipping_method() that is going to display the title of the shipping method used with your order.

Now you can use this method in your code with the $order object this way

echo $order->get_shipping_method();

Upvotes: 2

Related Questions