📜 ⬆️ ⬇️

YML (Yandex Market Language) - Generation of a product file for Yandex Webmaster

Recently, I noticed that a new section has appeared in Yandex Webmaster, it is called “Goods and Prices”. There, I saw how you can improve for free in issuing Yandex, the store's product pages.

yandex

Since I am developing an online store now, this possibility seemed very tempting.

It is worth noting that not all stores can connect. Of the most important criteria, as for me, is that the store must have a legal entity for which the store is registered. More details about the connection can be found in the documentation for Yandex Webmaster in the Connecting Store section.
')
After spending a bit of time looking for ready-made solutions to generate a yml file with goods, I came across a couple of ready-made classes that help in the generation. All of them were without tests and did not implement all the necessary functionality. After looking at all this, it was decided to write my own library with blackjack and tests.

I wanted to protect the user as much as possible from generating an incorrect YML file. Therefore, all xml nodes are represented as PHP objects. Ideally, it would still be possible to validate the object before writing it into the yml file, but the hands have not reached it yet. Bonus is that the file format for Yandex Market and Yandex Webmaster is the same in connection with which the library can be used for two services.

In the process of writing the library, I had to deal with the validation of xml using dtd, and also read quite a lot of documentation from Yandex. Here are the sections of the documentation that I used at the time of writing:


Documentation on the use of the library and the library itself can be found on GitHub YmlGenerator .

ZY Question to the community, who used the opportunity to upload goods to Yandex Webmaster, did you notice an improvement in conversion or traffic growth? (I do not have such information yet).

Source: https://habr.com/ru/post/313256/


All Articles