Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Invoice notification

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #31  
Old 11-11-2014, 07:20 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

I'm working on testing this now, but lets just say this does work.

How do I go about putting in a "Settings" link on the Module to allow me to configure the Email address and subject?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #32  
Old 11-11-2014, 07:59 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

Well I went to Rebuild the Cache after enabling the Module and I'm getting the following error:
Code:
Deploying store [step 1 of 11], please wait... Cleaning up the cache... [0.00sec, 3.2MB (-56b)] Building classes tree... [2.06sec, 9.1MB (6.0MB)] Run the "Doctrine_Plugin_Cache" plugin... [0.00sec, 9.2MB (104kB)] Run the "Doctrine_Plugin_DocBlock_FakeEntities" plugin... Fatal error: Namespace declaration statement has to be the very first statement in the script in /home/myyamaha/public_html/lpo/classes/XLite/Module/FasterThanYours/InvoiceTextNotification/Model/Order.php on line 2
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #33  
Old 11-11-2014, 08:01 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

aaah nevermind, I figured it out, your code had a space before the <?php
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #34  
Old 11-11-2014, 08:10 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

Ok so I put in my personal cell number and didn't get the notice. I went and changed the status to Paid and Processed, I didn't get a notice.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #35  
Old 11-11-2014, 08:18 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

So I realized I had the wrong text email address in the Order.php I fixed that, but it still doesn't work. I did verify that email my text address does work.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #36  
Old 11-12-2014, 04:38 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

Hi Michael!

1) In order to create settings for address and subject, please use this article:
http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings

2) Could you please send me a pack of your module, so I could test it on my installation?

Tony.
__________________
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
  #37  
Old 11-12-2014, 06:03 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

Tony,

https://www.dropbox.com/s/7x0lv6soz9tec8q/FasterThanYours-InvoiceTextNotification-v5_1_8.tar?dl=0
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #38  
Old 11-13-2014, 06:03 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

Hi Michael!

I was wrong about what method you had to decorate. You should decorate the sendProcessOrderCustomer() method of the \XLite\Core\Mailer object.

This implementation would be something like this:

PHP Code:
<?php

namespace XLite\Module\FasterThanYours\InvoiceTextNotification\Core;

class 
Mailer extends \XLite\Core\Mailer implements \XLite\Base\IDecorator
{
    public static function 
sendProcessOrderCustomer(\XLite\Model\Order $order)
    {
        
parent::sendProcessOrderCustomer($order);

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

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

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

Surely, it should be located in the Core/Mailer.php file in your module directory.

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!

Last edited by tony_sologubov : 11-26-2014 at 06:03 AM.
Reply With Quote
  #39  
Old 11-14-2014, 08:34 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Invoice notification

So I made the Core Folder, put the Mailer.php inside it, added the code above. Rebuilt the Cache after removing the original Order Folder. When I went to checkout and hit Place order, it went to /cart.php?target=checkout and it was completely blank.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #40  
Old 11-17-2014, 05:36 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

Did you get any PHP error messages in the <X-Cart 5>/var/log/ folder? Check xlite.log and php_errors.log files.
__________________
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
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:26 PM.

   

 
X-Cart forums © 2001-2020