potteryhouse / stock_by_attribute_1.5.3

Stock by Attribute for Zen Cart 1.5.1
GNU General Public License v2.0
1 stars 0 forks source link

Breadth of application of customID #16

Closed mc12345678 closed 8 years ago

mc12345678 commented 9 years ago

Have found a way to pretty much remove SBA from the includes/classes/order.php file to use the notify system; however, there are two parts remaining to address. The one of "most" significance at this point is the customID. The reason this one is most difficult to address is that in all of the uses of the $this->products[$i]['model'] variable, there is only one location that the variable is substituted for the $customid and that point is products_ordered_html which is used to generate the html email.

But it is not used or substituted in low stock emails, product order history, or products_ordered (and therefore not in standard emails, but in html emails because of the inclusion in products_ordered_html.

Seems appropriate to include/incorporate the information into the regular/non-html emails; however, what about in the low stock emails and the tracked order history? Currently the method of substitution is if there is a customId then use the customid, otherwise use the model# (whether there or not)... So, the thought is if the customid is to replace all of the above, then it can be done with a relatively simple piece of code, then the last thing to work out in the order.php file above is generating the low-stock e-mail information that is applicable to attributes.

In the end if that can happen there are a total of three changes to be made to the includes/classes/order.php file to support SBA via notify/observer action. Would require adding one more variable declaration to capture the $order_products_attributes_id, a modification in the notifier just below it to pass it to the observer and one other notifier modification to pass the attribute stock to and from unless that variable can remain outside of order.php file and stay only inside the observer (supports the low stock email for a tracked attribute)...

So, question is, what is the objection to logging in the order history to use the customid if assigned or the model# if no customid?

mc12345678 commented 8 years ago

This issue has effectively been answered through a myriad of other routes and discussions. In ZC 1.5.5, there are no edits made to the includes/classes/order.php because of modifications that have been made to the core code, so all of the above is sufficiently addressed through that. Regarding the use of the customID, there remains further work/modification to use it to its full potential, between retrieving the stored version of the customID from the order history instead of the live product to how to apply the customID(s) that could exist for a product based on ones desire of how/what to present.

That said, this issue is effectively closed. Latest code can be found at: https://github.com/mc12345678/Stock_By_Attributes_Combined