For that you were indeed looking at the right section of code ... ie:
Code:
$this->notify('NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS', $custom_insertable_text);
/* START: ADD MY CUSTOM DETAILS
* 1. calculate/prepare custom information to be added to this product entry in order-confirmation, perhaps as a function call to custom code to build a serial number etc:
* Possible parameters to pass to custom functions at this point:
* Product ID ordered (for this line item): $this->products[$i]['id']
* Quantity ordered (of this line-item): $this->products[$i]['qty']
* Order number: $zf_insert_id
* Attribute Option Name ID: (int)$this->products[$i]['attributes'][$j]['option_id']
* Attribute Option Value ID: (int)$this->products[$i]['attributes'][$j]['value_id']
* Attribute Filename: $attributes_values->fields['products_attributes_filename']
*
* 2. Add that data to the $this->products_ordered_attributes variable, using this sort of format:
* $this->products_ordered_attributes .= {INSERT CUSTOM INFORMATION HERE};
*/
$this->products_ordered_attributes .= $custom_insertable_text;
/* END: ADD MY CUSTOM DETAILS */
Specifically, you'll want to write an observer class to monitor the NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS notifier and have it do the license key lookup and return the license code so it can be automatically inserted into the email along with the specific product's information.
There are several forum threads discussing this, and maybe even some addons which use this and might serve as examples for you.
Bookmarks