Retail hardware, software, and Shopify Point of Sale
Can someone share how I might add a variant metafield to a printed receipt as a line item?
If the namespace and key is 'custom.location', what would be the code I'd use?
Hello @NDJAU ,
Try this
{% for line_item in transaction.line_items %}
{{ line_item.product.title }} - {{ line_item.variant.title }}
Quantity: {{ line_item.quantity }}
Price: {{ line_item.price | money }}
{% assign metafield_value = line_item.variant.metafields.custom.location %}
{% if metafield_value %}
Additional Info: {{ metafield_value.value }}
{% endif %}
{% endfor %}
If problem solved don't forget to Like it and Mark it as Solution!
And if you need help with customization/code part you can contact me for services
You can find the email in the signature below.
Thanks
Thanks - would this go in the code editor under the line-items.liquid section?
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025