Magento Commerce is the leading provider of open omnichannel innovation. Its an open source, cloud-based digital commerce platform and omnichannel solutions empowers merchants to integrate digital and physical shopping experiences. Built for rapid innovation, the platform combines rich, out-of-the-box functionality with powerful business tools. This customizable platform seamlessly integrates with third-party solutions, can be deployed in any environment, and is backed by a vast network of commerce experts ready to help you.
3rd party systems can invoke Magento actions using XML/SOAP protocol. This advanced features allows Magento inventory & orders to be managed remotely. Hence, allowing Magento to be a part of large ERP / CRM systems.
The client needed to automatically add products & attributes to the Magento store remotely from their existing inventory system. The products can be either simple or configurable and the attributes, values and attribute sets needed to be created in the correct order to allow this.
Develop a system that will parse data from the client’s existing inventory system, format it and make the necessary Magento SOAP calls to add it to the Magento shop. Duplicates in attributes, values & products must be avoided.
Instead of manipulating the database directly, Schogini decided to go with the SOAP method so that the system is safe from Magento upgrades. Updates made to the database during Magento upgrade will not affect this system since, it will use the Magento classes to import the data. As long as the API parameters remain the same, the system will work.
The first step was to setup a Magento SOAP user account with permissions to manage every area of the Catalog, including inventory. Next, a PHP CLI script was developed which reads the CSV/Excel file from a folder, parses its content and segregates the attributes, attribute values, attribute sets, simple products, configurable products & associated products. The CSV/Excel file is exported from the inventory system into the folder. To prevent API timeout, a bash script is used to invoke the PHP script which will import the data in chunks. Data is imported in this order:
The most important benefit for the client was that the data could be imported directly from the inventory system. Their team was free from formatting the data for Magento - the system took care of this automatically. Of course, other than data formatting, the team was also free from the actual data import which the developed system took care of, ensuring no duplicates.