Math filters for performing arithmetic operations in Liquid templates.
plus
minus
times
divided_by
.toString()
of the result number.
number
and we cannot tell the difference. For example:
integerArithmetic
argument to enforce integer divide:
modulo
abs
abs
will also work on a string that only contains a number:
at_least
at_most
ceil
floor
round
sum
cart.products
contains an array of all products in the cart of a website.
Assume each cart product has a qty
property that gives the count of that product instance in the cart.
Using the sum
filter we can calculate the total number of products in the cart.