Version: eXtendPS-SE 1.4.3
Audience: Administrator
Use Case
- In the response from eXtendPS-SE's Product Pricing and Configuration service, send the item's specified minimum quantity instead of the "quantity 0" price
Summary
There are use cases when you don't want to suppress the "0" quantity break for an item in the Product Pricing & Configuration service response, but you want to show the item's minimum quantity instead.
Configuration Details
- Confirm that the Exclude Quantity Head 0 Prices preference is not enabled in your eXtendPS-SE Product Pricing and Configuration Setup.
- Open the script file suite_promoapi_invoice_transformers.js.
- Edit the script, add the snippet below, and save the script changes. The snippet is used to return the item's associated 'minimumquantity' field value instead of the quantity 0 price break./**** @param {Object} args* @prop {Object} args.itemData* @prop {Object} args.itemPriceObject* @prop {Object} args.itemSearchResult* @prop {Array} args.itemSearchResults** @returns {Object} itemPriceObject*/function pcGetItemPriceObject(args) {var itemPriceObject = args.itemPriceObject;var itemSearchResult = args.itemSearchResult;if (itemPriceObject.minQuantity == 0) {var minimumQuantity = itemSearchResult.getValue({ name: 'minimumquantity' });if (minimumQuantity) {itemPriceObject.minQuantity = minimumQuantity;}}return itemPriceObject;}
- Check the PromoStandards Product Pricing and Configuration response to confirm the expected output.