Jump to content

Bank wire details don't show on status email


webtrend
 Share

Recommended Posts

Hi,

 

I have an issue with Prestashop 1.6 and I don't know how to solve it.

 

I have created a new status on back office (Orders> Statuses) and I want to use bankwire email template for this status, so I have assigned banwkire email template.

 

Problem is the fact that when I do test to see how the email it looks, bank wire details are not passed as it can be seen below:

 

http://prntscr.com/ccicyw

 

When I do change the status to "Awaiting bank wire payments" email it looks OK, but when I do change back the status to the newly created one, bankwire details are show as tags (as on the screenshot above).

 

Is this a Prestashop bug?

 

Any help will be much appreciated :)

 

 

Share this post


Link to post
Share on other sites

bankwire details are defined only in bankwire module while order process.

they will not be added to order state if you will change order status in shop back office so in effect these variables will not be replaced in email 

  • Like 1

Share this post


Link to post
Share on other sites

Try changing lines 424-432 of classes/orders/OrderHistory.php from:

            $data = array(
                '{lastname}' => $result['lastname'],
                '{firstname}' => $result['firstname'],
                '{id_order}' => (int)$this->id_order,
                '{order_name}' => $order->getUniqReference()
            );

to:

            $data = array(
                '{lastname}' => $result['lastname'],
                '{firstname}' => $result['firstname'],
                '{id_order}' => (int)$this->id_order,
                '{order_name}' => $order->getUniqReference(),
                '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
                '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
                '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
            );
  • Like 3

Share this post


Link to post
Share on other sites

  • 9 months later...
  • 10 months later...

Hello,

if you need bankwire variables usable in any mail template with any order status, you need to edit file //PrestaFolder/classes/Mail.php

Find the line starting with:

$template_vars['{color}']

And below that line add this piece of code:

/* MK-VISION.CZ BANKWIRE MAIL VARIABLES */
$template_vars['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER');
$template_vars['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS'));
$template_vars['{bankwire_address}'] = nl2br(Configuration::get('BANK_WIRE_ADDRESS'));

I have tested it with Prestashop 1.6.1.3. Let me know if that helped.

Have a nice day.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

  • 1 year later...
On 5/14/2018 at 6:36 PM, PrestaRob said:

Hello,

if you need bankwire variables usable in any mail template with any order status, you need to edit file //PrestaFolder/classes/Mail.php

Find the line starting with:

$template_vars['{color}']

And below that line add this piece of code:

/* MK-VISION.CZ BANKWIRE MAIL VARIABLES */
$template_vars['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER');
$template_vars['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS'));
$template_vars['{bankwire_address}'] = nl2br(Configuration::get('BANK_WIRE_ADDRESS'));

I have tested it with Prestashop 1.6.1.3. Let me know if that helped.

Have a nice day.

Hello, i'm using Prestashop 1.7.5. Your solution doesn't work for my version. Any idea how to solve this problem?

Share this post


Link to post
Share on other sites

  • 2 months later...
On 7/17/2019 at 3:44 PM, Talas said:

Hello, i'm using Prestashop 1.7.5. Your solution doesn't work for my version. Any idea how to solve this problem?

Hi Talas,

In Presta 1.7, the variable `$template_vars` has been renamed to `$templateVars` (declared and instantiated around line 536 of classes/Mail.php)

So you can take what PrestaRob wrote and change the variable name from $template_vars to $templateVars.

I have tested this in 1.7.4.2 and there is nothing in the change-logs about mails for the 1.7.5 so this should work fine on your version.

Have a nice day.

  • Thanks 1

Share this post


Link to post
Share on other sites

  • 6 months later...
  • 1 year later...
On 9/1/2016 at 10:09 AM, rocky said:

Try changing lines 424-432 of classes/orders/OrderHistory.php from:

            $data = array(
                '{lastname}' => $result['lastname'],
                '{firstname}' => $result['firstname'],
                '{id_order}' => (int)$this->id_order,
                '{order_name}' => $order->getUniqReference()
            );

to:

            $data = array(
                '{lastname}' => $result['lastname'],
                '{firstname}' => $result['firstname'],
                '{id_order}' => (int)$this->id_order,
                '{order_name}' => $order->getUniqReference(),
                '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
                '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
                '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
            );

This works fine for me in 1.7.7.3.

Put it in a class override so no problem with upgrades.

Many thanks to the author!

Share this post


Link to post
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More