Skip to content

Instantly share code, notes, and snippets.

@MatthieuScarset
Last active October 21, 2015 12:18
Show Gist options
  • Save MatthieuScarset/cb683060e36bb117febf to your computer and use it in GitHub Desktop.
Save MatthieuScarset/cb683060e36bb117febf to your computer and use it in GitHub Desktop.
$order_id = 8442; // change this to your order_id value
$order = commerce_order_load($order_id);
$shipping_profile_id = $order->commerce_customer_shipping[LANGUAGE_NONE][0]['profile_id'];
$address_shipping_profile = commerce_customer_profile_load($shipping_profile_id);
$as = $address_shipping_profile->commerce_customer_address['und'][0];
$billing_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];
$address_billing_profile = commerce_customer_profile_load($billing_profile_id);
$ab = $address_billing_profile->commerce_customer_address['und'][0];
dpm($order);
dpm($as, 'Shipping address');
dpm($ab, 'Billing address');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment