mcluca Posted January 10, 2014 Share Posted January 10, 2014 hi. I use ps 1.4 and now i have add a new field ($my_field) on product page in BO. i have add variable in class/product.php and create new filed in database PS_PRODUCT_MY_FIELD. All it's ok Now i want use this variable (example $my_field) in mailalert module for neworder. I have add $my_field in class/orderdetail.php public $product_my_filed; 'product_my_filed' => 'isUnsignedInt', $fields['product_my_filed'] = pSQL($this->product_my_field); I have add product_my_field in PS_ORDERDETAIL_MY_FIELD database. In modules/mailalerts/mailalerts.php $itemsTable .= '<tr style="background-color:'.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding:0.6em 0.4em;">'.$product['product_reference'].'</td> <td style="padding:0.6em 0.4em;">'.$product['product_my_field'].'</td> <td style="padding:0.6em 0.4em;"><strong>'.$product['product_name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').(!empty($customizationText) ? '<br />'.$customizationText : '').'</strong></td> <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice($unit_price, $currency, false).'</td> <td style="padding:0.6em 0.4em; text-align:center;">'.(int)($product['product_quantity']).'</td> <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false).'</td> </tr>'; but when receive order mail this field is empty. Help please!!! Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 10, 2014 Share Posted January 10, 2014 Hi. Most probably the new field you added to the OrderDetail class is not set (it's empty). Are you setting it's value when the new order is created? Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
mcluca Posted January 10, 2014 Author Share Posted January 10, 2014 thanks. How can i setting it's value when the new order is created? is there a function that do this? i have see "reference" in "product" db that when customer make an order pass his value to "orderdetail" prodcut_reference and later in mailalerts module. Can you give me a suggestion? Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 10, 2014 Share Posted January 10, 2014 Search for the INSERT query in to the order_detail table in PaymenModule.php Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
mcluca Posted January 13, 2014 Author Share Posted January 13, 2014 hi thanks for answer but nothing. I have add in PaymenModule.php $query = 'INSERT INTO `'._DB_PREFIX_.'order_detail` product_name_my_field and in $query .= '.(empty($product['my_filed']) ? 'NULL' : '\''.pSQL($product['my_filed']).'\'').', Any suggestion? Link to comment Share on other sites More sharing options...
mcluca Posted January 17, 2014 Author Share Posted January 17, 2014 Help me pls!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now