Liquid, JavaScript, themes, sales channels
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.
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.
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.
User | RANK |
---|---|
37 | |
29 | |
12 | |
12 | |
8 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023