Hello, Good Day fellow developers...
I need some sort of advice about this Cart API.
Okay, here is the thing. I am trying to get the Quantity Available of a product that is already added inside the Cart,
for 2 weeks of searching I have read some post saying that "inventory_quantity" has been deprecated already, and they're gave me this "Inventory API".
Now my problem is every time I tried requesting to this "Inventory API", I'm getting an error
"Access to XMLHttpRequest at 'https://******.myshopify.com/admin/api/2019-07/inventory_levels.json?inventory_item_ids=21108251164770' from origin 'https://******.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
I don't understand a thing about this thing because I just started developing our store few months ago,
hopefully there is someone here can answer me about this matter.
If you're making calls to the admin API, you will need to do so from the server side, rather than client side. The Admin API is an authenticated API and should never be used from the storefront.
If you are only concerned with whether an item is available to purchase, you can use the AJAX API on the storefront to see the available boolean, which indicates whether the item is available (in stock) to be purchased.
Hope that helps give you some context!
Hi Thanks for the reply...
My concern is for "Changing the Cart Item Qty" right now I am able to change the Cart Item Qty from 1 to 10, but it seems that when that product is already inside the cart when I try to change it's qty to 10 even though the available product qty for that item is 8...
So what I am trying to do is make an "SELECT TAG" ranges from minimum 1 up to "Max product qty available"...
my Question is how will I know or get the "Max product qty available" ?
by the way I am creating a cart popup not a cart page that's why I need API...
|an hour ago|
|an hour ago|
|2 hours ago|
|3 hours ago|