Subject: Issue Resolving Metaobject in Liquid and Storefront API
Message:
Hello Shopify Support,
I’m encountering an issue with a metaobject type (company_profile) that I’ve set up in my store. Despite being published and correctly configured, the metaobject cannot be resolved in Liquid or through direct access. Other metaobjects work fine, so this issue seems specific to the company_profile type.
Raw Metafield Value: ["gid://shopify/Metaobject/98630762817"]
Could not resolve the company profile metaobject. Ensure it is published and accessible.
Even when directly referencing the metaobject by its ID (98630762817), it does not resolve in Liquid.
Troubleshooting Attempts:
Verified that the metaobject is published and active.
Enabled “Publish entries as web pages.”
Tested direct resolution with:
liquid
Copy code
{% assign resolved_company_profile = shop.metaobjects.company_profile['98630762817'] %}
{% if resolved_company_profile %}
{{ resolved_company_profile.company_name }}
{% else %}
Could not resolve metaobject.
{% endif %}
Tested metafield-based resolution:
liquid
Copy code
{% assign company_profile_reference = product.metafields.custom.company_profile | first | metaobject %}
Expected Behavior:
The metaobject should resolve via Liquid and display the company_name field.
Other Notes:
Other metaobject types (e.g., cultivar) resolve and function correctly in Liquid.
The issue is isolated to the company_profile type.
Request:
Could you please investigate why the company_profile metaobject cannot be resolved in Liquid or through the Storefront API? Is there a backend issue or configuration step I may have missed?
In Liquid metaobjects are accessed by their handle, not their internal numeric ID. For instance, if your company_profile entry has a handle carma, you should reference it as:
sorry it didnt work here chatgpt has helped me describe the goal i have and the issues im having not even accessing by handle has resolved the issue
Subject: Metaobjects and Metafields Not Resolving for Producer Profile System
Description of the Goal
I am creating a system on my Shopify store that allows for Producer Profiles using Metaobjects and Metafields, where:
Each producer has a Producer Profile Page that displays their details.
Products link to these Producer Profiles using the company_profile metafield (metaobject reference).
When completed:
Users should see the producer’s name displayed on a product page as a clickable link.
Clicking the link should take them to the Producer Profile Page, where the producer’s full profile details (like company name, logo, biography, etc.) are displayed.
Current Setup
Metaobjects
Company Profile (company_profile)
Fields:
company_name (Single Line Text)
logo_image (Image)
description (Rich Text)
producer_profile (Reference to producer_profile metaobject)
Example Entry:
Handle: company-profile-ugpfdtha
Company Name: Carma
Description: I like milk
Producer Profile: Carma
Producer Profile (producer_profile)
Fields:
name (Single Line Text)
biography (Rich Text)
location (Single Line Text)
website (URL)
Example Entry:
Handle: carma
Name: Carma
Biography: Milk cows great Olive Oil, just carry this gun you'll even get paid
Location: Italy, Toscana
Website: https://www.oliohub.ca
Metafields
Product Metafield: custom.company_profile
Namespace and Key: custom.company_profile
Type: Metaobject Reference
Metaobject Type: company_profile
Assigned to all products.
Purpose: Links a product to a specific company_profile entry.
How It Should Work
A product links to a company_profile metaobject via the custom.company_profile metafield.
On the product page:
The company_name from the company_profile metaobject is displayed as a hyperlink.
Clicking the hyperlink takes the user to the Producer Profile Page.
On the Producer Profile Page:
Details from the producer_profile metaobject are displayed, such as name, biography, and location.
Issue
Despite following Shopify’s documentation, the system does not work as expected.
Current Behavior
The custom.company_profile metafield retrieves the GID (["gid://shopify/Metaobject/98630762817"]).
However:
The metaobject fields (e.g., company_name) cannot be accessed in Liquid.
Attempting to resolve the metaobject by its handle (company-profile-ugpfdtha) or GID fails.
Shopify returns: Could not resolve the company profile metaobject. Ensure it is published and accessible.
Listing all company_profile metaobjects in Liquid does not display any entries, even though they are active and published in Shopify Admin.
Steps Taken
Verified that the company_profile and producer_profile metaobjects are:
Published.
Active.
Accessible in the Storefront API.
Ensured that the custom.company_profile metafield:
Is configured as a Metaobject Reference pointing to company_profile.
Is assigned to all products.
Tested direct resolution in Liquid:
liquid
Copy code
{% assign resolved_company_profile = shop.metaobjects.company_profile['company-profile-ugpfdtha'] %}
{% if resolved_company_profile %}
{{ resolved_company_profile.company_name }}
{% else %}
Could not resolve metaobject.
{% endif %}
Handle: company-profile-ugpfdtha
Company Name: Carma
Description: I like milk
Producer Profile Entry:
vbnet
Copy code
Handle: carma
Name: Carma
Biography: Milk cows great Olive Oil, just carry this gun you'll even get paid
Location: Italy, Toscana
Website: https://www.oliohub.ca
Expected Behavior:
The company_name field should display as a hyperlink on the product page.
The link should lead to the Producer Profile Page.
Please, avoid dumping responses from ChatGPT, it adds too much noise here. Can you share screenshots of your product custom metafield definition and your custom object definition from your Shopify admin?
and the code along with these metafields and metaobjects at the moment renders this the section that goes from "raw metafield value to could not resolve,
sorry the code i sent was the wrong one i found that if I expressly tell liquid my handle it is able to resolve and render
Raw Metafield Value: {{ product.metafields.custom.company_profile }}
{% assign handle = “company-profile-vn0shsmf” %}
Using Handle: {{ handle }}
{% assign resolved_company_profile = shop.metaobjects.company_profile[handle] %}
{% if resolved_company_profile %}
Company
{{ resolved_company_profile.company_name }}
<!-- Static Link to Producer Page -->
<a href="/pages/carma">Visit Company Profile</a>
{% else %}
Could not resolve the company profile metaobject using the handle.
{% endif %}
however as I wish to make hundreds of producer profiles i need a way to render it dynamically by just accessing the handle but no matter what i try it will not render nor access the handle dynamically
Hey Daniel I resolved that issue, thank you so much for your time I really am sorry I’m doing a poor job at giving you the information to resolve my issue. I will try from here on to not waste your time this is the first proper community post ive done, Ive run into a similiar issue immediately after that, should I post here or make a new discussion?