2

I want to add custom data in order confirmation email. I have vehicle information that are attached to the order email to show to customer their vehicle make, model, year. These values are attached with order_id.

2

1 Answer 1

7

First copy app\code\core\Mage\Sales\Model\Order.php to app\code\local\Mage\Sales\Model\Order.php

Now you have to create function for your requirement. If your order data return value for vehicle model as $order['vehicle_model'] then you have to declare function in Order.php file of local.

public function getVehicleModel(){
    return $this->getVehicleModel();
}

You have to set value in System -> Transactional email -> New order template.

You have to set below statement in your email template.
{{var order.getVehicleModel()}}

Now email template will display vehicle model value.

Same as above you have to generate function for Vehicle year, Vehicle make and call in email template file in admin.

3
  • now i am getting blank email Commented Nov 6, 2015 at 10:05
  • plz give me your order collection data related to your vehilcle info field.Then i can tell you about which method and getting parameter for that to available in email. Commented Nov 6, 2015 at 10:15
  • my mistake the field name was not correct . +1 Commented Nov 6, 2015 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.