View Single Post
  #30  
Old 11-11-2014, 07:19 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Invoice notification

The simplest implementation would be something like this:

PHP Code:
<?php

namespace XLite\Module\FasterThanYours\InvoiceTextNotification\Model;

class 
Order extends \XLite\Model\Order implements \XLite\Base\IDecorator
{
    protected function 
sendProcessMail()
    {
        
parent::sendProcessMail();

        
$to '5551234567@vtext.com';
        
$subject 'There was a sale!';
        
$body '';

        foreach (
$this->getItems() as $item) {
            
$product $item->getProduct();
            
$body .= 'Product: ' $product->getName() . ' sku: ' $product->getSKU() . ' price: ' $product->getPrice() . PHP_EOL;
        }

        
mail($to$subject$body);
    }
}

I have not tested it, so please sorry if it does not work straight away. It shows you the idea though.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote