简体   繁体   中英

Magento - selective email order confirmation

this could be a tricky question: I sell a lot of different items on my store to a point where I would like confirmation email to vary according to the item sold. example, all my Mens item sold would go to one person and all my women items sold go to another person.

Is this possible in magento?

It's possible, but you'd have to do some work.

Add a new module to your installation, let this module add a new product attribute lets say email .

Then in the module rewrite Mage_Sales_Model_Order so you can override the queueNewOrderEmail method (I'm assuming you're at 1.9, if not, you should update). Make sure you only override that one method, don't copy the entire file, it'll be less work to check nothing's changed when you upgrade.

In that method you end up replacing $copyMethod = Mage::getStoreConfig(self::XML_PATH_EMAIL_COPY_METHOD, $storeId); with a piece of code that will iterate through your order items and fetch the emails associated with it's products.

That way if an order has items for different people they'll all get an email.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM