Get product name in the checkout page

SC2020
Visitor
1 0 0

Hi,

We are trying to get the product name in the checkout page.

We tried:

‘{{ line_item.product.title }}’

{{ item.variant.title }}

{{ line_item.product.title }}

However, none of these work to retrieve the product title during the checkout.

We have this issue only receiving the product title, e.g, {{ line_item.price }} returns us the total amount during the checkout.

Replies 2 (2)

ZestardTech
Shopify Expert
5378 970 1293

Hello There, 

 

By default when a product is added to cart and then checkout so it will automatically show the product name and price by default. 

So could you kindly brief the issue and your requirement by sharing some screenshots so that I can assist you further on it.

 

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing

Misho
Shopify Partner
3 0 0

Use

{{ checkout.line_items[0].product.title }}

to get the title of the first product in the cart or iterate though all line items like:

{% for item in checkout.line_items %}
  <script>
    console.log('{{item.product.title}}');
  </script>
{% endfor %}

*Shopify plus on checkout.liquid, soon to be depracted.