VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: molasar on January 14, 2016, 12:14:00 PM

Title: Export order data to CSV fie
Post by: molasar on January 14, 2016, 12:14:00 PM
Hello,

Joomla3+VM3.

I need to export the order data to CSV file after click on "Submit order" button on Shopping cart page.
In what file and what place I need to add my PHP code?

Please help me.


Thank you,
Anton.
Title: Re: Export order data to CSV fie
Post by: GJC Web Design on January 14, 2016, 12:31:51 PM
you need to build a vm plugin that triggers on  plgVmOnUpdateOrderPayment

Have done quite a few so contact if interested
Title: Re: Export order data to CSV fie
Post by: molasar on January 14, 2016, 14:30:25 PM
I already have a PHP code to make export order data.
But I can't find the function that handles the click on a button.

Which VM file contain this function?
Title: Re: Export order data to CSV fie
Post by: GJC Web Design on January 14, 2016, 16:17:13 PM
I told you.. a plugin that triggers on plgVmOnUpdateOrderPayment

that's how VM works
Title: Re: Export order data to CSV fie
Post by: molasar on January 14, 2016, 21:48:55 PM
I found function confirmedOrder() in the com_vm/helpers/cart.php file.
There is $orderDetails in this function. I think it contains order data.

How can I get order details from $orderDetails like name, address, products name, quantity, total amount...
Title: Re: Export order data to CSV fie
Post by: GJC Web Design on January 14, 2016, 23:04:47 PM
FFS .. as u seem determined to ignore my advice this is the last try

function plgVmOnUpdateOrderPayment ($data,$old_order_status) {

}

$data contains everything u need

e.g

$data->virtuemart_order_id

then do a query for anything not in it
Title: Re: Export order data to CSV fie
Post by: molasar on January 15, 2016, 14:19:49 PM
In what VM fie I can find plgVmOnUpdateOrderPayment function?
Or I need create it?
Title: Re: Export order data to CSV fie
Post by: GJC Web Design on January 15, 2016, 14:36:04 PM
read the basic info on plugin development - afraid not up to date  http://docs.virtuemart.net/tutorials/development/84-extension-plugins.html
study other vm custom plugins