This section details the input formats for variants. It assumes you have earlier used the input formats for products and describes format requirements and content guidelines for variants. It is suitable for multi-country setups where the sum of products + variants is not bigger than 1.5 million.
Input format
This section describes the CSV file required for Fredhopper's variants solution. Please note that products have a 1-n relationship with variants:
- variants.csv: Holds the variant id, the product id and the locale, parent and name
- custom_variant_attributes.csv: Holds the custom attributes for every variant.
Please ensure that the file names mentioned above are exactly the names of the files you provide to Fredhopper.
|
Content guidelines Ensure for both CSV files:
|
Variants
All variants have to be provided in CSV file called variants.csv with the following fields:
| Field | Description | Allow values |
|---|---|---|
| variant_id | Unique identifier of the variant | Please only use identifiers matching [a-z0-9_]+. Refrain from using numeric only identifiers, unless you make sure that ids do not clash between items used in different universes, for example by adding a symbolic prefix to the numeric ids. The indexer will not enforce any format, by default, and hence will accept all item ids. |
| product_id | Unique identifier of the product to which this variant is related | We recommend using identifiers matching [a-z0-9_]+. Refrain from using numeric only identifiers, unless you make sure that ids do not clash between items used in different universes, for example by adding a symbolic prefix to the numeric ids. The indexer will not enforce any format, by default, and hence will accept all item ids. |
| locale | Language/country combination for which the variant applies | Locale in Java Locale formatting, [a-z]{2}_[A-Z]{2} e.g. en_US, fr_FR, de_DE, de_CH, xx_ZZ |
For example:
| variant_id | product_id | locale |
|---|---|---|
| v_54321 | p_123456 | nl_NL |
Custom attributes for variants need to be specified in a file called custom_variant_attributes.csv
An example if a Custom Attributes for Variants could look like:
| variant_id | locale | attribute_id | attribute_value_id | attribute_value |
|---|---|---|---|---|
| v_54321 | en_GB | customer | customer1 | Customer 1 |
| v_54321 | en_GB | colour | red | Red |
| We advise that all values of variant_id start with the characters v_ . This will help to distinguish variant ids from product ids. |
All attribute_id's need to be specified in the file custom_attributes_meta.csv. This means that all attributes for both variants as well as products are stored in the same file.
| If you want to include additional custom attributes please consult Input formats for custom attributes. |
Implementation of custom functionalities
Please find a list of functionalities below that can be implemented using the variants format:
- Search variant attributes: Use this to search variant attributes (e.g. the colour of a t-shirt variant)
- Including country prices: Use this to include different prices per country in the same locale
Comments
0 comments
Article is closed for comments.