My Oracle Support Banner

HOWTO Filter listProducts Results On Inventory Stock Level (Doc ID 2332458.1)

Last updated on SEPTEMBER 07, 2023

Applies to:

Oracle Commerce Cloud Service - Version N/A and later
Information in this document applies to any platform.

Goal

The project has a requirement is to only display products whose inventory is greater than 0.  Data returned from a search navigation response offer childSkus.quantity in the viewmodel, but the listProducts REST endpoint does not include inventory details. Filtering products in widget code produces a bad customer experience because of pagination. Pagination operates based on the totalResults attribute which doesn't have access to inventory values. For example there might be totalResult = 144 but actually 123 products that are in stock i.e quantity > 0.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 Option #1: 
 Option #2:
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.