Im trying to get the shipping method and the shipping service values after i place an order on a Drupal 8 commerce website so i can use it inside an email im sending the website's owner (not the receipt for the client). I know Swift email would be an option but i have to continue with what i have. So far the owner of the website does receive an email but i need to add more information to it like the shipping method and shipping service.
I've got as far as finding out that $order->shipments->entity will give me, among other values, these 2 fields shipping_method and shipping_service.
Shipment {#4521 ▼
#values: array:19 [▼
"shipment_id" => array:1 [▶]
"type" => array:1 [▶]
"uuid" => array:1 [▶]
"order_id" => array:1 [▶]
"package_type" => array:1 [▶]
"shipping_method" => array:1 [▼
"x-default" => "2"
]
"shipping_service" => array:1 [▼
"x-default" => "PRIORITY_OVERNIGHT"
]
Where do I find the values of the shipping method value whose ID is 2 and the shipping service value whose ID is PRIORITY_OVERNIGHT?
Is there an easier way to get the shipping method and service from a placed order?