Reputation: 1
I have created a separate supplier purchase order email for each new order in Magento. I can show line items with each base cost using {{var item.getBaseCost()}};
I need to show the Net Total of all costs (so the sum of all item costs, not sell prices).
I have tried using {{var order.getBaseTotalInvoicedCost()}}; but it doesn't return a value in the email.
If anyone could shed some light on this I'd really appreciate it (two days in so far and unable to find a solution)!
Thanks in advance
Upvotes: 0
Views: 1483
Reputation: 624
You need to override this model app/code/core/Mage/Sales/Model/Order.php
You need to rewrite this method sendNewOrderEmail and you can find there following array you can add your custom variable and set it value. In following example totalcost is custom variable.
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml,
'totalcost' => $value
));
For email template you can use this variable {{var totalcost}}
Upvotes: 1