Jump to content

email veriables - bankwire


c0nn0r

Recommended Posts

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

you will need to change some code in site of following files

YourSiteRoot/modules/bankwire/validation.php

insert 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

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

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

1. in file validation.php
Please 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

  • 9 months later...

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

  • 4 years later...

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

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...