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

XC5 anomolies - invoice contents, duplicate messages etc.

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 01-08-2015, 04:13 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: XC5 anomolies - invoice contents, duplicate messages etc.

Quote:
Originally Posted by gkarlsson
Is there a hook, that I can use, to enable sending email notifications on credit card capture? I really don't want to have to browse through more code than I need to.

Yes, sure. You need to decorate the doPayment() method in \XLite\Controller\Customer\Checkout class and call the \XLite\Core\Mailer::getInstance()->sendOrderCreated($cart); method, before this code:

PHP Code:
if ($cart->isPayed()) {
                
$paymentStatus $paymentStatusCode ?: \XLite\Model\Order\Status\Payment::STATUS_PAID;

            } elseif (
$transaction && $transaction->isFailed()) {
                
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_DECLINED;

            } else {
                
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_QUEUED;
                \
XLite\Core\Mailer::getInstance()->sendOrderCreated($cart);
            } 

Of course, you should remove this routine from this piece of code:
PHP Code:
} else {
                
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_QUEUED;
                \
XLite\Core\Mailer::getInstance()->sendOrderCreated($cart);
            } 

In order to avoid double notifications for offline payment methods.

Please, let me know if it makes sense to you.

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
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:36 AM.

   

 
X-Cart forums © 2001-2020