How to select discounted line items

Highlighted
Shopify Partner
2 0 2

Hi, I'm trying to do something in particular only for those line items on cart that are affected by a discount code, but I'm not being able to do it. Based on docs, there's a discounted? property that should pull this off, but it's always returning me false, no matter if the line_item is affected or not. 

 

Has anybody been able to make this happen?

 

 

Thanks!

0 Likes
New Member
7 0 0

I get the same error where .discounted? always returns false for me even though discounts are applied to that line item. I hit up Shopify to see if I'm misunderstanding something or if it is indeed a bug.

0 Likes