sisow plugins emails before payment

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

sisow plugins emails before payment

Postby admin » Thu Jan 04, 2018 6:12 pm

hello friends, if you'd like to send customer's emails before the payment is done when using sisow plugins, you may want to adjust the sisow code to:

locate the file:
\libraries\sisow\base.php

original code starting at line 331:

Code: Select all
$sisow->callbackUrl = $sisow->notifyUrl;
      
      $modelOrder = VmModel::getModel ('orders');

      if(($ex = $sisow->TransactionRequest($arg)) < 0)
      {
         $order['customer_notified'] = 0;
         $order['order_status'] = $method->status_failure;
         $order['comments'] = $ex . " " . $sisow->errorCode;
         $modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
         
         $app = JFactory::getApplication ();
         $app->enqueueMessage (vmText::_('VMPAYMENT_SISOW_PAYMENT_FAILED') . '('.$ex.', '.$sisow->errorCode.')', 'error');
         $app->redirect (JRoute::_ ('index.php?option=com_virtuemart&view=cart&task=editpayment'));
         exit;
      }
      else
      {
         if($order['details']['BT']->order_status != $method->status_pending)
         {
            $order['customer_notified'] = 0;
            $order['order_status'] = $method->status_pending;
            $modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
         }



updated code to send email before payment:


Code: Select all
$sisow->callbackUrl = $sisow->notifyUrl;

$modelOrder = VmModel::getModel ('orders');
      if (method_exists($orderModel, 'emptyCache')) {
         $modelOrder->emptyCache();
      }
      
      if(($ex = $sisow->TransactionRequest($arg)) < 0)
      {
         $order['customer_notified'] = 1;
         $order['order_status'] = $method->status_failure;
         $order['comments'] = $ex . " " . $sisow->errorCode;
         $modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
         
         $app = JFactory::getApplication ();
         $app->enqueueMessage (vmText::_('VMPAYMENT_SISOW_PAYMENT_FAILED') . '('.$ex.', '.$sisow->errorCode.')', 'error');
         $app->redirect (JRoute::_ ('index.php?option=com_virtuemart&view=cart&task=editpayment'));
         exit;
      }
      else
      {
         if($order['details']['BT']->order_status != $method->status_pending)
         {
            $order['customer_notified'] = 1;
            $order['order_status'] = $method->status_pending;
            $modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
         }


please note that this is only a fraction of the code within the file.

best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2593
Joined: Wed Jan 06, 2010 11:43 pm

Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron