Categories Import

The task reads a category tree from a file and creates it in TRADElube. You need it when the tree arrives as a file of its own, a product group list from the ERP system for instance. Where the category path sits in the product file instead, the categories are created by Products Import already, and this task is not needed.

What gets transferred

One category per row read: its own fields, plus a name and a description per language version.

Where a category hangs in the tree is decided by the Parent Category assignment. It is ticked from the start, and where the row supplies nothing for it, TRADElube hangs the category under the channel's Root Category. If that is empty too, it sits on the top level.

What does not belong to the category itself does not go along: no image, because the plan has no section for media, and no products. Which product sits in which category is decided by the product import.

How the transfer plan is built

Three sections, and the first one carries the work.

Section What sits in it
Layout The record sets: which level of the file is read, what a category is recognized by, and which rows are passed over
Common The fields of the category itself, Parent Category and Active among them
Descriptions One record set per language version, with name and description

The most important row in the Layout section is the Mapping assignment: its value is what the next execution finds the same category by, instead of creating it a second time. Take an identifier the supplier does not change for it, not the name of the category.

The tree is then built in one of two ways. Where the file carries the identifier of its parent category per row, a field assignment on that column is enough in Parent Category, because the search runs on the same value as the mapping. Where it carries a path like "Paints/Interior paints" instead, the row needs a script.

Both ways assume the parent category is already there at that moment. Where it sits further down in the file, that one row fails with a message while the execution carries on. A second execution picks it up. To avoid that, sort the file from the root downwards.

Special features and limits

A category missing from the file stays in TRADElube. The import writes, it does not tidy up, and unlike Products Import this task has no setting that switches unused entries off or deletes them.

In the other direction this task does not exist: categories come in through this channel, but not out.

Further reading