jaimeweb Posted May 27, 2010 Share Posted May 27, 2010 Hi, I have some products that require the user to put a "player number" in a input field. when the order goes through the custom field appear on the order in BO but not on the email sent to me. Anyway i could get this to show on my notification email? thanks Link to comment Share on other sites More sharing options...
rocky Posted May 28, 2010 Share Posted May 28, 2010 This is actually quite tricky to do, so forgive me if I don't get the code right the first time. It is the hookNewOrder function in modules/mailalerts/mailalerts.php that writes the product information for the emails into the $itemsTable variable. It is the first foreach loop you'll need to edit. You'll need to add: $customizedDatas = Product::getAllCustomizedDatas($order->id_cart, $id_lang); then in the foreach loop, you can use the following to get the customised value: $customizedName = ($product['id_customization'] > 0 ? $customizedDatas[$product['id_product']][$product['id_product_attribute']][$product['id_customization']][1]['value'] : NULL); Then change the following line: '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').' to: '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').($customizedName != NULL ? ' - ' . $customizedName : '').' Link to comment Share on other sites More sharing options...
arnaud81 Posted September 10, 2010 Share Posted September 10, 2010 Hello Rocky !I'm trying to modify mailalerts.php as you explained, but my customized datas are still not showing on the email...Here is mi code : $itemsTable = ''; foreach ($params['cart']->getProducts() AS $key => $product) { $unit_price = Product::getPriceStatic($product['id_product'], true, $product['id_product_attribute']); $price = Product::getPriceStatic($product['id_product'], true, $product['id_product_attribute'], 6, NULL, false, true, $product['cart_quantity']); $customizedDatas = Product::getAllCustomizedDatas($order->id_cart, $id_lang); //MOdif $customizedName = ($product['id_customization'] > 0 ? $customizedDatas[$product['id_product']][$product['id_product_attribute']][$product['id_customization']][1]['value'] : NULL);//Modif $itemsTable .= ' '.$product['reference'].' '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').($customizedName != NULL ? ' - ' . $customizedName : '').' '.Tools::displayPrice($unit_price, $currency, false, false).' '.intval($product['cart_quantity']).' '.Tools::displayPrice(($price * $product['cart_quantity']), $currency, false, false).' '; } Do you have an idea ?Thanks Link to comment Share on other sites More sharing options...
babyewok Posted September 26, 2010 Share Posted September 26, 2010 Did you get this working? Most items in my client's shop include customized text fields so I really need to find out how to add this info to the new order emails. Link to comment Share on other sites More sharing options...
arnaud81 Posted September 27, 2010 Share Posted September 27, 2010 Hi babyewok,I finally used the client's notification email (wich has the customized textfields listed) :I have modified the PayementModule.php class in order to send the email to 3 other persons. Around the line 381 (But my file is modified because I list the customized textfields with ) you have to find if ($orderStatus->send_email AND Validate::isEmail($customer->email)) Mail::Send(intval($order->id_lang), 'order_conf', 'Order confirmation', $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); and add just after Mail::Send(intval($order->id_lang), 'order_conf_admin', 'New Order from '.($customer->firstname).' '.($customer->lastname), $data, array('[email protected]','[email protected]','[email protected]'), $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); As I am sending the email to 3 persons, I uses an array, but you can put just an address instead.I hope it will help. 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