Skip to main content

Variation matrix

Sometimes, products have so many variations, that a matrix might be necessary. A classical example is fitments for jeans, where individual width and length sizes might result in dozens of variations. For cases like these, we are able to split variations across virtual X and Y axes, which we can render as a matrix in POS and Checkout App.

Defining sizes

To define these sizes, we use a normal product hierarchy as described in Pushing products. For the VariationValue we now fill both our X and Y values, divided using a forward slash (/).

Example for a pair of trousers with a width of 30 and a length of 34:

{
"Variations": {
"Property": "Size",
"LogicalLevel": "SKU",
"Products": [
{
"ID": "121-978020137957",
"Name": "New Black Trousers Black",
"VariationValues": [
{
"Value": "30/34"
}
]
}
]
}
}

Additionally, we need to specify our dimensions separately in the product content object as CustomContent like so:

{
"Variations": {
"Property": "Size",
"LogicalLevel": "SKU",
"Products": [
{
"ID": "121-978020137957",
"Name": "New Black Trousers Black",
"VariationValues": [
{
"Value": "30/34"
}
],
"Content": [
{
"CustomContent": {
"x_dimension_value": "30",
"y_dimension_value": "34"
}
}
]
}
]
}
}

Renaming properties

To give your X and Y properties a display name for the front end, see Custom Properties.