c0nn0r Posted May 30, 2011 Share Posted May 30, 2011 Hello,I need to add to email template - bank wire - these variable{products} - name of the product{email}where and how can i do this?can anyone help me ?I tried to add them only in template but a get only {products}, {email}.I need to get, name of the product and email of the costumer.Thank you in advance Link to comment Share on other sites More sharing options...
shokinro Posted May 30, 2011 Share Posted May 30, 2011 you will need to change some code in site of following filesYourSiteRoot/modules/bankwire/validation.phpinsert your information as variable into following code. $mailVars = array( '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); Link to comment Share on other sites More sharing options...
c0nn0r Posted May 31, 2011 Author Share Posted May 31, 2011 Thanks for the answer but...Can you tell me what should i insert there if i want to have "email of the costumer" and the "product name" in bank wired email ?I tried to do that alone but my knowledge is to small Link to comment Share on other sites More sharing options...
shokinro Posted May 31, 2011 Share Posted May 31, 2011 basically you need to load the $products and $customer information first.$customer = new Customer($cookie->id_customer);$products = $cart->getProducts();Sorry I am not able touch my server at this moment, so the code may not correct.I will give you code example later if you still can not figure out. Link to comment Share on other sites More sharing options...
c0nn0r Posted June 2, 2011 Author Share Posted June 2, 2011 Sorry, i can`t figure out thiscan you write me what I need to insert there ? Link to comment Share on other sites More sharing options...
shokinro Posted June 2, 2011 Share Posted June 2, 2011 1. in file validation.phpPlease replace code with following code $mailVars = array( '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); with following code $customer = new Customer($cookie->id_customer); $products = $cart->getProducts(); $names = ''; foreach($products AS $product) { $names = $names . $product['name'] . ' \r\n'; } $mailVars = array( '{bankwire_customer_email}' => $customer->email, '{bankwire_products}' => $names, '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); 2. in bankwire mail templates, place the {bankwire_customer_email} and {bankwire_products} to the location you want it appears.Edited:Modified to fix an error Link to comment Share on other sites More sharing options...
comprausa Posted March 20, 2012 Share Posted March 20, 2012 I'm trying to do something similar. I want to display bankwire info in another module email notification. So far I've added this code to the template variables but it does not work: '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); Link to comment Share on other sites More sharing options...
it's me Posted May 2, 2016 Share Posted May 2, 2016 Hello, I know this is a old post but I also need to add additional variable to bankwire email template. I have prestashop 1.6 and i need to add variable for customers address this is a section of validation.php that i'm trying to modify I have added some code that, currently is not working. $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); $order = new Order((int)$order->id); $delivery = new Address((int)$order->id_address_delivery); $currency = $this->context->currency; $total = (float)$cart->getOrderTotal(true, Cart::BOTH); $mailVars = array( '{bankwire_delivery_address1}' => $customer->address1, '{bankwire_delivery_address2}' => $delivery->address2, '{bankwire_delivery_postal_code}' => $delivery->postcode, '{bankwire_delivery_city}' => $delivery->city, '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); Variables like {bankwire_delivery_address1} currently are not showing anything. I would appreciate any help. Link to comment Share on other sites More sharing options...
PrestaRob Posted May 14, 2018 Share Posted May 14, 2018 Hello, you can maybe try the other way around - create custom mail template with needed address fields and add bankwire details to the new template. There is solution for adding bankwire variables to mail templates other than "bankwire.tpl". Link: Bankwire variables in any mail template 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