Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I created a bundler app the utilizes variant metafields. App works fine, no issues there. But I do want to display some info about the bundled items on the product page. When I loop thru the metafield list, it acts as if there is only 1 item in the list. The list count even comes back as 1. If I loop through the quantities metafield, a list of integers, it works as expected.
You can see there are 7 items in each list.
{% for ref in product.variants[0].metafields.custom.component_reference.value %}
<p>{{ ref.product.title }}</p>
{% endfor %}
Above results in 1 title being displayed.
{% for quantity in product.variants[0].metafields.custom.component_quantities.value %}
<p>{{ quantity }}</p>
{% endfor %}
Above results in 7 quantity values being displayed.
Solved! Go to the solution
This is an accepted solution.
Oop! Nevermind. Majority of products in the metafield list are still dafts. Thats why.
Hi there @aashby13
Is this something similar you need?
Here these are the list of product I have selected in the metafield
If interested do let me know
This is an accepted solution.
Oop! Nevermind. Majority of products in the metafield list are still dafts. Thats why.