[英]Shopify Liquid: Variables within Filters
Right Now this filter works: 现在,此过滤器有效:
{{ line_item.price | times: 2 | money }}
I want to able to filter by a variable, something like: 我希望能够通过变量进行过滤,例如:
{{ line_item.price | times: {{ line_item.quantity }} | money }}
Is there any way to do this? 有什么办法吗?
Thanks 谢谢
Have you tried taking off the {{ }}
on the line_item.quantity? 您是否尝试过删除line_item.quantity上的
{{ }}
? If I recall it is a number so it should work. 如果我记得这是一个数字,那么它应该可以工作。
Try this: 尝试这个:
{{ line_item.price | times: line_item.quantity | money }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.