# Matrix

Last updated

Last updated

Overview

Matrix Option is quite interesting and a bit unusual one. It adds a possibility to create a table of discrete values which can be chosen and used in product price calculation formula.

This is how the table looks like:

Settings

These are:

values in columns

values in rows

template

actual matrix table

This is how Matrix Option table's values are added:

First, add values for columns. They must be separated by this sign: `|`

. Next, do the same for rows. Next click on *Generate* button and a table will be generated where you can add values for each cell. **Only numeric values can be added to cells! **

**As for values for rows and columns, they can be either words or numeric. Or even both! **These screenshots shows the proper syntax:

1) numeric values

2) numeric or words

3) numeric AND words

In this case a special syntax is used. You have to split option values by `|`

and split a value for a formula and a value for displaying by `:`

(space;colon;space). **Again, as it is very important, use colon (**`:`

**) surrounded by spaces from both sides!**

Why we need to split a value for a formula at all? Well, it is quite handy if you want to display a word or two as displaying name in the table, but still be able to use some numeric value in the formula. In case of choosing a cell within a column with the name like this `100 : One Hundred`

"100" will be set to a special var of this option and "One Hundred" will be just displayed in the table and cart/order meta.

We reviewed columns and rows values. So, what about the third setting called "template"? This setting is used for mastering a template which will be shown as this option value in cart/order meta. You can use two *special template variables* here: `{{{row}}}`

and `{{{col}}}`

.

Special Variables

It holds a value of the chosen column

It holds a value of the chosen row