VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: loft33 on June 10, 2014, 10:50:38 AM

Title: Creating xml on order status change to C (=confirmed)
Post by: loft33 on June 10, 2014, 10:50:38 AM
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;
        }

    }

}
Title: Re: Creating xml on order status change to C (=confirmed)
Post by: GJC Web Design on June 10, 2014, 10:54:59 AM
try

function plgVmOnUpdateOrderPayment ($data,$old_order_status) {

if($data->order_status=='C'){

//do something

}
}

Title: Re: Creating xml on order status change to C (=confirmed)
Post by: lindapowers on June 10, 2014, 12:17:11 PM
http://www.easyjoomla.org/virtuemart-extensions/orderexport