Import Parent Product and Child Variants

Hello! I am importing products into Dolibarr 7.0.1. I have Variants enabled and I entered some test products manually, adding the variants manually from the Variant tab. I see that the “parent product” shows with just the “reference code” (for example: GD8000) and the child variants show with the parent reference_variant_variant (for example: GD8000_WHITE_S) and they have a link to the parent on their product card.

Now I want to import a product list from a vendor so I don’t have to enter each one manually. How can I import a parent product (with just the reference code) and also the child variants (with the parent reference_variant_variant) so that they link together and the child variant shows as a child variant?

I did a test import with just adjusting the reference code to reflect either just parent (reference code only) or child variant (reference code_variant_variant) but they all imported as parent products with no links (the variants do not show under the parent product). I didn’t think it would work but I was hopeful. :happy:

Is there a way to do this? Or must I just import parent products and then manually add the variants? (some parent products have a lot of variants, so I would prefer not to have to do this)

Thanks for any suggestions!

I fear you have to develop a module for it. Mass import in Dolibarr today works only on one mySQL table at a time. No complex relations.

Hints given here: https://wiki.dolibarr.org/index.php/Developer_documentation

1 Like