Reputation: 193
I am using virtuemart in joomla for ecommerce purpose. It's working fine. But after checkout from cart it redirect to paypal ( or other payment system). After completion of payment process, paypal again redirects to my website. It's working all stuff smoothly. But problem is that how to know that payment process is complete successfully or not from my website? Is virtuemart automatic does this or not ? if yes then, which file is responsible for this ?
Upvotes: 4
Views: 817
Reputation: 2013
It's not automatic, but it's also not hard (aside from VM's terrible documentation), here's a skeleton of the plugin you want to write:
<?php
defined('_JEXEC') or die('Restricted access');
if (!class_exists('vmCustomPlugin')){
require(JPATH_VM_PLUGINS . '/vmcustomplugin.php');
}
class plgVmcustomAfterOrderConfirmedHook extends vmCustomPlugin {
function plgVmConfirmedOrder($cart, $order){
$db = JFactory::getDBO();
$db->setQuery($db->getQuery(true)
->select('order_status')
->from('#__virtuemart_orders')
->where('virtuemart_order_id = '.intval($order['details']['BT']->virtuemart_order_id)));
if($db->loadResult() === 'C'){
blah();
}
}
}
?>
Upvotes: 1