question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add helper to "carts" module for checking available stock level for a product

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
robbieaverillcommented, Oct 8, 2020

Anyone is welcome to contribute, we’ll welcome any pull requests 😃

0reactions
robbieaverillcommented, Oct 13, 2020

Yep, sounds reasonable

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found