All things Shopify and commerce
Hi if i can select a metafield type File and check both the value image and video
now i did not understand on which base i can seperate them.
how i can access them
here is code that i can try it is working fine if i can upload a image but i cant understand how i can get the video
code:
<div class="custom-file-type">
<img src="{{ product.metafields.custom.file.value | img_url:'master' }}">
</div>
it work fine but if the user select the video so how i can access it any suggestion how i can differentiate on the base of file type.
if there is video it show the video and if user select the imaage it display the image
please help
You can look at the media type. It will return image for images, and generic_file for everything else. That should be good enough for you to know that's a video in your example. The file extension would also give you a very strong indicator of the file type.
i understand the type but could you right a few line of code according to given contion it very helpful for me thanks
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024