2

I'm trying to make an extension that allows the user to choose from a list of shipping and billing addresses that they have previously entered. I'm using the store_order_complete_end hook listed here https://www.exp-resso.com/docs/extension_hooks.html but I can't access the addresses in the $order object because the $order->attributes object is a protected attribute. Is there any other way to get the addresses for the order?

public function my_store_order_complete_end($order) {
    $vars = $order->attributes; // undefined as it's protected
}

1 Answer 1

2

All of the customer attributes are actually accessible as direct members of the $order object:

$order->billing_first_name
$order->billing_last_name
$order->billing_address1
$order->billing_city

Etc.

1
  • Thanks Derek. I didn't see those in the var_dump oddly enough but it works.
    – Patrick64
    Commented Mar 20, 2015 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.