How to prepare the same products for different channels without repeating mundane tasks? How to manage your product information in one place? Case study of connecting Magento and Akeneo by Kaliop.
Recently at Kaliop we were tasked with a new Akeneo project, which was an interesting one. Our client, a major South American electrical accessories seller, was looking to expand business from a single Magento 1 store. However a difficult problem was encountered – how to prepare the same products for different channels without repeating mundane tasks? When client reflected upon the issue, he came to a conclusion that he wants PIM (Product Information Management) system. As we are Akeneo specialists, this was our proposal.
But what is Akeneo? And what is PIM?
Basically it is your central point of your managing system that stores product data (like descriptions, media, etc) – which can be both automatically imported from other systems or manually input – and from this place you can manage different channels distribution (such as shop, catalogs, mailing lists, website etc.). So you only have to do work once (for product data) and then decide which product data should go where. This simple solution speeds up creation process, management and publishing and puts everything in one place. So, our goal was set and final project scope were divided into three tasks:
– Upgrading Magento 1 installation to Magento 2,
– Connecting Magento with Akeneo,
– Clean up of attribute sets/attributes.
At first, we decided to upgrade Magento 1 to Magento 2 using Data Migration Tool, developed by Magento itself. It passed our initial tests that were conducted on small shops. However, in real life application this tool failed miserably – it had problems with moving attributes, giving no meaningful information at all. Quick search on the Internet left us in bad moods – we were not the only ones experiencing the issue, all suggested solutions did not work. That was the moment when we decided to roll out our own upgrade tool.
An initial idea was to use Magento 2 API to process all the data, and that did work almost perfectly. (Yeah!) Except the fact, that the response time was too slow to accept when we started uploading images alongside products – API did not allow us to simply state the filename of media file, it needed its contents as well (Not so Yeah!). To address this issue, we modified product export to directly operate on the database, saving a lot of execution time – it decreased from 10 seconds per product to 300 products per 10 second (Yeah! again).
Now Magento meets Akeneo
The second task was the real core of the project. We needed to connect the Magento 2 instance with Akeneo. In order to import the data to Akeneo, we have developed a set of console commands that prepares CSV files in expected format. To export the data from Akeneo, we use open source solution called Pimgento, that is suggested by Akeneo itself. However there were two issues left – inline media in WYSIWYG editor and galleries. Magento uses its own tag in order to store the media in editor, and we had to map it on the export time to standard HTML tag. As for the galleries, in current version Akeneo does not allow multiple images associated to one field, therefore we had to generate new attributes for that.
The last task was pretty straightforward – some of the attributes and attribute sets in the configuration were obsolete and we needed to clean them up. We implemented additional mechanisms to our export scripts, which allowed us to pass the mapping of them or even filter them out entirely.
The final ‘Yeah!’
To sum up, the whole project was an interesting experience. While taking a look at the time spent on the project, it is clear that the hardest task was the first one – upgrading Magento 1 to Magento 2. We had spent almost 70% of the total project time on this single thing, however we developed our own upgrade tool and increased our knowledge how Magento works internally. The most important thing – connection between Magento and Akeneo was relatively easy to achieve and took us only 20% of the total time, even though we had to develop our own export scripts. So… We have provided the client with a centralised system, which allows him to easily manage products for different channels, and he can do so performance-wise – by changing attributes only in Akeneo, the data is propagated to Magento. Another improvement comes from the performance of Akeneo itself, as on the same server, the response times are better than the ones of Magento admin panel, therefore allowing more users to work on more products at the same time. The final result: Yeah!
Arkadiusz Tokarczyk, Senior Developer, Kaliop Poland
Daniel Cisek, Senior Developer, Kaliop Poland