Skip to content
  1. Extras
  2. MiniShop3
  3. Snippets
  4. msOptions

msOptions

Snippet for outputting specific product options. When you know which options you need, use this snippet for best performance.

Parameters

ParameterDefaultDescription
productcurrent resourceProduct ID
optionsComma-separated option list
tpltpl.msOptionsLayout chunk
sortOptionValuesSort option values (see below)

Deprecated parameters

Backward compatibility

These parameters are deprecated and will be removed in future versions:

  • &input → use &product
  • &name → use &options

Examples

Output color and size for current product

fenom
{'msOptions' | snippet: [
    'options' => 'color,size'
]}

For specific product

fenom
{'msOptions' | snippet: [
    'product' => 123,
    'options' => 'color,size,material'
]}

Uncached call

fenom
{'!msOptions' | snippet: [
    'options' => 'color,size'
]}

Custom chunk

fenom
{'msOptions' | snippet: [
    'options' => 'color,size',
    'tpl' => 'myOptionsChunk'
]}

With value sorting

fenom
{'msOptions' | snippet: [
    'options' => 'color,size',
    'sortOptionValues' => 'size:SORT_ASC:SORT_STRING:M'
]}

Option value sorting

The sortOptionValues parameter sorts values within each option.

Format

option_name:direction:type:first_value
  • direction: SORT_ASC or SORT_DESC
  • type: SORT_STRING, SORT_NUMERIC, SORT_NATURAL
  • first_value: (optional) value to show first

Example: size:SORT_ASC:SORT_STRING:M — sort size values ascending, put M first.