- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want edit sendNewOrderEmail() function from Mage_Sales_Model_Order class . I want achieve following task as,
1. Need to set different template for new order email on the basis of product type.
EX . If product type is downloadable need to send downloadbale template.
If product is simple need to send simple email template for logged in users.
How Do I achieve?
Any Help... Thanks in advance....
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To send different order confirmation email depending on specific criteria you would either have to :
- Rewrite sendNewOrderEmail() in Mage_Sales_Model_Order and add logic to check the template
- Disable magento "order confirmation email" in system config, then create a custom module to send your email by coping logic from sendNewOrderEmail() using event/observer
- For simple text changes, you could use template logic {{if order.customer_group_id}} or {{depend order.customer_group_id}} but they seem to only evaluate true/false condition, therefore for more advance logic you could include a block
{{block type='core/template' area='frontend' template='sales/custom_logic.phtml' order=$order}}
In custom_logic.phtml
<?php $order = $this->getOrder() if($order->getCustomerGroupId() == 1){ ///do ....
Magento plugins released: http://www.opensourcetechnologies.com/product/product-category/magento-extensions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To send different order confirmation email depending on specific criteria you would either have to :
- Rewrite sendNewOrderEmail() in Mage_Sales_Model_Order and add logic to check the template
- Disable magento "order confirmation email" in system config, then create a custom module to send your email by coping logic from sendNewOrderEmail() using event/observer
- For simple text changes, you could use template logic {{if order.customer_group_id}} or {{depend order.customer_group_id}} but they seem to only evaluate true/false condition, therefore for more advance logic you could include a block
{{block type='core/template' area='frontend' template='sales/custom_logic.phtml' order=$order}}
In custom_logic.phtml
<?php $order = $this->getOrder() if($order->getCustomerGroupId() == 1){ ///do ....
Magento plugins released: http://www.opensourcetechnologies.com/product/product-category/magento-extensions