mcluca Posted November 16, 2013 Posted November 16, 2013 Hi i want add new field in mail alert module for new order. New field is my custom feature. Any solution? Thanks Share this post Link to post Share on other sites More sharing options...
vekia Posted November 17, 2013 Posted November 17, 2013 modify mail alert module. inside module php file (mailalerts.php) you've got funciton: public function hookActionValidateOrder($params) somewhere inside of this function you've got definition of mail template vars: $template_vars = array( '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{delivery_block_txt}' => MailAlert::getFormatedAddress($delivery, "\n"), '{invoice_block_txt}' => MailAlert::getFormatedAddress($invoice, "\n"), '{delivery_block_html}' => MailAlert::getFormatedAddress($delivery, '<br />', array( 'firstname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>', 'lastname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>')), '{invoice_block_html}' => MailAlert::getFormatedAddress($invoice, '<br />', array( 'firstname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].' font-weight:bold;">%s</span>', 'lastname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>')), '{delivery_company}' => $delivery->company, '{delivery_firstname}' => $delivery->firstname, '{delivery_lastname}' => $delivery->lastname, '{delivery_address1}' => $delivery->address1, '{delivery_address2}' => $delivery->address2, '{delivery_city}' => $delivery->city, '{delivery_postal_code}' => $delivery->postcode, '{delivery_country}' => $delivery->country, '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '', '{delivery_phone}' => $delivery->phone ? $delivery->phone : $delivery->phone_mobile, '{delivery_other}' => $delivery->other, '{invoice_company}' => $invoice->company, '{invoice_firstname}' => $invoice->firstname, '{invoice_lastname}' => $invoice->lastname, '{invoice_address2}' => $invoice->address2, '{invoice_address1}' => $invoice->address1, '{invoice_city}' => $invoice->city, '{invoice_postal_code}' => $invoice->postcode, '{invoice_country}' => $invoice->country, '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', '{invoice_phone}' => $invoice->phone ? $invoice->phone : $invoice->phone_mobile, '{invoice_other}' => $invoice->other, '{order_name}' => sprintf('%06d', $order->id), '{shop_name}' => $configuration['PS_SHOP_NAME'], '{date}' => $order_date_text, '{carrier}' => (($carrier->name == '0') ? $configuration['PS_SHOP_NAME'] : $carrier->name), '{payment}' => Tools::substr($order->payment, 0, 32), '{items}' => $items_table, '{total_paid}' => Tools::displayPrice($order->total_paid, $currency), '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), '{currency}' => $currency->sign, '{message}' => $message ); just add your variable there 1 Share this post Link to post Share on other sites More sharing options...
mcluca Posted November 17, 2013 Posted November 17, 2013 like this (for example my feature name is 'abc') '{feature}' =>$feature['abc'] and add 'abc' value for each product Thanks Share this post Link to post Share on other sites More sharing options...
vekia Posted November 18, 2013 Posted November 18, 2013 if you've got this variable defined somewhere ($feature['abc']) the answer is: yes then you will be able to use in email template {feature} variable Share this post Link to post Share on other sites More sharing options...
mcluca Posted November 18, 2013 Posted November 18, 2013 ok but if i want to use feature of product already created with back office? is it possible? Share this post Link to post Share on other sites More sharing options...
vekia Posted November 18, 2013 Posted November 18, 2013 in this case you will need to pass variable with all product from order your smarty array Share this post Link to post Share on other sites More sharing options...
mcluca Posted November 18, 2013 Posted November 18, 2013 thanks. is there a tutorial can explain me how pass faeture variable to mail template? Share this post Link to post Share on other sites More sharing options...
ITIS-Commerce.com Posted April 15, 2014 Posted April 15, 2014 Hi, I would like to add a field in the email (the ID of the customer group) but i don't know how to do this. Did you find a tutorial or something to explain that to me? Where did you you your changes? What changes did you do?Thanks. Share this post Link to post Share on other sites More sharing options...
Petter B Posted September 30, 2014 Posted September 30, 2014 I would like to add the customers ID-number in the mailalert I get. Is that possible? Share this post Link to post Share on other sites More sharing options...
thelauman Posted November 24, 2014 Posted November 24, 2014 Hi, I would like to add the shipping type, for example Pick-up or parcel or whatever.. How would I add this variable so I can add this to the email template? ie. {shipping_type} => ???? Many thanks Share this post Link to post 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