Linking VirtueMart checkout with ADempiere
In this recipe, we will understand what it takes to enable the flow of information from VirtueMart to ADempiere when a user checks out one or more products on the VirtueMart web store.
How to do it...
1. In the
ps_checkout.php
file, theadd()
function creates all the records related to the order after the order confirmation. Modify theadd()
function to include the following steps after all the records have been created in different tables:Create a
$fields
array with all the relevant fields related to order, order history, order payment, and order items. Make sure thattype
is explicitly set on the array to, say,PURCHASEORDER
Create XML data from the
$fields
array by using thegetXmlRepresentation()
function of theMQClient.php
fileSend the XML data on the queue by calling the
sendMessage()
function of theMQClient.php
file
2. Create the
VMImport.java
file and code the following steps:Receive a message from the queue and get the XML message body...