skip to Main Content

I want to inject some custom liquid in my abandoned cart email on Shopify. Shopify has docs here saying the product_title can be found under line_items under abandoned_cart.

I naturally assume you can get the product_title with something akin to…

<p>You left {{ abandoned_checkout.line_items[0].product_title }} in your cart.</p>

But this doesn’t work. What’s the proper way to get the product name of the first item?

2

Answers


  1. If you are working with email template for "Abandoned checkout" in notification settings, this should work:

    {{ subtotal_line_items[0].product.title }}
    

    Loop code:

    {% for line in subtotal_line_items %}
       {{ line.product.title }}
    {% endfor %}
    

    And here is some useful documentation here:
    https://help.shopify.com/en/manual/orders/notifications/email-variables#line-item

    Login or Signup to reply.
  2. All products for the abandoned cart will keep here: subtotal_line_items and you should operate with the Product object. So in the your case it should be:

    <p>You left {{ subtotal_line_items[0].product.title }} in your cart.</p>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search