Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have an app extension am working on and added a Product metafields - that of a product ref (custom.upsell). The app extension which I run in dev mode, shows up correctly in my block editor and all works fine if I use say an integer value but when I choose the metafield to be a product I cannot fetch the data such as the title.
According to many posts once could get say the title as:
{% assign upsell = product.metafields.custom.upsell.value %} {{ upsell.title }}
But that is blank. I have been at this for hours and tried sooooo many variations. I can get the "gid://...' printed and type which is a product_reference. Some posts say to use all_products[...] but thats a no go as well.
This problem is seen in other posts that say you need to update the graphQL query to fetch the desired fields but since this is an app extension I am not working with this.
I just tried directly in theme same result:
{% assign upsell = product.metafields.custom.upsell.value %} <h2> {{ upsell.title }}</h2>
Any ideas?
Solved! Go to the solution
This is an accepted solution.
Well I had to create a new store. Not totally sure what was up with my dev store - it was old and just added Dawn. I created a new store with demo content and was able to get it to work. Gah.
This is an accepted solution.
Well I had to create a new store. Not totally sure what was up with my dev store - it was old and just added Dawn. I created a new store with demo content and was able to get it to work. Gah.
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024