Integration with Magento¶
OroCRM supports out of the box integration with Magento. The integration enables loading data from and to a Magento-based eCommerce store (“Magento store”) and processing it in the OroCRM. This article describes how to define and edit the integration and synchronization settings.
While Magento integration capabilities are pre-implemented, OroCRM can be integrated with different third-party systems.
On the Magento Side¶
The integration is made possible with the OroCRM Bridge Magento Extenstion. The OroCRM Bridge can be installed through the MagentoConnect.
Once the extension has been successfully installed, you need to login to your Magento account and to set up a SOAP API user within Magento, as described below:
The integration can also be created without installation of the OroCRM Bridge Magento Extenstion, however the synchronization will then take longer, and some options, such as two-way synchronization, and synchronization of the custom records data will not be available.
Define a New Role¶
Once logged in, go to the System>Web Services>SOAP/XML – RPC – Roles
You will get to the Roles grid. Click the Add New Role
Define the Role Name that corresponds to your eCommerce store.
Click the Save Role button. The role will be saved and you will get to page of the role.
You can also click the role name in the grid at any time to get to the page of the role.
Click the Role Resources on the left.
In the Roles Resources section, set the Resource Access field value to All and save the role.
Define a New User¶
Go to the System>Web Services>SOAP/XML – RPC – Users
You will get to the Users grid. Click the Add New User button.
Define the following fields:
Field Description User Name* The name used for login into the account. First Name* The first part of the name displayed in the system to refer to the user. Last Name* The last part of the name displayed in the system to refer to the user. Email* The email address of the user. API Key* Define a password for the account. The key shall be at least 6 symbols long. API Key Confirmation* Confirm the password. The account is Set the value to Active in order to use the user account created.
Save the user created.
- The user account will be saved and you will get to page of the user.
You can also click the user name in the grid at any time to get to the page of the Role.
Click the User Role on the left
Select the role that you’ve created for your store above.
- Click the Save User button in the top right corner.
Enable WSDL Cache¶
In order to accelerate performance of initial sync, please make sure WSDL cache is enabled in Magento configuration.
To enable the cache:
Go to the System>Configuration
Go to the Services section in the tab on the left.
Click on the Magento Core API link
Choose Yes in the Enable WSDL Cache field of the General Settings.
The CSV support is not supported for the initial import of Magento data to OroCRM, but if you have concern as for the impact the import might have on the production environment, you can set-up a staging instance with the latest production data, run initial synchronization on the environment and update the integration url to production once it has been done.
On the Oro Side¶
Create Magento Integration¶
To create integration with Magento, create a channel of Magento type as described in the Channels Management guide.
As soon as the channel type is set to Magento, a mandatory Integration* field will appear in the General section.
Click the Configure integration link. The form will emerge.
Define the following details in the General section:
|Name*||The configuration name used to refer to the configuration within the system.|
|SOAP WSDL URL*||A URL of the SOAP v.2 WSDL source (this is the URL of your Magento installation plus api/v2_soap/?wsdl=1). For example, if your installation were available at http://example.com/magento/index.php/, the SOAP WSDL URL would be http://example.com/magento/index.php/api/v2_soap/?wsdl=1.|
|SOAP API Key*||The API Key defined for the Magento user above.|
|SOAP API User*||The username defined for the Magento user above.|
|WS-I Compliance||Defines whether WS-I compliance mode is enabled for the Magento store.|
|Sync start date||Data will be synchronized as of the date defined.|
At this point, click Check Connection, to see if the settings defined above are correct. Once the connection details have been verified, the following fields will be filled with default settings.
The list of all the Websites available for the shop. All Websites option is chosen by default.
You can edit the field value and choose one of the Websites available. Only entries of the selected Website are synchronized.
Click Sync website list if the list of Websites is outdated.
|Admin url||Optional field. A url to the administrator panel of the specified Magento store.|
|Default owner*||Specifies what users can manage the configuration, subject to the access and permission settings. By default is filled with the user creating the integration.|
Use the Synchronization Settings section to enable/disable two-way synchronization.
Check the Enable Two Way Sync box, if you want to download data both from Magento to OroCRM and back. If the box is unchecked, data from Magento will be loaded to OroCRM, but changes performed in OroCRM will not be loaded to Magento.
If two-way synchronization is enabled, define the priority used for conflict resolution (e.g. if the same customer details were edited from both OroCRM and Magento):
- Remote wins: Magento data will be applied to the both Magento and OroCRM.
- Local wins: OroCRM data will be applied to the both Magento and OroCRM.
Edit the Integration¶
To edit the integration details:
Go to the Edit form of the channel and click Edit link by the integration name.
The integration form will appear. Priory defined settings will be shown in the form. Once synchronization has been performed, it is impossible to change the Sync start date.
Click Done button to save the changes
To remove an integration from the system, go to the Edit form of the channel and click located next to the integration name
Start Synchronization Manually¶
Once integration has been created, the data will be automatically synchronized. However, you can also start the synchronization manually from OroCRM:
Go to System>Integrations>Manage Integrations and click the grid action icon or
Go to the View page of the channel and click the integration name link:
The view page of the integration will appear.
Click Schedule Sync. A sync job has been added to the queue. Check progress. note will appear.
The data is being synchronized. You can click Check progress link to see the synchronization status.
After the successful synchronization, details of the Magento entity records defined for the channel will be loaded to OroCRM and can be processed therein, for example cart can be converted, customer details can be edited and new customers can be added to the system.
When you create a channel of Magento type, perform initial sync of the created Magento integration and later delete the channel, Magento Сustomers will be deleted but Accounts and Contacts will remain in the system. If you re-create the channel of Magento type, perform initial sync of the created Magento integration once more, Accounts and Contacts will be populated into the system again, doubling their quantity by duplicates. Please, be aware that this behavior is standard.