Version: eXtendPS-DE 1.4.3
Audience: Administrator

Use Case

  • In the response from eXtendPS-SE's Production Pricing & 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.

Image Placeholder

Configuration Details

  1. Confirm that the Exclude Quantity Head 0 Prices preference is not enabled in your eXtendPS-SE Product Pricing and Configuration Setup.Image Placeholder
  2. Open the script file suite_promoapi_invoice_transformers.js.
  3. 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;
    }
  4. Check the PromoStandards Product Pricing & Configuration response to confirm the expected output.