XML - YML Feed

The Internet price list format with arbitrary tags is a serial data stream, and therefore, is the most convenient way to transfer information through communication channels.

XML is widely used to generate price lists. Take note that this format without predefined tags is not the same as the Excel XML table format (XML Spreadsheet 2003 for Windows and XML Spreadsheet 2004 for Mac).

A price list in the format "XML Spreadsheet 2003" is a regular tabular price list. It opens in Excel as a table, the column numbers of which are visible on the top.

No separators are required when setting up a supplier form for processing price lists of this type.

xml/yml format with custom tags

Also has rows and columns delimited by tags on both sides. If you open the file with Notepad++ or Notepad, you can see the product as a price list line:

The image above shows that each product in the price list begins with the <offer tag (with a space at the end) and ends with the </offer> tag (underlined in red lines).

Columns are numbered in red in the example. These are the same column numbers that are used in setting up the supplier form.

The <offer tag is not the only tag that a price list product can start with. This format "with arbitrary tags" allows any tags to be used:

for example, tag <model, item, product, etc.

Repeated tags

The repeated tags in the file are an array of data represented in a table in one column. For example:

The <pictures> column contains three product image links. In a tabular price list, it would look like this:

The plugin uses its own separator |*|

And the <param column would span two columns of the tabular price list 9 and 10:

Categories

The xml-yml format with arbitrary tags allows placing a list of categories at the beginning of the file. If this list is built according to the following standard

then the plugin can work with it:

  • Create categories
  • Fill in the "Category and Margin" tab

XML Feed. Column Numbers

Since it is not always possible to open a price list in XML or YML format with arbitrary tags with Excel to see the column numbers, a special function has been added to the plugin:

In the separator field, enter the tag with which the product starts, save the supplier form, and process the price list.

In some cases, you have to fill in not only the product start tag but also the end tag:

The plugin will check up to 10,000 products and list the column numbers in the file admin/uploads/columns.tmp

The content of the columns.tmp file is something like this:

Attention

If you select only a few products from the price list into a separate file, then the column numbers may turn out to be other, since some columns may appear in the products later. For example, the <vendor> column only appears in the fourth product:

if you select the first 3 products in a separate price list, the plugin will not see the <vendor> column. What would never happen in the case of XML Spreadsheet 2003-2004 format price list:

Here column #3 always exists, even if it is empty.

User Schema.

The supplier can for some reason remove the <vendor> tag from the price list, then the columns will shift, the column numbers will change and the supplier form settings will be incorrect. Also, he can swap tags and add new ones.

In order not to set the supplier form every time it changes (especially since it is impossible to do this when processing the file via Cron), it is better to create your own column order and, thus, fix their numbers, as in a tabular price list.

To do this, you need to create a file in any text editor containing the column names in the order that suits you. The file should be named user_schemaN.csv (where N is the supplier form number):

and keep it in the admin/uploads folder:

The column names should be copied from the columns.tmp file:

For example, to update prices and quantities, it is enough for us to have a price list with only three columns: SKU, price, and quantity. Then the contents of the file user_schema14.csv will be as follows:

(разделитель - запятая, пробелы не допускаются).

In the supplier form settings, it will be enough to fill in:

  • column #1 - SKU
  • column #2 - price
  • column #3 - quantity

and set the action to "Update only".


XML Feed. Categories

Automatically add categories in Opencart

The plugin can create categories in the store automatically using the categories list located at the beginning of the price list:

The category list is required to be exactly like this as in the image (CRLF denotes a line break ).

It is enough to choose this action:

save the supplier form and process the price list.

Filling in the "Categories and margins" tab

In each product, the junior category is represented, usually in the <category_id> tag with its id:

This id appears in the categories list located at the beginning of the price list (see the image above). By matching this data, the plugin can automatically fill in the "Categories and Margin" tab, both the left side tab and the right side:

The result will look like this:

The image folders have to be created and filled in manually, however, this process can be automated if you enable this action:


XML Feed. SKU

XML price lists with arbitrary tags can contain product SKUs in a separate tag:

(see the image above - column number 7 <sku>).

In this case, column #7 can be used as a product SKU. But usually, the suppliers recommend their product id (column #1) as the more reliable.

And they are right. But if you have several suppliers, then theoretically, different product ids from different suppliers can by chance match.

Options

If in products, in addition to the id tag, there is also a group_id tag we can assume that the supplier price list contains products with options.

You can see that the group_id tag is repeated in different products, resembling a price list with options on different lines.

In such cases, group_id (column 3) should be selected as SKU.

Product series

The group_id tag can also be used to create product series.

Several products that have some common attribute (for example, the same group_id) can be combined into a series using modules "HYPER PRODUCT MODELS" or "KIT SERIES".

To group products in series, it is enough to fill in the column number containing the series attribute group_id in the "Series" field of the supplier form:

Optionally, you can specify both the column containing the sort order and the column with the product icon:

The icon image has to be uploaded to the image/catalog/ folder in advance, and in column 9 of the price list the image path should be in the following form:


XML Feed. Attributes and Options

It should be

Theoretically, options and attributes should be in different tags. For example:

Such a representation of options and attributes in the price list:

allows you to easily set their add or update.

Options:

Attributes:

In reality

Unfortunately, suppliers often combine attributes and options in the same tag:

1. In order for the plugin not to add the Color and Size options as attributes, or the Warranty, Composition, and Brand as options, you should create these options and attributes in the OpenCart admin panel in advance manually and set the plugin to not create them automatically:

This way in products, only those options and attributes that were created in the admin panel in advance will be updated.

2. Load each option and each attribute separately:


Usergio Copyright © 2022