Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Hello, I can't get a grip on the line_item object. I'm trying to to something like this in the cart before checkout:
{%- for collection in item.product.collections -%}
{%- if line_item.sku == "12345" and line_item.quantity > 1 -%}
<p>something...</p>
{%- endif -%}
{%- endfor -%}
I'm adding the code into main-cart-items.liquid (Dawn 2.0).
Has anyone an idea how to solve this?
Greetings,
Eduard
P.S. I can't link the shop (secrecy).
Solved! Go to the solution
This is an accepted solution.
For everyone who has the same question at some point. Here is what I've found out so far:
In main-cart-items.liquid you're already in a for loop:
This is an accepted solution.
For everyone who has the same question at some point. Here is what I've found out so far:
In main-cart-items.liquid you're already in a for loop:
Thanks! This helped me solve an issue I had trying to do conditional messages in the Cart via Custom Liquid block in the template....