0

I am using Marketplace in my website. In here seller can able to Process the order. I given below the code

public function shipementorderAction(){
                $id = $this->getRequest()->getParam('id');

                $order = Mage::getModel('sales/order')->load($id);
                $order->setData('state', 'shipement');
                $order->setStatus('shipement');
                $history = $order->addStatusHistoryComment('', false);
                $history->setIsCustomerNotified(false);
                $order->save(); 

                $order->sendOrderUpdateEmail(true, null);

                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );

                Mage::getSingleton('core/session') ->addSuccess('Order Updated Successfully'); $this->_redirectReferer();


                }

I used this code to send a email to customer

$order->sendOrderUpdateEmail(true, null);

How to send copy of email to that current seller? Like customer got a order status mail as well as seller also got copy of same mail

2
  • you want to sent a custom email or use the order status email? Jan 4, 2016 at 6:07
  • Custom email to seller
    – Magento 2
    Jan 4, 2016 at 6:11

1 Answer 1

1

add this code in marketplace module etc/config.xml inside the global tag

<template>
            <email>
              <sales_email_order_custom_comment_template translate="label" module="sales">
                    <label>Order Update</label>
                    <file>sales/custom_order_update.html</file>
                    <type>html</type>
                </sales_email_order_custom_comment_template>
           </email>
  </template>

make copy of order_update.html and rename to custom_order_update.html

for sending the email add this code

    $emailTemplate  = Mage::getModel('core/email_template')
                                    ->loadDefault('sales_email_order_custom_comment_template');
                    $emailTemplate
                    ->setDesignConfig(array('area' => 'frontend', 'store' => $store->getId()));                                                  
                    $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name'));
                    $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email')); 
                    $emailTemplate->setTemplateSubject('Order Updated Order #'.$order->getIncrementId()); 
  $emailTemplateVariables['order'] = $order; 
                  $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
                $emailTemplate->send('emailhere','seller name', $emailTemplateVariables,$storeId=null);
14
  • i need to add config.xml only or some other file
    – Magento 2
    Jan 4, 2016 at 6:50
  • you need to add xml code in your marketplace module config.xml Jan 4, 2016 at 6:51
  • Ok i will check
    – Magento 2
    Jan 4, 2016 at 7:04
  • How to get Seller mail id
    – Magento 2
    Jan 4, 2016 at 7:49
  • i think seller is login and you have his session id got it form there.. Jan 4, 2016 at 7:53

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.