public function __get($key)
{
wc_doing_it_wrong($key, 'Order properties should not be accessed directly.', '2.7');
if ('completed_date' === $key) {
return $this->get_date_completed();
} elseif ('paid_date' === $key) {
return $this->get_date_paid();
} elseif ('modified_date' === $key) {
return $this->get_date_modified();
} elseif ('order_date' === $key) {
return $this->get_date_created();
} elseif ('id' === $key) {
return $this->get_id();
} elseif ('post' === $key) {
return get_post($this->get_id());
} elseif ('status' === $key || 'post_status' === $key) {
return 'wc-' . $this->get_status();
} elseif ('customer_message' === $key || 'customer_note' === $key) {
return $this->get_customer_note();
} elseif (in_array($key, array('user_id', 'customer_user'))) {
return $this->get_customer_id();
} elseif ('tax_display_cart' === $key) {
return get_option('woocommerce_tax_display_cart');
} elseif ('display_totals_ex_tax' === $key) {
return 'excl' === get_option('woocommerce_tax_display_cart');
} elseif ('display_cart_ex_tax' === $key) {
return 'excl' === get_option('woocommerce_tax_display_cart');
} elseif ('cart_discount' === $key) {
return $this->get_discount();
} elseif ('cart_discount_tax' === $key) {
return $this->get_discount_tax();
} elseif ('order_tax' === $key) {
return $this->get_cart_tax();
} elseif ('order_shipping_tax' === $key) {
return $this->get_shipping_tax();
} elseif ('order_shipping' === $key) {
return $this->get_shipping_total();
} elseif ('order_total' === $key) {
return $this->get_total();
} elseif ('order_type' === $key) {
return $this->get_type();
} elseif ('order_currency' === $key) {
return $this->get_currency();
} elseif ('order_version' === $key) {
return $this->get_version();
} elseif (is_callable(array($this, "get_{$key}"))) {
return $this->{"get_{$key}"}();
} else {
return get_post_meta($this->get_id(), '_' . $key, true);
}
}