Jump to content

[SOLVED] PS 1.5.4 in header Confirmation e-mail is {id_order}


Recommended Posts

Hi komo,

Did you add this code yourself to the template?

This variable name doesn't seem to be defined in the array given to the Email builder:

If I'm not mistaken, this Email is created in /classes/paymentmodule.php

In the function validateOrder.

 

Somewhere in this function (search for 'order_conf') the confirmation Email is created, and it gets a data array with all variables that may be available in the Template, to fill in/replace there.

This array is defined just before this Email creation code piece. An array named:

 

 

$data = array(

'{firstname}' => $this->context->customer->firstname,

'{lastname}' => $this->context->customer->lastname,

'{email}' => $this->context->customer->email,

'{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),

'{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),

'{delivery_block_html}' => $this->_getFormatedAddress($delivery, '<br />', array(

'firstname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>',

'lastname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>'

)),

'{invoice_block_html}' => $this->_getFormatedAddress($invoice, '<br />', array(

'firstname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>',

'lastname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>'

)),

'{delivery_company}' => $delivery->company,

'{delivery_firstname}' => $delivery->firstname,

'{delivery_lastname}' => $delivery->lastname,

'{delivery_address1}' => $delivery->address1,

'{delivery_address2}' => $delivery->address2,

'{delivery_city}' => $delivery->city,

'{delivery_postal_code}' => $delivery->postcode,

'{delivery_country}' => $delivery->country,

'{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',

'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,

'{delivery_other}' => $delivery->other,

'{invoice_company}' => $invoice->company,

'{invoice_vat_number}' => $invoice->vat_number,

'{invoice_firstname}' => $invoice->firstname,

'{invoice_lastname}' => $invoice->lastname,

'{invoice_address2}' => $invoice->address2,

'{invoice_address1}' => $invoice->address1,

'{invoice_city}' => $invoice->city,

'{invoice_postal_code}' => $invoice->postcode,

'{invoice_country}' => $invoice->country,

'{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',

'{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,

'{invoice_other}' => $invoice->other,

'{order_name}' => $order->getUniqReference(),

'{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)$order->id_lang, 1),

'{carrier}' => $virtual_product ? Tools::displayError('No carrier') : $carrier->name,

'{payment}' => Tools::substr($order->payment, 0, 32),

'{products}' => $this->formatProductAndVoucherForEmail($products_list),

'{discounts}' => $this->formatProductAndVoucherForEmail($cart_rules_list),

'{total_paid}' => Tools::displayPrice($order->total_paid, $this->context->currency, false),

'{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $this->context->currency, false),

'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),

'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),

'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false));

 

As you can see, {id_order} is not defined.

 

So you can either change it to {order_name} in the template file

and see if that give the correct result, or add {id_order} to the array yourself:

Then just add this line somewhere inside the array:

 

 

'{id_order}' => (int)$order->id,

say, just below {order_name}

 

Save the file and try it out.

 

Hope it helps, let us know.

Pascal

  • Like 1
Link to comment
Share on other sites

  • 10 months later...
  • 4 months later...
×
×
  • Create New...