Jump to content

How to add data to shipped email template


Recommended Posts

Hello,

I'm trying to add some variables to shipped email template.

 

The data I need add are: delivery_block_html, invoice_block_html, delivery_other and followup variables.

 

I started with delivery_bock_html, by editing /controllers/admin/AdminOrdersController.php, replacing (2 occurrences, lines 408 and 535):

if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) {
    $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url));
}

with this piece of code:

 

if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) {
    $templateVars = array(
        '{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
        '{delivery_block_html}' => MailAlert::getFormatedAddress(
            $delivery, '<br />', array(
                'firstname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>',
                'lastname' => '<span style="color:'.$configuration['PS_MAIL_COLOR'].'; font-weight:bold;">%s</span>'
            )
        )
    );
}

but  the email I receive has {delivery_block_html} shortcode, as if I didn't anything. I attach screenshot of received email.

 

post-364177-0-30647000-1496938530_thumb.png

 

What am I doing wrog?

 

Thanks!!

 

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...