Liquid, JavaScript, themes, sales channels
Hey,
There is way to get the products images from js in product page without
touch the product.liquid?
Thanks!
Alon Golan
https://shopify.dev/docs/themes/ajax-api/reference/product
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
Yes. Every product has a JSON endpoint which contains the image's URL in it plus much more data.
For example, this product:
https://colourpop.com/products/glisten-up-vitamin-c
Can have most of its information viewed by adding .json at the end of the URL.
https://colourpop.com/products/glisten-up-vitamin-c.json
You just need to do a GET call of the product you want and get the image.
Naturally it requires basic Javascript knowledge to do so which is beyond the scope of this answer.
Kind regards,
Diego
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024