2

Is it possible to export the same row multiple times based on an attribute of the item? Let's say for example that the CategoryModel has a List<ProductModel>.

How can I do an export using ImpEx to get something like this:

| category_code | product_code |
|------------------------------|
|     cat1      |     prod1    |
|------------------------------|
|     cat1      |     prod2    |
|------------------------------|
|     cat1      |     prod3    |
|------------------------------|

Is it possible to achieve that using translators? The best I could do with them is the following:

| category_code | product_code |
|------------------------------|
|     cat1      |    prod1     |
|               |    prod2     |
|               |    prod3     |
|------------------------------|

EDIT: The ImpEx header is this:

INSERT_UPDATE Category; code; @product_translated[translator = ...]
user1234SI.
  • 1,812
  • 1
  • 8
  • 22

1 Answers1

2

For lists, I'm not sure if there's an easy way to do that.

For relations, you can simply use the type. To get the the list of product-category mapping, you can do this:

UPDATE CategoryProductRelation;source(code,catalogversion(catalog(id),version));target(code,catalogversion(catalog(id),version))

source will be the category, while target will be the product.

geffchang
  • 3,279
  • 2
  • 32
  • 58