Liquid connection to MetaObject not retrieve any info

Liquid connection to MetaObject not retrieve any info

terraeclat
Visitor
1 0 0

Tried so many ways to connect to the gemstone MetaObject & nested birthstones MetaObject - yet it states they both do not exist
After a lot of debugging, I focused on simple code to make the connection
The MetaObject reads from HTML hardcoded in pages, yet will not connect from liquid, leading me to believe there was a setting issue in the shop. Permissions or something...
I cannot upload screenshots to prove the setup.

Has anyone come across this problem before?
Please advise

 

 

<div style="background: #f1f1f1; padding: 20px;">
  <h3>Available Metaobjects:</h3>
    {% assign gemstone_metaobjects = shop.metaobjects.gemstone.all %}
    <ul>
       {% for gemstone in gemstone_metaobjects %}
<li>{{ gemstone.fields.name.value }}
</li> {% endfor %} </ul> </div>

{% comment %}Debug info - always give 0 as answer{% endcomment %}
<div style="background:#f8f8f8;padding:10px;margin:10px 0;border:1px solid #ddd;">
Values: {{ shop.metaobjects.gemstone.values | size }}
Nodes: {{ shop.metaobjects.gemstone.nodes | size }}
All: {{ shop.metaobjects.gemstone.all | size }}
</div>


{% assign gemstones = shop.metaobjects.gemstone.values %} {% if gemstones.size < 0 %} <h2>Available Gemstones</h2> <ul> {% for gemstone in gemstones %} <li> <strong>{{ gemstone.full_name.value }}</strong> {% if gemstone.image.value != blank %} <img src="{{ gemstone.image.value }}" alt="{{ gemstone.full_name.value }}" width="100"> {% endif %} <p>Color: {{ gemstone.primary_colour.value }}</p> <p>Source: {{ gemstone.source.value }}</p> {% if gemstone.birthstone.value != blank %} <p>Birthstone Month: {{ gemstone.birthstone.value.month.value }}</p> <p>Tradition: {{ gemstone.birthstone.value.tradition.value }}</p> {% endif %} </li> {% endfor %} </ul> {% else %} <p>No gemstones found. Check your metaobject configuration.</p> {% endif %} {% comment %} Debug information {% endcomment %} <div style="background: #f1f1f1; padding: 10px; margin-top: 20px;"> <h3>Debug Info</h3> <p>Metaobjects gemstone count: {{ shop.metaobjects.gemstone.values.size }}</p> <p>First metaobject handle: {% if shop.metaobjects.gemstone.values.first %}{{ shop.metaobjects.gemstone.values.first.handle }}{% else %}None found{% endif %}</p> <!-- Additional debug info --> <h4>Metaobject Namespaces Available:</h4> <ul> {% for namespace in shop.metaobjects %} <li>{{ namespace[0] }}</li> {% endfor %} </ul> </div>

 

 

Replies 0 (0)