Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I have the following:
Solved! Go to the solution
This is an accepted solution.
Hi @molten_frog,
Please change code:
{% assign product_image = product.selected_or_first_available_variant.metafields.my_fields.image_1 %}
=>
{% assign product_image = product.selected_or_first_available_variant.metafields.my_fields.image_1.value %}
Hope it helps!
This is an accepted solution.
Hi @molten_frog,
Please change code:
{% assign product_image = product.selected_or_first_available_variant.metafields.my_fields.image_1 %}
=>
{% assign product_image = product.selected_or_first_available_variant.metafields.my_fields.image_1.value %}
Hope it helps!
You are an absolute hero. Not the first time you have helped me 🙂
Hi @molten_frog,
If you have any difficulty, you can contact me.
Happy to help you.
Thanks @LitExtension I really appreciate it.
I have uploaded an mp4 to variant_media_1. And similar to the code above I have done the following:
Hi @molten_frog,
The generic_file object can be returned when a metafield has a file_reference type. If the file_reference is not an image of type JPEG, PNG, or GIF, then it will return a generic_file.
Refer https://i.imgur.com/8iiOqCc.png
Hope it is clear to you.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025