Hi Guys,
Please forgive this - I’m sure it will be an easy answer and I’m probably just an idiot but I’m new to all this stuff.
So I am putting together a site selling pens - all of the pen types that I’m selling have their fields in a metaobject, so they have
Name
Type of Pen
Image
Description
Default Case - Links to the Pen Cases metaobject
So what I want to do is - on the product page - display all the relevant details of the product but also the default case details.
So I have a metafield called Pen Case which is linked to the Pen Cases metaobject which has the following fields in it
Case Name
Image
Description
So on my product page I’l trying to add a bit of liquid code to display the Default case for that pen type - I’d like to add the image too but first things first.
so my simplistic understanding of the liquid code would suggest I just need to add
{{ products.metafields.custom.pen_case.value }} but I figure this will just give me a pointed to another metaobject so I figure I need to go in further and have tried
{{ products.metafields.custom.pen_case.case_name.value }}
It feels like I’ve tried every combination but I’m worried that I have a fundamental misunderstanding of how this data can be used.
HELP !!! 
Hi
when you have a metaobject reference, you need to access its fields like this:
{{ product.metafields.custom.pen_case.case_name }}
So on your product page, you should write:
{% if product.metafields.custom.pen_case %}
### {{ product.metafields.custom.pen_case.case_name }}
{{ product.metafields.custom.pen_case.description }}
{% if product.metafields.custom.pen_case.image %}
{% endif %}
{% endif %}
Let me know if this is not solving your problem.
ok - tried that, no joy - I’ve checked that the names used are the ones I’ve said - I can’t see a typo anywhere - I’m stumped as to how to debug it to be honest. Anything else that could be impacting it ?
Anyone got any further ideas - I haven’t managed to spot what the problem is - Is there anything that I can upload to assist diagnosis?
You should try this
{% assign pen_case = product.metafields.custom.pen_case.value %}
{% if pen_case %}
### {{ pen_case.case_name.value }}
{{ pen_case.description.value }}
{% endif %}
if this is not working then might be I need Collab access to check everything is set properly.
Hi - no that didn’t work - how do I sort out collab access ?
Thanks for your assist
I need your store url and collab access code.
Hi
Here are the steps to provide the collaborator access code.
Thanks!
Hi,
can you please confirm ?
This is what you have expected ?
Thanks !
1 Like