Kaper Posted September 23, 2017 Share Posted September 23, 2017 Hello, Please I need to insert Carrier Delay text in email shipped template. I tried this code into OrderHistory.php but it didn´t work. '{delivery_time}' => $carrier->delay, Can you guys help me? Thanks . Link to comment Share on other sites More sharing options...
ventura Posted September 23, 2017 Share Posted September 23, 2017 Try adding the color code $carrier = new Carrier($order->id_carrier, $order->id_lang); $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{delivery_time}' => $carrier->delay, '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); Link to comment Share on other sites More sharing options...
Kaper Posted September 24, 2017 Author Share Posted September 24, 2017 (edited) Hi Ventura, Appreciate your help. I tried it. I am using PS v. 1.6.1.16 and i got this error: PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) On this line: $carrier = new Carrier($order->id_carrier, order->id_lang); There is missing $ -> it should be like this:$carrier = new Carrier($order->id_carrier, $order->id_lang); After "fix" everything is working fine!!! THANK YOU Bro! Edited September 24, 2017 by Kaper (see edit history) Link to comment Share on other sites More sharing options...
coMegaWebMaster Posted November 30, 2017 Share Posted November 30, 2017 (edited) Hi, Am trying to add in PrestaShop v1.6.1.17 the: '{delivery_time}' => $carrier->delay, To the order_conf email template, as that there is also the {carrier} and would be nice if the delay information is also there. But the result is that am just seeing {delivery_time} in the email, I changed the /classes/order/OrderHistory.php if (isset($result['template']) && Validate::isEmail($result['email'])) { ShopUrl::cacheMainDomainForShop($order->id_shop); $carrier = new Carrier($order->id_carrier, $order->id_lang); $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{delivery_time}' => $carrier->delay, '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); With kind regards, Alexander. Edited December 13, 2017 by coMegaWebMaster Removed the quote's (see edit history) Link to comment Share on other sites More sharing options...
coMegaWebMaster Posted December 15, 2017 Share Posted December 15, 2017 (edited) Got it working, had to be in the /classes/PaymentModule.php // Send an e-mail to customer (one order = one email) $data = array( '{delivery_time}' => $carrier->delay, Then the {delivery_time} works in the email templates. With kind regards, Alexander. Edited March 13, 2018 by coMegaWebMaster No reaction, but found the solution. (see edit history) 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