Good day to the community!
For the past few years I have been mainly developing and supporting online stores. During this time I have decided a lot of interesting and not so much problems.
One day, I visited the office of one of my former customers, and saw how the managers who are adding new product lines are suffering. Looking at all this, I had an idea to try to make this task as easy as possible. And that's what came out of it. At once I will make a reservation that in this article, I will simply describe the ideas and their results in practice. I will not post any sources, because This is the main requirement of the customer. All of the following has been implemented in php and postgresql.
1. First you need to add the product to the database. This usually happens like this. From the supplier comes an excel file with all available items and the manager begins to meticulously enter them into the database.
I decided to start from this stage. Why slaughter with your hands, what is already digitized? For a couple of hours, a script was written that fed this very file from the supplier, and at the exit we get a new product in the database. In a couple of hours I taught this script to understand templates, i. from which column what information to take. And after that, to process the file, in addition to the excel-plate also indicated the file with the template. Here, the most difficult thing was to teach the script to understand which category of goods to throw. To solve this problem, in the file with the template, we also add a label with the correspondence, supplier categories to the category from our database. And now almost any excel-file with goods is quickly added to the database. In the future, I think to add an intermediate page so that before adding to the database, ask the user what to add and what not, i.e. Sparsili price and display the form in which you can put a tick (or vice versa remove), what to put in the database, and what is not. You can also add the ability to edit the product name and category in this form. In general, this is nothing new or clever, but I have not seen ready-made solutions. Most parsers with such functionality are sharpened for a certain format of input data and cannot be easily configured. At this stage, everything. Let's go further!
')
2. In the next step, you need to find photos for newly arrived products. However sad it may be, most of the stores that do not have their own warehouses (or maybe just the majority) get pictures from the Internet. When I saw this decision was not long in coming. A small scriptbook was written, which in turn takes a new product from the database, selects its model and sends out a request to image search services. Next parsim html-page with the search result, we find there are pictures that search engines found and display all this. The user simply needs to select the appropriate picture and click the save button. In the dry residue, this solution saves about 3-5 minutes of the manager for each product. I understand that taking other people's photos is not very good and all that. But firstly, it would have happened without my help, and secondly, all those sites that do not want their materials to go to the side, simply add protection in the form of a watermark.
3. After we have a product and a picture has been found for this product, we just have to make a description for this product. I personally believe that the text description should be written by a person, and there can be no quick and even more useful solutions here. But besides the text description, there are also technical specifications and these specifications are one for everything, that is, if 10 stores sell the same product, then the technical specifications of this product should be the same for everyone, or at least not contradict each other to a friend.
Most often, these specifications are a set of parameters and their values. What did I see at the online store office for this issue? Every day, two managers sit and very carefully copy these characteristics from the manufacturers' websites and from any catalogs, such as Yandex Market. The situation is complicated by the fact that these kits are all stored differently and a blunt copy-paste is not enough here. For example, the dimensions of the oven can be stored in the form of such a parameter and its values: dimensions: 120x80x100, but you can paint, each size in its own parameter or parameters that are identical in meaning can be called differently. Therefore, even a very attentive and trained manager is not able to copy all the parameters to more than 30-40 products per day. Moreover, such wonderful buttons as copying a set of all parameter values ​​from one product to another or applying this parameter value to all products in this category, do not fundamentally solve this problem.
It really had to "reinvent the wheel." The very first thing that came to mind was to write a parser that will automatically pull the parameter sets and their values ​​from the source site and ask the manager to choose the correspondence of the parameter from the source site to the parameter from our database, but I decided not to stop there. Why, after the manager has chosen a match, not to memorize it the next time we stumble upon the same option to automatically suggest this match? Since most products are of the same type, and, for example, there can be 10 products differing from each other only by 3-4 parameters, after two or three products have been matched, the rest will only need to visually check these matches and immediately click the save button. The result was quite a nice technical parser. With this piece, one manager now processes 100-120 products per day, which is about 3-4 times more than the original figures.
Parameter parsingWhen developing this parser, I immediately separated the parser logic and interface logic, and now, to add a new source site, it suffices to describe where and what lies in the new source. Also, all sorts of nice “buns” were added, allegedly converting centimeters to millimeters (on the website for which I did all this, it is customary to store all dimensions in millimeters), etc.
After all the above tweaks, the total time to add a single product was reduced from 15-20 minutes to 3-5 minutes. I spent about 4 days on implementation and implementation. Given the fact that we are talking about the addition of 2000-3000 products, the benefit is obvious!