Search code examples
phpe-commercemodxmodx-revolution

modx revolution multiply values in cart


I didn't find anything suitable in the docs and tutorials: I use minishop2 and in my cart I display price and count like this:

[[+price]]  [[+count]]

but also I need to add total sum for the rows, which is price * count. How can I do this on modx without writing some special code?

Something like [[+price]*[+count]] - could I do something like this in the template?


Solution

  • You could try to work something out with Output Modifiers: http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)

    Example:

    [[+price:mpy=`[[+count]]`]]