RO CSVI

Multiple Customfields Filter for VirtueMart

Background information

The ability to import custom field filter values and filter them using the Multiple Customfields Filter for Virtuemart.

Creating the custom field

Before you can start to import your filter values, you first need to create a custom field with a plugin of the VirtueMart2 multiple customfield 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: 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: No
    6. Description: Change as you like
    7. Default: Don't change
    8. Tooltip: Don't change
    9. Layout position: Don't change
    10. Admin Only: No
    11. Is a list?: No
    12. Hidden: No
    13. Select a plug-in: VirtueMart2 multiple customfield plugin
  4. Click Save
  5. Go to the bottom of the page and notice there are some settings that can be set.
    Multiple Customfields filter plugin

    Set the Output template to multiselect-chosen.

    For this example fill the parameters with:
    1. Green
    2. Blue
    3. Yellow
    4. Pink
    5. Grey
  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";"Color";"param";"Blue#Pink#Grey";"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 param.

custom_param

The custom_param fields holds all the values you want to assign to the product, each one separated by a #.

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.

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";"param~param";"Blue#Pink#Grey~M#L#S";"Product with filter";"0";"100"

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