A space to discuss online store customization, theme development, and Liquid templating.
I have a strange situation.
Last fall I developed a theme for a client using Online Store 2.0 and the Dawn theme as a base. The project went to sleep for a few months for unrelated business reasons, but the theme itself was working fine when I left it. When I went to work on it again today, I find that none of the metafields in the liquid templates are printing, and any conditional logic based on metafields was broken.
I had originally used the syntax from the API documentation to access metafields (resource.metafields.namespace.my_field.value) — again, this worked when I left the project two months ago, but no longer works today. What *does* work today is to remove the .value from the end (resource.metafields.namespace.my_field).
Removing the .value fixes all the issues in my templates and the site renders properly. But it's very disconcerting that the site could break seemingly randomly, and that I'm now accessing the metafields object contrary to the documentation.
I'd really like to understand what happened — any theories or insights would be much appreciated!
Hi,
I have a similar issue, in my case on some files (.liquid) inside Snippets folder needs to use the .value and others I can use otherwise will get 'null'.
Example: {{selected_variant.metafields.namespace.value}}
Does anybody know whats happening here?