Jump to content

Carrier delay text in E-mail tpl (Please)


Kaper

Recommended Posts

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

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 by Kaper (see edit history)
Link to comment
Share on other sites

  • 2 months later...

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 by coMegaWebMaster
Removed the quote's (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

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 by coMegaWebMaster
No reaction, but found the solution. (see edit history)
Link to comment
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
×
×
  • Create New...