For a client we have to create xml files of orders when the order status changes to 'C' confirmed.
Is it posible to create a plugin (without doing a core hack of the virtuemart 2 code) which acts on order status change and if so how can I do this ?
I tried to use code like this to create custom plugin but without success. Can someone HELP me !
defined('_JEXEC') or die( 'Direct Access to ' . basename( __FILE__ ) . ' is not allowed.' ) ;
if (!class_exists('vmCustomPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php');
class plgVmCustomXmlsap extends vmCustomPlugin {
function __construct(& $subject, $config) {
parent::__construct($subject, $config);
}
public function plgVmDisplayInOrderFE($item, $param,$productCustom, $row){
print_r($item);
if ($item->order_status=='C'){
vmdebug('OKOKOKOKOKOKOKOKOKOKOKOKO');
echo "Confirmed";
die;
}
}
}
try
function plgVmOnUpdateOrderPayment ($data,$old_order_status) {
if($data->order_status=='C'){
//do something
}
}
http://www.easyjoomla.org/virtuemart-extensions/orderexport