Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Email template - Comment
 
_henry_
Jr. Member
 
Total Posts:  14
Joined:  2008-01-08
 

Hi all,

I would like to know how to include the ‘comment’ field into my email when changing the order status.

var {{ this.is.what.i.am.looking.for }}
wink

I found in th file app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php the following code :

$order->addStatus($newStatus$this->getRequest()->getParam('comments'''), $notifyCustomer);

$new_status is the variable retrieved from the editing form of an order (back office) and $this->getRequest()->getParam(’comments’, ‘’) is the comment I would like to include in my email (using the template). This doesn’t really help me to guess what to put in the template to include my comment. Mayby someone will guess with this small portion of code?!

I also found my comment as stocked in the table : sales_order_entity_text

thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
_henry_
Jr. Member
 
Total Posts:  14
Joined:  2008-01-08
 

foud the solution :

add this to app/code/core/Mage/Sales/Model/Order.php :

public function getLastStatusHistory(){
                
        $last_history 
'';
        
        foreach(
$this->getAllStatusHistory() as $_history){
            $last_history 
$_history->getComments();
        
}

        
return $last_history;
        
    
}

then simply call {{var order.getLastStatusHistory()}} into your template model smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Carlete
Jr. Member
 
Total Posts:  2
Joined:  2008-04-06
 

Is there a way to do this… without the mod to the Magento Core??

I tried to add a module, following this thread’s instructions… and trying to apply it to my thing… but didn’t work…

Does anyone knows how to do it?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top