Import Tutorials

Required fields

You must have the Custom Fields for All plugin for VirtueMart installed and the Custom Fields for All plugin for CSV Improved.

Background information

The ability to import custom field filter values and filter them using the Custom Fields For All. Please note custom fields for all fields are not available as individual template fields. They are grouped under custom_title, custom_value and custom_param fields so they are differentiated with standard VirtueMart custom fields.

Creating the custom field

Before you can start to import your values, you first need to create a custom field with a plugin of the Custom Fields For All plugin type. 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: CF4ALL (Remember this name as you will need it later in the CSV file)
    3. Show Title: Yes
    4. Published: Yes
    5. Parent: Don't change
    6. Cart Attribute: No
    7. Description: Change as you like
    8. Default: Don't change (Make sure this field is customfieldsforall)
    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: Custom Fields for All plugin
  4. Click Save
  5. Go to the bottom of the page and notice there are some settings that can be set.
    Custom Fields For All plugin


    For this example fill the parameters with:
    1. Metal
    2. Plastic
    3. Wood
  6. Click on Save & Close
  7. The Custom field has now been created

Creating the CSV file

An example CSV file for existing products looks like this:

"product_sku";"custom_title";"custom_value";"custom_param";"product_name";"product_in_stock";"product_price"
"10001";"CF4ALL";"customfieldsforall";"Wood";"Product with filter";"0";"100"

Let's have a closer look at the fields

product_sku

This is the unique code for a 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.2 when creating the custom field.

custom_value

This must always be customfieldsforall.

custom_param

The custom_param fields holds all the values you want to assign to the product.

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.

Parameters with pricing

You can also add pricing to the custom fields if you have chosen for the price variant. The field custom_price must be added to the import file. The CSV file looks like this:

"product_sku";"custom_title";"custom_value";"custom_param";"custom_price";"product_name";"product_in_stock";"product_price"
"10001";"CF4ALL";"customfieldsforall";"Wood";"9.99";"Product with filter";"0";"100"

Multiple parameters

It is possible that you have multiple filter fields that you want to assign to a product, for example Color and Size. The CSV file looks like this:

"product_sku";"custom_title";"custom_value";"custom_param";"product_name";"product_in_stock";"product_price"
"10001";"Color~Size";"customfieldsforall~customfieldsforall";"Blue~M";"Product with filter";"0";"100"

If you have 2 custom titles, there must also be 2 custom values and 2 custom parameters.

Multiple parameters with multiple values

It is possible that you have multiple filter fields that you want to assign to a product with multiple selected values for example Color and Size. The CSV file looks like this:

"product_sku";"custom_title";"custom_value";"custom_param";"product_name";"product_in_stock";"product_price"
"10001";"Color~Size";"customfieldsforall~customfieldsforall";"Red#Blue~S#M";"Product with filter";"0";"100"

If you have 2 custom titles, there must also be 2 custom values and 2 custom parameters.

Multiple parameters with the same name

In case you want to assign the same custom field to one product but with different values you can do so by adding the custom_multiple field to your import file. The CSV file looks like this:

"product_sku";"custom_title";"custom_value";"custom_param";"custom_multiple";"product_name";"product_in_stock";"product_price"
"10001";"CF4ALL~CF4ALL";"customfieldsforall~customfieldsforall";"Metal~Plastic";"Y~Y";"Product with filter";"0";"100"

Multi language import

Starting from 7.5.0 version CSVI has support for importing custom fields for all for multiple languages. The example content explains how to import custom fields for all for Dutch and Russian languages. Same format can be followed for other languages. Follow the below steps to import multi language custom fields.

  1. Make sure that you have needed languages installed in Joomla language manager
  2. Set the multiple languages in VirtueMart Configuration page.
  3. Create custom fields for Custom fields for all for Size and Color as explained above
  4. Update available fields in CSVI
  5. Run the import by setting custom values as in the below example content.

"product_sku";"custom_title";"custom_value";"custom_param";"product_name";"product_in_stock";"product_price";"custom_param_de_de";"custom_param_ru_ru"
"10001";"Color~Size";"customfieldsforall~customfieldsforall";"Red#Blue~S#M";"Product with filter";"0";"100";"Rood#Blauw~S#M";"красный#синий~S#M"

You can now check the imported values on VirtueMart Custom fields page.

csvi7 cf4all color values

csvi7 cf4all size values

The custom fields values can also be seen from VirtueMart Products page for the default language in Joomla. For example if the default language set in Joomla Language manager is Russian then the values imported in field custom_param_ru_ru can be seen in VirtueMart Products page and on Custom fields tab. 

csvi7 cf4all product values

 

Export of Custom Fields For All

Custom fields for all fields for export are not available as individual template field. Instead you should add custom_title, custom_value and custom_param field in your export template to get custom fields for all field values.

Troubleshooting

When running the import of custom fields for all, if the values are not added to a product. Make sure that you have CSVI customfields for all plugin installed and enabled. 

CSVI shows a message if the plugin is not installed in the debug log area on import.

csvi customfieldsforall installed

More articles on this subject

Last Updated: Wednesday, 26 June 2019 11:09

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.