Opentaps Magento Integration

4
Opentaps Magento Integration From Opentaps Wiki Contents 1 Introduction 2 How It Works 3 Installation 3.1 Getting the Modules 3.2 Getting the Source Code from Subversion 3.3 Installing the Magento Extension 3.4 Installing the opentaps Modules 4 Configuring the opentaps Magento Integration 5 Opentaps/Magento Mappings explanation 6 Testing the Integration 7 HowTo Implement Paypal Payments Pro into Magento SANDBOX 8 Performance tuning 8.1 Opentaps 8.2 Magento Introduction This integration allows you to use the Magento ecommerce system (http://www.magentocommerce.com/) with opentaps Open Source ERP + CRM (http://www.opentaps.org) . The integration is designed to allow you to set up your products and catalogs in Magento, take orders using the Magento online store or using the Magento order entry module, and then import the products and orders to opentaps for purchasing, manufacturing fulfillment, and invoicing. Specific features supported are: One way push from Magento of newly added products and sales orders (Changes to products and orders are currently not handled.) All Magento orders added to one "Magento Customer" in opentaps Payments received in Magento are imported into opentaps under "Magento customer" an associated with the corresponding order Once orders are shipped in opentaps, the tracking number is sent back to Magento and associate it with the original order. Only one magento product store is supported at any time. This integration is compatible with the free Magento Community Edition (http://www.magentocommerce.com/product/communityedition) , tested with version 1.3.2.4 and 1.4.x. How It Works An opentaps integration module for Magento retrieves product, customer, and order information and serves it via REST (http://en.wikipedia.org/wiki/Representational_State_Transfer) to opentaps. There is an opentaps Data Access Layer (dal) which uses the Pentaho Data Integration (kettle) (http://kettle.pentaho.org/) to map the data from Magento and store them into the staging tables for opentaps Data Import module. From there, the opentaps Data Import module imports the data into opentaps. Installation The opentapsMagento integration requires one module for Magento and two components for opentaps: IntegratingWeb module for Magento Data Access Layer (DAL) and magentointegration components for opentaps The Magento module retrieves product and order data from Magento and serves them up via the REST protocol. The DAL component for opentaps receives the data from the Magento module and stores them in the opentaps database, and the magentointegration component uses the opentaps data import component to import the products and orders. Getting the Modules Download the OpentapsIntegration module and the MagentoIntegration module from Sourceforge opentaps Files (https://sourceforge.net/projects/opentaps/files/) under the "Modules" directory. The OpentapsIntegration zip file contains a module which will be installed on your Magento instance, and the MagentoIntegration zip file contains two modules for opentaps. Getting the Source Code from Subversion

description

Opentaps Magento Integration

Transcript of Opentaps Magento Integration

Page 1: Opentaps Magento Integration

Opentaps Magento IntegrationFrom Opentaps Wiki

Contents1 Introduction2 How It Works3 Installation

3.1 Getting the Modules3.2 Getting the Source Code from Subversion3.3 Installing the Magento Extension3.4 Installing the opentaps Modules

4 Configuring the opentaps Magento Integration5 Opentaps/Magento Mappings explanation6 Testing the Integration7 How­To Implement Paypal Payments Pro into Magento ­ SANDBOX8 Performance tuning

8.1 Opentaps8.2 Magento

Introduction

This integration allows you to use the Magento e­commerce system (http://www.magentocommerce.com/) with opentaps Open Source ERP + CRM(http://www.opentaps.org) . The integration is designed to allow you to set up your products and catalogs in Magento, take orders using the Magentoonline store or using the Magento order entry module, and then import the products and orders to opentaps for purchasing, manufacturing fulfillment,and invoicing.

Specific features supported are:

One way push from Magento of newly added products and sales orders (Changes to products and orders are currently not handled.)All Magento orders added to one "Magento Customer" in opentapsPayments received in Magento are imported into opentaps under "Magento customer" an associated with the corresponding orderOnce orders are shipped in opentaps, the tracking number is sent back to Magento and associate it with the original order.Only one magento product store is supported at any time.

This integration is compatible with the free Magento Community Edition (http://www.magentocommerce.com/product/community­edition) , testedwith version 1.3.2.4 and 1.4.x.

How It Works

An opentaps integration module for Magento retrieves product, customer, and order information and serves it via REST(http://en.wikipedia.org/wiki/Representational_State_Transfer) to opentaps. There is an opentaps Data Access Layer (dal) which uses the PentahoData Integration (kettle) (http://kettle.pentaho.org/) to map the data from Magento and store them into the staging tables for opentaps Data Importmodule. From there, the opentaps Data Import module imports the data into opentaps.

Installation

The opentaps­Magento integration requires one module for Magento and two components for opentaps:

IntegratingWeb module for MagentoData Access Layer (DAL) and magento­integration components for opentaps

The Magento module retrieves product and order data from Magento and serves them up via the REST protocol. The DAL component for opentapsreceives the data from the Magento module and stores them in the opentaps database, and the magento­integration component uses the opentaps dataimport component to import the products and orders.

Getting the Modules

Download the OpentapsIntegration module and the MagentoIntegration module from Sourceforge opentaps Files(https://sourceforge.net/projects/opentaps/files/) under the "Modules" directory. The OpentapsIntegration zip file contains a module which will beinstalled on your Magento instance, and the MagentoIntegration zip file contains two modules for opentaps.

Getting the Source Code from Subversion

Page 2: Opentaps Magento Integration

You can also install the source code version from subversion by checking out the IntegratingWeb module for Magento and the Data Access Layer(dal) and magento integration modules for opentaps.

You would need to checkout the OpentapsIntegration module for Magento in $magentoInstallationPath/app/code/local

$ svn co svn://svn.opentaps.org/opentaps_magento/magento_component/versions/1.0/trunk/OpentapsIntegration OpentapsIntegration

Then, checkout the Data Access Layer (DAL) and magento­integration modules for opentaps from the hot-deploy sub­directory of opentaps:

$ svn co svn://svn.opentaps.org/opentaps_magento/opentaps_component/versions/1.4/trunk/dal dal $ svn co svn://svn.opentaps.org/opentaps_magento/opentaps_component/versions/1.4/trunk/magento-integration magento-integration

Installing the Magento Extension

1. If you downloaded the modules, then first unzip the OpentapsIntegration zip file and move the OpentapsIntegration directory and all itssubdirectories to the /app/code/local/ directory of your Magento instance.

2. Make sure that your Magento directory structure must look like the following:

$magentoInstallationPath/app/code/local/OpentapsIntegration

Move $magentoInstallationPath/app/code/local/OpentapsIntegration/Restful/etc/OpentapsIntegration_Restful.xml in$magentoInstallationPath/app/etc/modules:

mv $magentoInstallationPath/app/code/local/OpentapsIntegration/Restful/etc/OpentapsIntegration_Restful.xml $magentoInstallationPath/app/etc/modules

3. Go on the Magento backend in System­>Configuration, then Advanced­>Advanced (at the bottom of the left­hand side tabs for the System­>Configuration screen.)

4. Click on "SAVE CONFIG" so that the Magento configuration files will be reloaded.

5. Now click on "Disable modules output", make sure you see a module named OpentapsIntegration_Restful. If that is your case, then you havesuccesfully installed the Magento module:

Installing the opentaps Modules

If you downloaded the MagentoIntegration modules for opentaps, then unzip the contents into the hot-deploy/ subdirectory of opentaps.

Your opentaps directory structure must look like the following:

$opentapsInstallationPath/hot-deploy/dal$opentapsInstallationPath/hot-deploy/magento-integration

Modify the file $opentapsInstallationPath/hot­deploy/component­load.xml uncomment the following two lines:

<load-component component-location="dal"/> <load-component component-location="magento-integration"/>

Go back to the opentaps directory and rebuild everything:

opentaps $ ./ant

Page 3: Opentaps Magento Integration

The opentaps modules are now installed. Now restart opentaps, and go to http://localhost:8080/magento­integration/control/main to ensure that themodules are loaded.

Finally, load the seed data for Magento integration by using Web Tools > XML Import and loading the files hot­deploy/magento/data/MagentoSeedData.xml

Configuring the opentaps Magento Integration

First you need a user which has access to magento data. You can create this user from the Magento backend:

1.  In the Magento backend, go to System­> Web Service ­> Users, and add a new user.2.  Then go to System­> Web Service ­> Roles and create a new Role with "Resource Access" set to "All".3.  Finally, associate the user with that role.

Next, $opentapsInstallationPath/hot­deploy/magento­integration/config/magento­integration.properties:

1.  Set the URL and administrative access user and password for opentaps2.  Set the base store URL and resource access user and password for magento. Test it by trying the URL plus /ws/orders/login For example, if

your base store URL is http://www.my-magento-store.com/index.php, then you should see a page at http://www.my-magento-store.com/index.php/ws/orders/login The password is also the same as your magento user's API key.

3.  Set paging size, which is the number of products retrieved in each batch from magento4.  Set the magento store ID, which is the field store_id of the table core_store of the Magento DB.

NOTE: when you modify any .properties file in Opentaps, you must reboot your instance because properties are loaded statically at boot applicationtime.

IMPORTANT NOTE: make sure that the system time in both Magento and opentaps are the same, so that the dates on the invoices and payments inopentaps are correct.

Opentaps/Magento Mappings explanation

The magento­integration Opentaps module has a directory named "mappings" that contains a CSV file for every Magento workflow/area currentlysupported by the integration. These CSV files are processed by the transformations, and used when storing data in Opentaps.

storeMappings.csv: handles the mapping between the Magento stores IDs and the Opentaps ProductStore/RootCategory entities.

MagentoStoreId,OpentapsRootCategoryId,OpentapsStoreId 1,MPSCATALOG1,mag1

The ProductCategory and ProductStore definitions can be found in magento­integration/data: by default XML files there are loaded as demo data.Informations about the Magento storeIDs can be found in the core_store table.

shippingMappings.csv: handles the mapping between the Magento shipping methods and the Opentaps shipping methods

magentoShippingMethodId,opentapsShippingMethodId fedex_FEDEXGROUND,9015 ups_GND,9001 fedex_FEDEX2DAY,9002

The Opentaps shipping method IDs are defined as seed data, and are common of every Opentaps installation. The Magento shipping methods can befound in the core_config_data table: by default Magento append the carrier code (ex.: UPS) to the shipping method (ex.: GND, states for Ground),thus resulting in a shippingMethodId of ups_GND.

paymentsMappings.csv: handles the mapping between Magento payment gateways and Opentaps payment methods.

MagentoPaymentMethodId,OpentapsPaymentMethodId authorizenet,CREDIT_CARD

The Opentaps payment method types and be found in the PaymentMethodType entity. The Magento payment methods can be found in thecore_config_data table.

taxIdMappings.csv: handles the mapping between Magento tax codes and Opentaps tax authorities.

magentoTaxCode,opentapsTaxAuthPartyId US-CA-*-Rate 1,CA_BOE US-NY-*-Rate 1,NY_DTF

The Opentaps tax authorities can be found in the TaxAuthority entity (taxAuthPartyId field). The Magento tax codes, that needs to be defined for taxcalculation, can be found in the tax_calculation_rate table.

Page 4: Opentaps Magento Integration

Testing the Integration

Magento orders need to be in the "Processing" state to be imported into opentaps. This means that they must have payment received first. You canuse the paypal developer sandbox (https://developer.paypal.com/) to set up a dummy paypal account for payment processing. Alternatively, you cancreate your order with Check/Money Order and invoice the order, and then it will be "Processing."

NOTE: The Payment Action of the Paypal method that will be used must be configured to SALE.

How­To Implement Paypal Payments Pro into Magento ­ SANDBOX

You can follow the [1] (http://www.magentocommerce.com/wiki/how­to_implement_paypal_payments_pro_into_magento_­_sandbox) to set up adeveloper account for payment processing.

Performance tuning

When importing a large number of products/orders (order of thousands, we made some tests with more than 10.000 products) performance issuesbecome important.

Opentaps

Default values of Opentaps 1.4 defined in startofbiz.sh work fine. Ensure that the Java Virtual Machine will be started with the following values

-Xms512M -Xmx1536M -XX:MaxPermSize=1024M

Note: in Unix systems the maximum number of open file descriptors is sometimes configured for a non­production system, that probably will nothave high loads. In Linux based systems, this value is most of the time configured to 1024: the value can be verified with the following command:

ulimit -n

To increase the default value, add a line such as the following in the file /etc/security/limits.conf

yourUser - nofile 10000

Finally, reboot your machine.

Magento

In $magentoInstallationPath/.htaccess memory used by PHP must be increased to a value of at least 512 Mb: this is a value you must tune based onthe number of concurrent users that will access you production web site.

php_value memory_limit 512M

Retrieved from "http://www.opentaps.org/docs/index.php/Opentaps_Magento_Integration"

This page was last modified 00:04, 8 July 2010.

© Open Source Strategies, Inc. Development of this documentation site is sponsored by Open Source Strategies, Inc.Help support opentaps with a subscription to this documentation site.