Bug related to Liquid language in Custom Theme

Hi. I have been creating a Custom Theme by taking the default theme code and making modifications. However, i am stuck with a silly problem for days now. What I try to achieve is, for same types of items in sales invoice instead of a line for each item, a single item line is shown in the pdf that shows the sums of quantities, price and amount of those lines. The problem is that Liquid language doesn’t have a direct function for adding a value of a variable to another variable. I have searched and found a solution many people on forum claim works.

{% assign res = res | plus: var1 %} . However, this line results in a syntax error in my case. “Liquid error: Number of parameters specified does not match the expected number.”

I think maybe some Libraries of Liquid are not included in Manager that’s why it doesn’t recognize this function? It is just a guess though.Anybody got an idea to solve this problem? Thanks!

The issue is that most variables are presented in the model as text and what you need for them is to be presented as number so you can do mathematical operations on them.

Someone has raised similar issue just a few days ago. See Calculating total of column

Hi @lubos, thanks for reply! I looked at the link. Any estimate when you will expose that variable?

Check the latest version (18.9.26). Instead of text attribute, use value.

So for example…

{% assign var1 = row.cells[2].value %}