We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Need help with understanding Liquid code containing filter and :

Need help with understanding Liquid code containing filter and :

dnadj
Visitor
1 0 0

I am trying to learn liquid and  need help with understanding the below line of code

[Dawn theme - main-product.liquid]

 

 

 

{%- assign cart_qty = cart
| item_count_for_variant: product.selected_or_first_available_variant.id
-%}

 

 

 

I think I understand most of the above except the last part of the code line.

 

{%- Strip whitespace at the start

assign cart_qty Assigns value of right side to variable cart_qty

cart | passes cart to a filter on the right side of |

item_count_for_variant: product.selected_or_first_available_variant.id This is the part I dont understand and how it fits into to the filter expression. 

 

Thanks in advance for your help.

Replies 0 (0)