Personalized checkout and custom promotions with Shopify Scripts
Hey, i have recently hit a wall where I don't know how to fetch JSON data in Shopify, I'm new on the platform but I have experience in pure javascript. The following code is working on my own website ran by my server:
fetch ('/data.json')
.then(response => response.json())
.then(substance_data => {
for (var substance in substance_data) {
_substances_datalist.innerHTML += `<option value='${substance}'>`
}
})
But this does not work in a "section" .liquid file: {% javascript %}.
so my question is: how do I fetch JSON data I Shopify through .liquid file, and where do I put the JSON file.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024