Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Currently using Envy theme and in the cart-drawer I want to do something depending on the contents of the product title.
The file is cart-drawer.liquid, but I can't figure out how to get the title (or price) of the current product that's being displayed.
Does anyone know how to get this information?
It normally uses the regular cart fields, like cart.items_subtotal_price but I need to check it for the current item in the cart.
I've tried cart.items.line_item.product.title for example, but whatever I try to come up with, it never returns a value...
Hi @DutchDelight ,
Find the code below
{%- for item in cart.items -%}
then use the below code inside the loop to get the product title
item.product.title
Hope this will help...
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025