News:

Looking for documentation? Take a look on our wiki

Main Menu

How to get custom fields for an order ?

Started by le_gnou, August 18, 2012, 17:54:48 PM

Previous topic - Next topic

le_gnou

Hello,

I need to make a script sending to an API the content of an order when it become "paid".
For some products, i made custom fields and i need to put the choice made by customer in an "array" :

// Game server information
"game_id"     => $infoFromYourAPI["game_id"],
"max_players" => $infoFromYourAPI['Players'],
"pub_priv"    => $infoFromYourAPI["pubpriv"],
"login_path"  => $infoFromYourAPI["no"],
"sv_location" => $infoFromYourAPI["Location"],


How to do that, please ?

bytelord

Hello,

If you are familiar with PHP programming and joomla plugins developemt you could use vmpayment plugin and build or change your payment plugin when a payment and  plgVmOnPaymentResponseReceived is fired to post the above data to your game server and of course do some validation.
You can take a look over here: http://dev.virtuemart.net/projects/virtuemart/wiki/Payment_Plugins

Except that and easier you could make a piece of code when the checkout was successful inside your cart to post those data to your server.
I m sure that the API have instructions how should post your data.

Hope helps you out.
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

le_gnou

No, i'm not a PHP developper... I just add a code to the file [website_root]/administrator/components/com_virtuemart/models/orders.php.

I just want to permit to virtuemart sending data to my GameCP API...

I began a "howto" here :

http://forums.gamecp.com/viewtopic.php?f=66&t=6197

But i'm not able to get datas from custom fields i made :(

Milbo

Never change the models!

All triggers are there. Important is that you select "Cart attribute" to yes!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/