Post by raconul » Mon Jun 04, 2018 5:07 am

opencart-solutions wrote:
Tue Jan 23, 2018 4:20 pm
That's very simple:

In catalog/controller/mail/order.php

Code: Select all

$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
after add

Code: Select all

$data['name'] = $order_info['firstname'])." ".$order_info['lastname']);
next find

Code: Select all

$data['text_date_added'] = $this->language->get('text_date_added');
and after add this

Code: Select all

$data['text_fullname'] = $this->language->get('text_fullname');

In catalog/language/your_language/mail/order_alert.php find this

Code: Select all

$_['text_date_added']   = 'Date Added:';
and after add

Code: Select all

$_['text_fullname']   = 'Name:';

In catalog/view/theme/your_theme_name/template/mail/order_alert.twig find this

Code: Select all

{{ text_date_added }} {{ date_added }}
after add this

Code: Select all

{{ text_fullname }} {{ name }}
...and that is all. If you had problems, contact me calmly. Have a nice day
Hi. it ll works well, except at this part

Code: Select all

$data['name'] = $order_info['firstname'])." ".$order_info['lastname']);
when you want to send your order it says> internat error

if i put it like this
$data['name'] = $order_info['firstname'] .$order_info['lastname'];
it works, but still there's an error when you send your order, and have to push the button twice.

does anybody know what's wrong? thanks!

User avatar
New member

Posts

Joined
Thu May 18, 2017 1:54 am

Post by sw!tch » Mon Jun 04, 2018 5:25 am

Code: Select all

$data['name'] = $order_info['firstname'])." ".$order_info['lastname']);
to

Code: Select all

$data['name'] = $order_info['firstname'].' '.$order_info['lastname'];
Whats the error? Check with chrome inspector see what the XHR request is doing on submit (assuming this is the checkout confirm button)

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by raconul » Mon Jun 04, 2018 2:18 pm

thanks for the reply sw!tch
I have changed the line like you said. it is working, but still the error when i press the send order:
syntax error: unexpected token in JSON at position 0
OK
{"redirect":"http:\/\/mystore.com\/index.php?route=checkout\/succes"}

and if i press it again... it works... and sends the order.

User avatar
New member

Posts

Joined
Thu May 18, 2017 1:54 am

Post by raconul » Mon Jun 04, 2018 3:27 pm

..as for the XHR reques, I don't know if I am doing this right. I have installed XHR Json Panel and when I press the button it says:
GET http://mystore.com/index.php?route=exte ... od/confirm 200 OK
null

GET Parameters:
{
"route": "extension/payment/cod/confirm"
}

but not when it gives me the error, just the second time.

User avatar
New member

Posts

Joined
Thu May 18, 2017 1:54 am

Post by markusha » Fri Apr 19, 2019 3:33 pm

I did it for this article and it worked! https://www.nibbl.ru/opencart/opencart- ... ciej.html

Newbie

Posts

Joined
Fri Apr 19, 2019 3:29 pm

Post by Matuce » Sun Apr 05, 2020 1:29 am

opencart-solutions wrote:
Tue Jan 23, 2018 4:20 pm
That's very simple:

In catalog/controller/mail/order.php

Code: Select all

$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
after add

Code: Select all

$data['name'] = $order_info['firstname'])." ".$order_info['lastname']);
next find

Code: Select all

$data['text_date_added'] = $this->language->get('text_date_added');
and after add this

Code: Select all

$data['text_fullname'] = $this->language->get('text_fullname');

In catalog/language/your_language/mail/order_alert.php find this

Code: Select all

$_['text_date_added']   = 'Date Added:';
and after add

Code: Select all

$_['text_fullname']   = 'Name:';

In catalog/view/theme/your_theme_name/template/mail/order_alert.twig find this

Code: Select all

{{ text_date_added }} {{ date_added }}
after add this

Code: Select all

{{ text_fullname }} {{ name }}
...and that is all. If you had problems, contact me calmly. Have a nice day
Hi I have tried this on opencart 3.0.3.2 and it is giving me an error on order php line 376 ($data['name'] = $order_info['firstname'])." ".$order_info['lastname']); if there is any chance of some help with this that would be great.

Newbie

Posts

Joined
Wed Sep 25, 2019 10:32 pm

Post by straightlight » Sun Apr 05, 2020 4:12 am

Replace:

Code: Select all

$data['name'] = $order_info['firstname'])." ".$order_info['lastname']);
with:

Code: Select all

$data['name'] = $order_info['firstname'] . " " . $order_info['lastname'];

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by fotaras00 » Thu Feb 04, 2021 6:08 pm

hello i did all the changes i need to add the costumer name on the mail alert but now the mail i get is without spacing

Έχετε λάβει μια παραγγελία.Αριθμός Παραγγελίας:36Ημερομηνία Προσθήκης:04/02/2021Ονομα:ΦΩΤΗΣ ΑΛΕΞΑΣΚατάσταση Παραγγελίας:PendingΠροϊόντα1xAnatomisch Anti Slip (ANA-00006)4,00€ΣύνολαΜερικό Σύνολο:4,00€Παραλαβή από το κατάστημα:0,00€Σύνολο:4,00€

thank you

Newbie

Posts

Joined
Mon May 06, 2019 10:56 pm

Post by mikeinterserv » Fri Feb 05, 2021 12:40 am

Do this instead you'll get the whole thing
BACKUP ORIGINAL FILE FIRST

Find line 270
in catalog>controller>mail>order.php
Replace with this

Code: Select all

$mail->setTo($order_info['email'].','.$this->config->get('config_email'));
Then you can disable the normal alert so you don't get the rubbish one

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales
Who is online

Users browsing this forum: Majestic-12 [Bot] and 68 guests