User Tools

Site Tools


Custom Confirmation Emails

Zencart sends order confirmation emails, but by default they might not have enough information.

To add some extra info to emails that your customers receive, look through incudes/modules/classes/order/php and around line 863 you'll find these fantastic instructions:

/* 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;

$this→products_ordered_attributes gets added into the email a few lines down both for html and text-based emails.

In our case, we wanted to add links to the products documentation, so our code looks like this:

$this->products_ordered_attributes .= "\n Tutorials: [[" . HTTP_SERVER . '/products/' . $this->products[$i]['id'] . "#tutorials]]"; 
/home/ladyada/public_html/wiki/data/pages/tutorials/zencartmods/custom_confirmation_text.html.txt · Last modified: 2016/01/28 18:05 (external edit)