Add helper to "carts" module for checking available stock level for a product
See original GitHub issueWe have this helper function: https://commercejs.com/docs/api/#check-requested-quantity
It requires a checkout token ID to work, which means it can’t be used before you get to the checkout.
If a developer wants to check the stock level when adding to cart, or async after doing so, they would have to fetch the product’s data GET /v1/products/{id}
just to get the stock level out of it, and have their own comparison logic.
We could make an equivalent of this method but in the carts namespace which won’t require a checkout token.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Commerce Stock | Drupal.org
This module provides stock management for Drupal Commerce stores. ... The add to cart is now checked using rules: Event "Check if a...
Read more >Stock Management | SAP Help Portal
A product's stock level information is exposed through the CommerceStockService. Using this service, you can determine a product's Availability To Promise ...
Read more >Carts in EZOfficeInventory: Equipment Management at Jobs ...
The Cart Module in EZOfficeInventory empowers you to stay on top of your jobs and events, greatly simplifying equipment management.
Read more >Shift4Shop Guide to Inventory Management
To start setting up inventory control, first we're going to manage the general or global settings. These settings will apply by default to...
Read more >Apply inventory settings - Commerce | Dynamics 365
Enable stock check in app – This setting turns on a product inventory check. Buy box, cart, and pick up in store modules...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Anyone is welcome to contribute, we’ll welcome any pull requests 😃
Yep, sounds reasonable