Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Variant metafield added to POS Printed Receipt

Variant metafield added to POS Printed Receipt

NDJAU
Visitor
2 0 0

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?

Replies 3 (3)

Guleria
Shopify Partner
3688 741 1038

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

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
NDJAU
Visitor
2 0 0

Thanks - would this go in the code editor under the line-items.liquid section?

Guleria
Shopify Partner
3688 741 1038
  • In Shopify Admin, go to Settings > Receipt Settings.
  • Edit the Receipt Template.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder