@W-19347602 - Fix In Store Inventory Stock Level Checks - #3401
Merged
shauryemahajanSF merged 8 commits intoOct 16, 2025
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
shauryemahajanSF
marked this pull request as ready for review
October 16, 2025 13:12
|
|
||
| // Product details for selected store | ||
| const selectedStoreInventory = getInventoryById(product, selectedStore?.inventoryId) | ||
| const selectedStoreStockLevel = selectedStoreInventory?.stockLevel || 0 |
Contributor
There was a problem hiding this comment.
selectedStoreInventory is undefined, the result is "stock level 0," making the product appear out of stock, but is it possible that the inventory was just not yet loaded/ partial data was retrieved from api
patricksullivansf
previously approved these changes
Oct 16, 2025
| const isSelectedStoreOutOfStock = !selectedStoreStockLevel || !selectedStoreInventory?.orderable | ||
| const selectedStoreUnfulfillable = selectedStoreStockLevel < quantity | ||
|
|
||
| // Use appropriate inventory based on pickup/delivery selection |
Contributor
There was a problem hiding this comment.
Would be nice to mention here that if compatibility with v8.1 or earlier API is needed use pickupInStore false
Contributor
Author
There was a problem hiding this comment.
Sounds good, added note
shauryemahajanSF
dismissed stale reviews from patricksullivansf and sf-henry-semaganda
via
October 16, 2025 18:45
e0dbf35
shauryemahajanSF
requested review from
patricksullivansf and
sf-henry-semaganda
October 16, 2025 18:46
sf-henry-semaganda
approved these changes
Oct 16, 2025
yhsieh1
approved these changes
Oct 16, 2025
patricksullivansf
approved these changes
Oct 16, 2025
shauryemahajanSF
enabled auto-merge (squash)
October 16, 2025 21:21
shauryemahajanSF
deleted the
t/commerce/W-19347602/fixInStoreStockLevels
branch
October 16, 2025 21:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Right now, on the product view on cart and PLP, when selecting inventory of pick up item, we get notified about stock levels of delivery instead. This PR fixes this issue so inventory messages take into account the in store inventory instead.
Note,the behavior of being able to select (but not save) a value greater than the stock level on cart exists (This predates bopis).
Before (both use same delivery stock levels):
Screen.Recording.2025-10-15.at.6.05.00.PM.mov
After:
Screen.Recording.2025-10-15.at.5.52.35.PM.mov
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization