I have Shopify account. In the Admin panel, Admin can add any number of products into Shopify store.
But I need to register Custom Product by the public user from my Shopify Store through the Client side.
i have tried the following code.
$('#send').click(function() {
$.ajax({
/* xxxx... : Api key
yyyy... : password */
url: 'https://xxxxxxxxxxxxxxxxxxxxxxxxxx:yyyyyyyyyyyyyyyyyyyyyyy@testing.myshopify.com/admin/orders.json',
type: 'POST',
dataType: 'json',
data: {
"product": {
"title": "Burton Custom Freestlye 151",
"body_html": "<strong>Good snowboard!</strong>",
"vendor": "Burton",
"product_type": "Snowboard",
"tags": "Barnes & Noble, John's Fav, \"Big Air\""
}
},
success: function(response) {
alert(response);
}
});
});
I am getting the following error:
XMLHttpRequest cannot load https://testing.myshopify.com/admin/orders.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://testing.myshopify.com' is therefore not allowed access.