News:

Support the VirtueMart project and become a member

Main Menu

Problem in upgrade payment plugin to vm3

Started by mahdi.manian, August 11, 2015, 19:04:13 PM

Previous topic - Next topic

mahdi.manian

Hello.

I had a payment plugin in joomla 2.5 and vm2 and upgrade it to joomla 3 and vm3. All the steps of pay on this plugin work very well but email to vendor and customer not sent and give me blank page.

my codes to send email:

$dbcccwpp =& JFactory::getDBO();
$dbcccowpp = "select * from `#__virtuemart_orders` where `order_number` = '$ons' AND `order_status` ='C'";
$dbcccwpp->setQuery($dbcccowpp);
$dbcccwpp->query();
$dbcccowpp = $dbcccwpp->loadobject();
$opass= $dbcccowpp->order_pass;
$vmid= $dbcccowpp->virtuemart_user_id;
$dbcccw =& JFactory::getDBO();
$dbcccow = "select * from `#__users` where `id` = '$vmid'";
$dbcccw->setQuery($dbcccow);
$dbcccw->query();
$dbcccow = $dbcccw->loadobject();
$mm=$dbcccow->email;
$app =& JFactory::getApplication();
$sitename = $app->getCfg('sitename');
$subject ="".$sitename." - Purchase Invoice";
    $add = JURI::base()."index.php?option=com_virtuemart&view=orders&layout=details&order_number=" . $ons . "&order_pass=" . $opass ;
$body = "Thanks for your order.". '<br />'  . '<b>Your order id'. ':</b>' . ' ' . $SaleReferenceId . '<br />' . '<b>Order Code'. ':</b>' . ' ' . $ons.'<br/>'. '<a href="'. $add.'">Show Order </a>';
$to = array( $mm , $mmm );
$config =& JFactory::getConfig();
$from = array(
$config->getValue( 'config.mailfrom' ),
$config->getValue( 'config.fromname' ) );
# Invoke JMail Class
$mailer = JFactory::getMailer();

# Set sender array so that my name will show up neatly in your inbox
$mailer->setSender($from);

# Add a recipient -- this can be a single address (string) or an array of addresses
$mailer->addRecipient($to);

$mailer->setSubject($subject);
$mailer->setBody($body);
$mailer->isHTML();
$mailer->send();


Please help me. Thank you.

PRO

have you looked in the other payment plugins for example?

it looks like you are doing way to much coding for things that are already standard

look in the other plugins at the triggers.


mahdi.manian

#2
Yes. I lock other plugins and programming this plugin. But i don't know that how to send email to vendor and user after payment completion! My codes to send email don't work! Please see my codes above.

Please help me.