Zen Follower
- Join Date:
- Jun 2012
- Posts:
- 481
- Plugin Contributions:
- 0
Accessing public class variables in observer class
I'm trying to write an observer for a notifier in includes/classes/order.php. The following code appears in order.php:
// Issue a notification, allowing an observer to potentially make changes to any of the
// order-related addresses and/or the country/zone information used to determine the
// order's products' tax rate.
//
$this->notify('NOTIFY_ORDER_CART_AFTER_ADDRESSES_SET', '', $taxCountryId, $taxZoneId);
So how do I access order-related addresses, since they are not included in the notifier parameters? What is the proper OOP way to access the order class public variables $customer, $delivery, and $billing in the observer class? I tried $order_data = new order(); in the observer but got a fatal memory exceeded error. Must I use $GLOBALS?
Frustrated as usual with OOP.:(
Dave