I'm attempting through metaobjects to create on my website a profile section for my marketplace

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.

Details:

  1. Metaobject Type:
  • Name: company_profile
  • Fields: company_name, logo_image, description, producer_profile
  • Example Entry:
    • Name: Carma
    • Handle: carma
    • Published: Yes
  1. Metafield Configuration:
  • Namespace and Key: custom.company_profile
  • Type: Metaobject Reference (referencing company_profile)
  • Assigned to products: Yes
  1. Issue:
  • Liquid Debug Output:

csharp

Copy code

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.
  1. 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 %}
  1. Expected Behavior:
  • The metaobject should resolve via Liquid and display the company_name field.
  1. 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?

Thank you for your assistance!

Best regards,

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:

{% assign resolved_company_profile = shop.metaobjects.company_profile['carma'] %}

thanks daniel ill try it out and get back to you with the result

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:

  1. Each producer has a Producer Profile Page that displays their details.
  2. 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

  1. 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
  1. 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

  1. 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

  1. A product links to a company_profile metaobject via the custom.company_profile metafield.
  2. 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.
  1. 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

  1. The custom.company_profile metafield retrieves the GID (["gid://shopify/Metaobject/98630762817"]).
  2. 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.
  1. Listing all company_profile metaobjects in Liquid does not display any entries, even though they are active and published in Shopify Admin.

Steps Taken

  1. Verified that the company_profile and producer_profile metaobjects are:
  • Published.
  • Active.
  • Accessible in the Storefront API.
  1. Ensured that the custom.company_profile metafield:
  • Is configured as a Metaobject Reference pointing to company_profile.
  • Is assigned to all products.
  1. 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 %}
  • This fails to resolve the metaobject.
  1. Attempted dynamic handle extraction:

liquid

Copy code

{% assign raw_value = product.metafields.custom.company_profile | first %}
{% assign handle = raw_value | split: '/' | last %}
{% assign resolved_company_profile = shop.metaobjects.company_profile[handle] %}
  • This also fails.

Request

  1. Could you verify why the company_profile metaobject cannot be resolved in Liquid or via its handle, despite being published and active?
  2. Is there a configuration step or limitation preventing company_profile metaobjects from being accessible in the storefront or Liquid?

Additional Information

  • **Example Metaobject Entries:**Company Profile Entry:

vbnet

Copy code

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 with this code

Raw Metafield Value: {{ product.metafields.custom.company_profile }}

{% if product.metafields.custom.company_profile %}
{% assign raw_value = product.metafields.custom.company_profile | first %}
{% assign handle = raw_value | split: ‘/’ | last %}

Extracted Handle: {{ handle }}

{% assign resolved_company_profile = shop.metaobjects.company_profile[handle] %}
{% if resolved_company_profile %}


Company


{{ resolved_company_profile.company_name }}


Visit Company Profile

{% else %}

Could not resolve the company profile metaobject dynamically using the extracted handle.


{% endif %}
{% else %}

No Company Profile Assigned

{% endif %} it renders as this ![image|690x388](upload://AwBlB2Hp2b6XbNoizbinzUGrLnH.jpeg)


sorry it only lets me send one image at a time


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

I see "Using Handle: {{ handle }}" in your code, but the screenshot shows "Extracted handle:". Please, provide a screenshot that pairs with the code.

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?