clatronic321 Posted March 21, 2016 Share Posted March 21, 2016 Hello reader, i have a huge problem with the emails. I want to add the order address to the template "cheque" The name of the variables is from the "order_conf" When a customer gets the email. You do not see the shipping address. They see the variables. I have to do to fix the errors? Many thanks. Link to comment Share on other sites More sharing options...
presta.show Posted March 21, 2016 Share Posted March 21, 2016 You must add this variable to module. If you want to add delivery address to mail: Open file: /modules/cheque/controllers/front/validation.php Replace this: $mailVars = array( '{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS'))); to: $delivery = new Address((int)$cart->id_address_delivery); $formattedDelivery = AddressFormat::generateAddress($delivery, array('avoid' => array()), "\n", ' ', array()); $mailVars = array( '{delivery_block_txt}' => $formattedDelivery, '{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS'))); Done Link to comment Share on other sites More sharing options...
clatronic321 Posted March 21, 2016 Author Share Posted March 21, 2016 Hello Kalifsoup, i have replace this to validation.php but it is still the same. I have make a test. In the cheque template is the variable "{ORDER_NAME}" I copy this to another line. (The blue line) And then i make a test. The same variable in the same Template. It is not working. Where i make an error? My Prestashop version is the 1.6.1.4 Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 Try edit mail template file manually by FTP. /mails/(lang)/cheque.html Link to comment Share on other sites More sharing options...
clatronic321 Posted March 22, 2016 Author Share Posted March 22, 2016 i go to the mails/de/ by FTP And i see "cheque.html". It was the standart. not the template i edit at the backend. Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 check /templates/(name)/mails/de/ Link to comment Share on other sites More sharing options...
clatronic321 Posted March 22, 2016 Author Share Posted March 22, 2016 i dont have a "templates" folder on the root. Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 sorry, check here: /themes/(name)/mails/de/ Link to comment Share on other sites More sharing options...
clatronic321 Posted March 22, 2016 Author Share Posted March 22, 2016 the {order_name} is running but the {delivery_bock_txt} not Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 Show me your file: /modules/cheque/controllers/front/validation.php Link to comment Share on other sites More sharing options...
clatronic321 Posted March 22, 2016 Author Share Posted March 22, 2016 This is the File validation.php Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 For test open file: /classes/order/OrderHistory.php and after this: if (isset($result['template']) && Validate::isEmail($result['email'])) { paste: if ($result['template'] == 'cheque') { $template_vars['delivery_block_txt'] = 'it works!'; } Check {delivery_block_txt} in mail. Link to comment Share on other sites More sharing options...
clatronic321 Posted March 23, 2016 Author Share Posted March 23, 2016 this is the test Link to comment Share on other sites More sharing options...
presta.show Posted March 25, 2016 Share Posted March 25, 2016 Open file: /classes/order/OrderHistory.php and after this: if (isset($result['template']) && Validate::isEmail($result['email'])) { paste this: // add delivery address to 'cheque.html' mail template if ($result['template'] == 'cheque') { $order = new Order((int) $this->id_order); $delivery = new Address((int) $order->id_address_delivery); $template_vars['delivery_block_html'] = AddressFormat::generateAddress( $delivery, array('avoid' => array()), "\n", ' ', array() ); } Check {delivery_block_html} in mail. Give me 'Like' if I helped you 1 Link to comment Share on other sites More sharing options...
clatronic321 Posted March 25, 2016 Author Share Posted March 25, 2016 This is amazing thanks the { you can remove these? my trial without the { has not been able Link to comment Share on other sites More sharing options...
clatronic321 Posted March 25, 2016 Author Share Posted March 25, 2016 I have fixt that problem i have edited the html file with notepad ++ so big thanks from germany 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