News:

Support the VirtueMart project and become a member

Main Menu

Creating xml on order status change to C (=confirmed)

Started by loft33, June 10, 2014, 10:50:38 AM

Previous topic - Next topic

loft33

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;
        }

    }

}

GJC Web Design

try

function plgVmOnUpdateOrderPayment ($data,$old_order_status) {

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

//do something

}
}

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation