Purpose
This article is to provide a better understanding of how a variant level attribute is used as a default selection criteria for a product with many variants.
Prerequisites
- Knowledge of the structure of data input files
- Understand how Variant is configured in FAS
Introduction
In FAS setup a product could have multiple variants, for example, different colours or sizes and prices. The customer provides Variant level data in custom_variant_attributes.csv. As an example
| product id | product variant id | cost_price |
|---|---|---|
| root_770284753 | root_v_770284753_size_14 | 46.24 |
| root_770284753 | root_v_770284753_size_12 | 46.24 |
| root_770284753 | root_v_770284753_size_10 | 0.00001 |
| root_770284753 | root_v_770284753_size_16 | 46.24 |
| root_770284753 | root_v_770284753_size_8 | 46.24 |
How FAS selects the default variant for a product?
In the FAS Merchandising studio, you can define the default variant of the selected attribute by going to System → System → System defaults. FAS will then select the variant level attribute with the smallest value within the set of variants values of the "Default selection attribute". The following is an example of this setting:
The default selection attribute is set to "Cost Price". This will select the variant based on the value of this attribute.
You can also define the "Default selection criteria" option, this will prevent from displaying products that don't match the selected criteria. For Example:
In this example, We have set the default selection criteria to "/is_saleable>1" which literally means exclude products that have an is_saleable value less than "1"
What will happen if all variants have the same values for the default selection attribute?
If all variants have the same value, FAS will select the variant based on the order of the input XML feed which is a random process.
Is there any way to enforce FAS to select a specific variant value?
In some situations, a product could have zero value for one variant and positive values for other variants. Based on the above mechanism FAS will always select the smallest value for this variant if it was defined as the default selection attribute. Or if "Default selection criteria" is defined with "/is_saleable>1" then those products which have "is_saleble=0" will be excluded from the result even if there are other variants available.
In some cases, this is not a good result, for example, think about a variant with zero stock. There is one option to override the default selection by using Fredhopper query API, You can include one parameter which will overwrite the default selection attribute and force FAS to select a specific value from the variant level attribute.
In the following example, we have added ":is_saleable~1" parameter which will prevent FAS from displaying any variant with the value is_saleble=0 and instead show the product with another variant which has is_saleable=1
?fh_location=//root/en_GB/categories<{root_sale}/categories<{root_sale_winterwarmerscoats}/colour>{colour_black}:is_saleable~1
|
Modification of Default variant selection criteria
Default selection changes can have adverse effects on your site, as such any adjustments to the variant selection setup should first be discussed with a member of the Crownpeak Technical consulting team and thoroughly tested before application to production environments.
Your feedback is important to us, please take a moment to let us know if you found this article helpful by clicking "Yes" or "No" in the "Was this article helpful?" section below or by adding a comment.
Comments
0 comments
Article is closed for comments.