Totally Zenned
- Join Date:
- Jul 2012
- Posts:
- 16,908
- Plugin Contributions:
- 2
order notifiers
in includes/classes/order.php there are a few modifications to suggest moving forwards:
the notifier NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM or beyond does not include the updated value from the attributes sql that was performed just before it from which an orders_products_attributes_id could be generated similar to NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER at line 667 and NOTIFY_ORDER_DURING_CREATE_ADDED_PRODUCT_LINE_ITEM at line 794
Each of the above two examples have a value that is assigned by the completion of the sql action before the notifier (ie., order_id)
Ultimately, this is being considered for a version of Stock By Attributes that would include a table to track the orders completed which is generated similar to the existing Orders tables.
An additional aspect/question, there are several notifier variables that were added in ZC 1.5.3 at several of the notify locations (ie. $i, $products[$i], etc...). Some of these make sense at the location they are included; however, the majority of the variables are added as being able to be modified by reference. As a result, for example $i passed at the beginning of the run could be a different value immediately after the call and essentially at each such call. I am surprised to see that they are not added to an array that is immutable (first of 9 variables accepted when using the observer class). Because they are passed at the point(s) they are, almost would suggest that such variables be passed at the last moment they may be needed for attributes such as beginning order attribute processing at: NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN.
In absence of such, guidelines suggested would be to use the existing notifier variables as best they can be without modification of where the variable(s) are used. Currently have been able to incorporate Stock by Attributes into the includes/classes/order.php file without modifying the file except to incorporate the above additional notify variable as the variable comes from a recent database transaction which is suggested not to try to identify across a notify/observer action.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...