This document explains on how to import variants of HikaShop Product using Characteristics.
In this example the product has 2 characteristics:
Characteristics can be added from HikaShop -> Products tab -> Characteristics page. Few things to remember with Characteristics
- Update available fields once characteristics are added. This way RO CSVI recognises the newly added characteristics
- Each characteristic must have an alias set. RO CSVI uses alias of Characteristics as template field in import file. The alias is the unique identifier for a characteristic and is shown in the image in lowercase letters.
- Add the characteristic values before linking them to products.
Creating the template
A template can be created by following these steps:
- Go to Components -> RO CSVI -> Templates
- Click New
- Give the template a name
- Set Action to Import
- Set Component to HikaShop
- Set Operation to Product
- Click Next: Select Source
- Source is set default to Load from your computer. No need for change.
- Click Next: Select options
- The default values are OK, change if needed.
- Click Next: Select fields
- Nothing needed here as we set to Use column headers as configuration in step 10.
- Click Next: Finalize
- All done here
- Click Close to return to the list of templates or Edit if you want to fine-tune the template further.
Adding the template fields
Template fields can be added by following these steps:
- Go to Components -> RO CSVI -> Templates
- Click on Template fields
- In the Search Tools select your template
- Click on New to add a single field or click on Quick Add to add multiple fields.
The Quick Add Option allows you to quickly add multiple fields to a template. It is not possible to set any settings per field here but that can be done after the fields have been added to the template.
Creating the import file
The import file is a combination of product information and characteristics. In this example we have the color and size characteristics. First is the parent product, this is required for new products. The parent product must always precede the child products, such is nature.
product_code,product_type,category_path,product_parent_code Blue_stiletto,main,product category/Shoes/Women, Blue_stiletto_6,variant,,Blue_stiletto White_stiletto_7,variant,,Blue_stiletto Green_stiletto_8,variant,,Blue_stiletto
Here we have the start of our file with a parent and a child product. Here are some observations:
- The product_type for the parent is always main as this indicates it is a parent product
- The product_parent_code for the parent is always empty
- The product_type for the child is always variant as this indicates it is a child product
- The product_parent_code for the child is always the value of the parent product_code field
- The category_path for the child is always empty because it takes the category from the parent
Now that we have a parent and a child product we still need to indicate how the child is different from the parent, in other words what characteristics does the child have. We saw earlier the parent has 2 characteristics that can be set color and size. These fields must be added to the import file so RO CSVI knows it needs to process them.
product_code,product_type,category_path,product_parent_code,color,size Blue_stiletto,main,product category/Shoes/Women,,, Blue_stiletto_6,variant,,Blue_stiletto,Blue,6 White_stiletto_7,variant,,Blue_stiletto,White,7 Green_stiletto_8,variant,,Blue_stiletto,Green,8
The values used for color and size must already exist, otherwise the child product will be added without any characteristics.
To set a child product as default variant, use default_variant field with value set to Yes/Y/1 in import file. No is the default value and it is not necessary to set N/No/0 value to the child rows which are not default variants. In the example content below color characteristic value Blue with size characteristic 6 is set as default variant
product_code,product_type,category_path,product_parent_code,color,size,default_variant Blue_stiletto,main,product category/Shoes/Women,,,, Blue_stiletto_6,variant,,Blue_stiletto,Blue,6,Y White_stiletto_7,variant,,Blue_stiletto,White,7, Green_stiletto_8,variant,,Blue_stiletto,Green,8,
The file is now ready for import as we have a parent and a child with characteristics.
Run the import
The import can be run by following these steps:
- Go to Components -> RO CSVI -> Import
- Select the template created earlier
- Click Select file
- Select the file to import
- Click Preview
- You now see a preview of the file as to how RO CSVI sees the file
- Click Start import
- The import is run
- The Log details page will be shown with information regarding the import if the Enable logging is enabled in the template
Video showing the process
After import with default_variant field, you can check the child variant product set to default from HikaShop -> Products page -> Click Product name/code-> variants tab