Drupal 7 Commerce: Getting Billing and Shipping information from Order

In Drupal, commerce orders are associated with the Billing and Shipping information. We can access both Billing and Shipping information from the order object. The below sample code shows how to access the profile information.

Sample Code: 

$order_id = ORDER_ID;
$order = commerce_order_load($order_id); // Loading the Order details.
$wrapper = entity_metadata_wrapper('commerce_order', $order); // Order entity details.
$billingInfo = $wrapper->commerce_customer_billing->->value(); // Billing details.
var_dump($billingInfo);
$address = $wrapper->commerce_customer_billing->commerce_customer_address->value(); // Customer Billing address.
$shippingInfo = $wrapper->commerce_customer_shipping->->value(); // Billing details.
var_dump($shippingInfo);
Category: