Search code examples
demandwaresalesforce-commerce-cloud

Filtering out, out-of-stock products from BonusDiscountLineItem demandware


By default BonusDiscountLineItem.bonusProducts will return out of stock products as well, is there any way to filter out the out of stock products from bonusProducts list?


Solution

  • We can filter out the list returned by BonusDiscountLineItem.bonusProducts.

    We can us IsOrderable() and IsInStock() methods for filtering out the OUT OF STOCK products.