v157.
i am curious about the order class and specifically the number of observers. i see 39 different observers. i'm curious if anyone makes use of this one:
NOTIFY_ORDER_DURING_CREATE_ADDED_PRODUCT_LINE_ITEM
if we look at the code in
includes/classes/order.php
lines: 871-880
PHP Code:
zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = $db->insert_ID();
$this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_PRODUCT_LINE_ITEM',
array_merge(array('orders_products_id' => $order_products_id, 'i' => $i), $sql_data_array),
$order_products_id);
$this->notify('NOTIFY_ORDER_PROCESSING_CREDIT_ACCOUNT_UPDATE_BEGIN');
$order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
$this->notify('NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN');
would it not make more sense to have the obsever BEFORE the insert? what is the point of having the $sql_data_array after the insert is already done?
the notifier is valuable in that one could now, in theory, manipulate data within that row. but would it make more sense to have the observer prior to the insert being done? from a performance standpoint, manipulating the data and then hitting the db seems more efficient to me.
and while i am sure there is a reason, i suppose it escapes me the need to have 3 different observers almost directly in a row.
curious about anyone's thoughts on this.
thanks in advance.
Bookmarks