Restricting purchases for specific products

  • Updated

Overview

This guide explains how to set up a warning that appears when restricted products (with a specific assortment code) are added to a purchase order. The warning informs users but does not block the purchase order from being placed.
 

Add assortment code

  1. Go to Config > Products > Purchase Orders -> Non-purchasable assortment codes.
  2. Enter the assortment code for the product that triggers validation.
  3. If no assortment codes exist, add them via Products -> Properties tab -> Assortment codes.


Configure the connector

  1. Go to Config > Advanced > Connector.
  2. Add the following configuration:
{
    "name": "assortmentCodeValidator",
    "isAuthenticatedManually": false,
    "timeOut": "00:00:00",
    "implementations": [
        "IPurchaseOrderValidator"
    ],
    "properties": [],
    "disableStandardErrorPolicy": false,
    "enabledForMarkets": [],
    "disabledForMarkets": []
}




Assign non-purchasable assortment codes to products

  1. Select the product.


     
  2. Add the assortment code to the product.



     

Validate the purchase order

  • A validation error will show if a restricted product is in the purchase order.
  • The order can still be processed despite the warning.


Expected behavior

  • A validation message appears for restricted products in the purhcase order.
  • The purchase order can be completed without removing the product.

This setup helps ensure that users are aware of the restrictions on certain products while still allowing them to complete the order.

Was this article helpful?