Calculating total of column


I am trying to calculate the total of a column but it takes the element as text and not as number. Inside the loop I have written this.
{% assign myVar = cell.text | convert: “number” | plus: myVar %}

Equation into a custom field & sum into another custom field
Bug related to Liquid language in Custom Theme

Please do not divert topics with unrelated questions. Your post has been moved to a new topic.

This is not a coding forum. Users are responsible for their own custom themes.


@lubos @Tut
Yeah so tell me how to access it as a number. I understand this is not a coding forum but the code which works on liquid IDEs doesn’t work in the custom themes. If it wouldnt have worked anywhere else then it’s my issue but if it’s not working only here,then you have to provide me with an alternative. Otherwise tell me table name in which the details of specific invoice are stored. Or give me alt approach to access the elements like using cell.text


Is there any other way in which the cell elements can be accessed apart from using cell.text or convert them to a number?


I will expose cell.value variable which would contain number. I already made it for custom fields but I think it should be done for cells as well.

What exactly are you doing? Using custom fields on line items and want to show total?


Hi @lubos thanks for providing an alternative.
Yeah I am calculating the total of a column by accessing its HTML DOM in liquid and performing a sum on that to calculate the total of a column.

It can be thought as calculating the total amount or total quantity in a sales invoice. And then show the total.


Added to the latest version (18.9.26).

Instead of “convert” filter (which didn’t work), use value property of cell instead.

For example:

{% assign myVar = cell.value | plus: myVar %}


My name is Mohyadin Gure. I would like to contact to sales department.


@Robb_Stark winter is coming and we need help to calculate sum on qty colum.
Can you help the seven kingdoms by sharing your custom theme? I have not good knowledge in liquid but i can modify a theme via trial and error if i have one?
Can you help please?


Do not include personal information in your posts. Your email address has been removed. See

There is no sales department to contact. Post your question on the forum.