Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've not been able to find a working answer for me. In my store I have a product metafield for item number needed internally for documentation. I need to show this number on our order summary, I can display it on product page without problem but how do I do it on order page? Are you required to be on the plus plan? I'm not afraid to code but need to know what and where to put the code or atleast a hint
Solved! Go to the solution
This is an accepted solution.
Hi Xythia,
This should do the trick:
<input type="text" id="modellnummer" name="properties[_Modellnummer]" value="{{ product.metafields[YOUR_METAFIELD_NAMESPACE][YOUR_METAFIELD_KEY]}}">
Hi,
Simple, add the metafield value as a line item property for that product. Hint, if you do not want the customer to view that property, use _ before the line item property name.
Ref: https://shopify.dev/api/liquid/objects#line_item
So I've tried adding this code but it's still not working. Feels like I've just missed something but can't figure out what. Thank you for helping
In product-template
{% form 'product', product %}
<input type="text" id="modellnummer" name="properties[_Modellnummer]">
{% endform %}
In customer/order under line_item.title in the for loop
{{ line_item.properties('Modellnummer') }}
To add to this I realized you might need that label too as in the example code in your reference but struck out on that one aswell
This is an accepted solution.
Hi Xythia,
This should do the trick:
<input type="text" id="modellnummer" name="properties[_Modellnummer]" value="{{ product.metafields[YOUR_METAFIELD_NAMESPACE][YOUR_METAFIELD_KEY]}}">
Yes, already figured it out. Was a bit angry with myself when I realized the reason I got no value was because I never assigned one 🙂
Thank you for your help
I am customizing the Refresh Theme and would like a Product metafield I created called "custom.known_issues" to show up as a product line item on the admin order page (not for the customer to see! But for us to do quality checks when we pull the order).
I read your reply to Xythia but need more assistance. Where/how/what? 😉 Thank you in advance for any help you can provide!
Hi Amandaatremix,
You do not need metafield for this. Just use product line properties to achieve this.
If you need more assistance, you can PM me.
Thanks.
hello @jazz-jay I have a custom product meta field called Warehouse Location. Can you help me show this meta field to admin order page? I am ready to make code changes if required.
Can you please help?
It helps only to display metafield on product page. How to save this metafield to order metafield?
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025