Skip to content
  1. Extras
  2. msProductRemains
  3. Snippet getRemains

Snippet getRemains

The snippet displays the number of product remains. It can show both a total amount of remains for each property and a number for a certain combination of product properties.

If you call the snippet without specifying one or several properties, it will display a total amount of remains for all combinations of properties.

Parameters

NameBy defaultDescription
&idResource IDProduct ID.
&colorProduct color.
&sizeProduct size.

Call options

For a better and more precise calculation of remains, the snippet should be called non-cached.

For a total number of remains on the product page:

modx
[[!getRemains]]

For an amount of remains of a certain combination of properties:

modx
[[!getRemains?
  &id=`[[+id]]`
  &color=`color`
  &size=`size`
]]

Use standard MODX filter for call recording in a placeholder:

modx
[[!getRemains:toPlaceholder=`remains`?
  &id=`[[+id]]`
  &color=`color`
  &size=`size`
]]