Magento Expert Forum - Improve your Magento experience
-
-
-
Possible reason for the error is conflict with some custom extension. Try to disable custom extension if there. Also verify that template is successfully loaded in admin system -> Transaction Email section.
-
-
Hi,
If you look in
layout/sales.xml:268
You will see the layout handle sales_email_order_items. Inside there is a block "order_totals", which has that template. To add a new total to the email you would just have to add it as a child of that. On line 275 you can see they add a block named 'tax'.
Inside the totals.phtml file you can see it call $this->getTotals() as part of a foreach. That method is defined at
Mage/Sales/Block/Order/Totals.php:281
This just returns the totals that are already defined. This data is populated by config.xml files that have defined:
<global><sales><quote><totals>...
Jumping back to totals.phtml, it checks if the total has a block defined for it. This would be a field in the config.xml file. If you have a totals model you want to customize you would do it that way.
Otherwise, before the page is rendered (call to _beforeToHtml() on line 44) it interates over the child blocks and, if they respond to the method 'initTotals', calls that method. That method should create an object that represents your total and add it to the parent. For example, here is the code for a totals block I recently wrote (which is based on code I can't post publicly):
public function initTotals()
{
if ((float)$this->getParentBlock()->getSource()->getMytotalAmount() == 0) {
return $this;
}
$total = new Varien_Object(array(
'code' => $this->getNameInLayout(),
'block_name'=> $this->getNameInLayout(),
'area' => $this->getArea()
));
$after = $this->getAfterTotal();
if (!$after) {
$after = 'subtotal';
}
$this->getParentBlock()->addTotal($total, $after);
return $this;
}
-
-
ooCommerce – remove Total and Subtotal from order emails being shown on my email templates, amongst the new order information text . the email to your theme, so you're not altering the core WooCommerce version.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks