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.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024