Requirements
Background information
The ability to import stockable variants make it easier than using the interface in VirtueMart
Before you can start to import your stockable variants, you first need to create a custom field with a plugin of the Stockable Variant type. Take these steps to create the custom field:
An example CSV file for existing products looks like this:
"product_sku";"product_parent_sku";"custom_title";"custom_value";"custom_param";"product_name";"product_in_stock";"product_price"
"10001";"";"Size and Color";"stockable";"10001brbl[Red#L[;10001brge[Black#M[;10001bror[Green#S[";"Parent product";"0";"100"
"10001brbl";"10001";"";"";"";"Child Red Large";"25";""
"10001brge";"10001";"";"";"";"Child Black Medium";"30";""
"10001bror";"10001";"";"";"";"Child Green Small";"20";""
Let's have a closer look at the fields
product_sku
This is the unique code for a product.
product_parent_sku
This is the SKU of the parent product.
custom_title
The name of the custom field. The correct name can be found on the Custom Fields page in VirtueMart in the column named Title. This is the name used in step 3.1 when creating the custom field.
custom_value
This must always be stockable.
custom_param
The custom_param fields holds all the settings about the child products. The value is build up of 3 values and separated by the square open bracket [:
A value like 10001brbl[Red#L[ as seen in the example CSV means:
product_name
The name of the product.
product_in_stock
The number of products that there are in stock.
product_price
The price of the product. This field is required for the parent product otherwise the selections will not show up.