User Tools

Site Tools


tutorials:zencartmods:custom_confirmation_text.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:zencartmods:custom_confirmation_text.html [2011/07/11 15:52]
daigo created
tutorials:zencartmods:custom_confirmation_text.html [2016/01/28 18:05]
Line 1: Line 1:
-{{:​tutorials:​zencartmods:​tutorialslink.jpg?​|}} 
- 
- 
-Zencart sends order confirmation emails, but by default they might not have enough information. 
- 
- 
-To add some extra info to emails that our customers receive, look through **incudes/​modules/​classes/​order/​php** and around line 863 you'll find these fantastic instructions:​ 
- 
-<code php> 
-/* 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 */ 
- 
-</​code>​ 
- 
- 
-**$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: 
- 
-<code php> 
-$this->​products_ordered_attributes .= "\n Tutorials: [[" . HTTP_SERVER . '/​products/'​ . $this->​products[$i]['​id'​] . "#​tutorials]]"; ​ 
-</​code>​ 
- 
- 
  
/home/ladyada/public_html/wiki/data/pages/tutorials/zencartmods/custom_confirmation_text.html.txt · Last modified: 2016/01/28 18:05 (external edit)