Book Image

ADempiere 3.6 Cookbook

Book Image

ADempiere 3.6 Cookbook

Overview of this book

Table of Contents (16 chapters)
ADempiere 3.6 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

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. 1. In the ps_checkout.php file, the add() function creates all the records related to the order after the order confirmation. Modify the add() 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 that type is explicitly set on the array to, say, PURCHASEORDER

    • Create XML data from the $fields array by using the getXmlRepresentation() function of the MQClient.php file

    • Send the XML data on the queue by calling the sendMessage() function of the MQClient.php file

  2. 2. Create the VMImport.java file and code the following steps:

    • Receive a message from the queue and get the XML message body...