Import Tutorials

Required fields

Stockable Custom Fields plugin by Break Design Stockable Custom Fields extension by CSV Improved (available from the Extension Downloads)

Background information

The ability to import stockable variants make it easier than using the interface in VirtueMart

Creating the custom field

Before you can start to import your stockable variants, you first need to create a custom field needed for import. As per the example below we are going to import two custom fields Size and Color. So lets start adding these custom fields from VirtuMart custom fields page.

Add Size custom field by following the below steps

  1. Click on Custom Fields in the left menu in the Products section in VirtueMart
  2. Click on New
  3. Fill in the following fields:
    1. Custom Field Type: String
    2. Title: Size
    3. Published: Yes
    4. Layout position: Don't change
    5. Admin Only: No
    6. Is a list?: No
    7. Hidden: No
  4. Click on Save & Close
  5. The Size custom field has now been created

csvi scf size string custom field

Add Color custom field by following the below steps

  1. Click on Custom Fields in the left menu in the Products section in VirtueMart
  2. Click on New
  3. Fill in the following fields:
    1. Custom Field Type: String
    2. Title: Color
    3. Published: Yes
    4. Layout position: Don't change
    5. Admin Only: No
    6. Is a list?: No
    7. Hidden: No
  4. Click on Save & Close
  5. The Color custom field has now been created

csvi scf color string custom field

Now add another custom field of Stockable Variant type Size and Color and add the above added string custom fields to this custom field. Take these steps to create the custom field:

  1. Click on Custom Fields in the left menu in the Products section
  2. Click on New
  3. Fill in the following fields:
    1. Custom FIeld Type: Plug-ins
    2. Title: Size and Color (Remember this name as you will need it later in the CSV file)
    3. Published: Yes
    4. Parent: Don't change
    5. Cart Attribute: Yes
    6. Cart Input: Yes
    7. Description: Don't change
    8. Default: Make sure this field has value stockablecustomfields
    9. Tooltip: Don't change
    10. Layout position: Don't change
    11. Admin Only: No
    12. Is a list?: No
    13. Hidden: No
    14. Select a plug-in: Stockable Customfields
    15. Click Save
  4. Go to the bottom of the page and notice there a few more options. Here you add one or more existing custom fields.
    VirtueMart Stockable customfields
  5. Click on Save & Close
  6. The Custom field has now been created

Creating the CSV file

An example CSV file for existing products looks like this:

"product_sku","product_parent_sku","custom_title","custom_value","custom_multiple","product_name","product_price"
"10001","","Size and Color~Size and Color~Size and Color","stockablecustomfields~stockablecustomfields~stockablecustomfields","Y~Y~Y","Parent product","123"
"10001brbl","10001","Size~Color","M~Green",,"Child Medium Green",
"10001brge","10001","Size~Color","L~Red",,"Child Large Red",
"10001bror","10001","Size~Color","XL~Orange",,"Child Extra Large Orange",

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

Parent product

This must always be stockablecustomfields for the parent product, as many times as there are child products. Each value separated with the ~-symbol.

Child product

The child products contain the values of the actual field. Each value separated with the ~-symbol. In this case we added 2 fields, Size and Color to the stockable customfield, so each child product gets two values.

custom_multiple

This is only needed for the parent product and is always Y, as many times as there are child products. Each value separated with the ~-symbol.

product_name

The name of the product.

product_price

The price of the product. This field is required for the parent product otherwise the selections will not show up.

Custom fields for all with Stockable custom fields

The Size and Color custom fields shown above is of custom type String, CSVI also supports customfieldsforall custom fields type in Stockable custom fields.  The procedure is same as above, add a customfieldsforall field in VirtueMart custom fields page and add the field to Stockable custom fields custom field.

Add Format custom field of type Custom fields for all by following the below steps

  1. Click on Custom Fields in the left menu in the Products section in VirtueMart
  2. Click on New
  3. Fill in the following fields:
    1. Custom FIeld Type: Plug-ins
    2. Title: Format
    3. Published: Yes
    4. Parent: Don't change
    5. Description: Don't change
    6. Default: Don't change
    7. Tooltip: Don't change
    8. Layout position: Don't change
    9. Admin Only: No
    10. Is a list?: No
    11. Hidden: No
    12. Select a plug-in: Custom fields for all
    13. Click Save
  4. Click on Save & Close
  5. The Custom field for custom fields for all has now been created
  6. csvi scf cf4all custom field

  7. Add the custom fields for all custom field to Stockable custom field Size and Color.
    VirtueMart CF4ALL customfields

 Some important notes

  • Only a parent product can be used to import stockable information

It is also possible to import customfieldsforall with stockablecustomfields in one import file with proper use of custom fields. An example would be like below

"product_sku";"product_parent_sku";"custom_title";"custom_value";"custom_multiple";"custom_param";"product_name";"product_in_stock";"product_price"
"10001";"";"Type~Material~Size and Color~Size and Color~Size and Color";"customfieldsforall~customfieldsforall~stockablecustomfields~stockablecustomfields~stockablecustomfields";"~~Y~Y~Y";"Semi soft~Plastic";"Product with filter";"0";"100"
"10001brbl";"10001";"Type~Material~Size~Color";"customfieldsforall~customfieldsforall~M~Green";"";"Soft~Foam";"Child Medium Green";
"10001brge";"10001";"Type~Material~Size~Color";"customfieldsforall~customfieldsforall~L~Red";"";"Hard~Metal";"Child Medium Red";
"10001bror";"10001";"Size~Color";"XL~Orange";"";"";"Child Extra Large Orange";

 

More articles on this subject

Last Updated: Wednesday, 02 January 2019 09:32

My Member Software

My Member Software

My Member Software is open source club membership software with which Associations, Clubs, Foundations and even companies can administrate their members and is integrated in the Joomla CMS.

You can use RO CSVI to easily import your user data into My Member Software, create Joomla user accounts for your members and even perform batch updates on member data.