Shopify themes, liquid, logos, and UX
I'm trying to create a page with a list of products, including their variants that shows the variant options & a variant metafield for it.
Is there a way to reference a variant metafield for a particular variant ID?
@pvgregory You cannot access variants by id in theme liquid. And if you try using ajax on the frontend there will be no metafield data.
In the context of a product object roughly:
{{ product.first_or_selected_variant.metafields.namespace.key.value }}
That's for when the page loads.
This does not update when a user selects options if the values are different among variants.
You need javascript for dynamic text and it vary wildly among themes.
If you need this customization then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
User | RANK |
---|---|
186 | |
168 | |
78 | |
56 | |
45 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023