E
E
Ellik2015-11-13 16:49:32
PHP
Ellik, 2015-11-13 16:49:32

What should be the XML structure for transferring product categories from 1C to an online store?

Thinking about the following structure:

<entity type="product" sku='asdf2' category='Флешки' parent='Электроника'>
    <attributes>
      <group name="Основные характеристики">
        <attribute name="Наименование" value="Acer Aspire Switch 64 Гб WiFi" />
        <attribute name="Производитель" value="Acer " />
        <attribute name="Серия" value="Aspire Switch  " />
        <attribute name="Модель" value="10 E " />
        <attribute name="Код товара" value="NT.MX3ER.004 " />
        <attribute name="Тип оборудования" value="Планшет c клавиатурой " />
        <attribute name="Описание" value="С подключенной клавиатурой, планшет превращается в полноценный ноутбук-трансформер, который можно закрывать и открывать  " />
        <attribute name="Операционная система" value="	Windows 10 Домашняя (32 bit) " />
        <attribute name="Размеры (ширина x высота x глубина)" value="	26.2 x 1.8 x 23.5 см  " />
        <attribute name="Вес планшета с аккумулятором" value="1.15 кг (c клавиатурой)  " />
        <attribute name="Вес" value="13 грамм " />
      </group>
      <group name="Параметры производительности">
        <attribute name = "Скорость чтения" value="до 600 Мб/сек" />
        <attribute name = "Скорость записи" value="до 350 Мб/сек" />
      </group>
    </attributes>
  </entity>

It will not be difficult to determine the parent property of the category of its parent and build a tree, but what about the root categories, to which the product does not directly relate in any way?
Office equipment, stationery → Paper and paper products → Paper for office equipment
From this example, I can determine the parent Paper and paper products , but Office equipment, stationery, i.e. the parent-parent is not fixed in any way.
PS I apologize for the meager ability to describe the problem, but how it happened.
Many thanks in advance for your advice.
PPS It is possible to first load product categories from 1C, but this goes against the tasks set.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pan Propan, 2015-11-13
@mgis

1) You need to unload the category tree separately.
2) Determine the parent category for each item, and then build membership by 1)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question