All things Shopify and commerce
i have a piece of code that gets the products that i want to display as desired . The problem is that it only shows up when i am logged in .
jQuery.getJSON( "https://wilde-iris.myshopify.com/admin/api/2020-07/products.json?ids=7012259332247,7012276338839,7012278927511,7012263526551,7012268900503", function(data) {
jQuery.each(data.products, function() {
console.log("wilde iris");
jQuery('.content-yml').append('<a href="'+ location.origin +'/products/'+ this.handle +'"><div class="item-product-yml">'+
'<img src="'+ this.image.src +'" />' +
'<h2>'+ this.title +'</h2>' +
'<div class="price-yml">£'+this.variants[0].price+'</div>'+
'</div></a>');
});
}).done(function() {
})
.fail(function() {
jQuery('.content-yml').append('<div>An error has occurred. Sorry for the inconvenience</div>');
});
I tried accessing the URL in get json when not logged in and it gives me an error
{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}
If there is any way please let me know. Thanks for the help !!!
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