Remove a Configuration Option

This example uses the remove action to remove an option for a property. When you deploy this customization, the JSONPath query searches for the addToCartBehavior property’s enum array. This modification removes the showMiniCart option in the user interface.

Copy
          
{
    "type": "object",
    "modifications" : [
        {
            "target": "$.properties.addToCartBehavior.enum[?(@ == 'showMiniCart')]",
            "action": "remove"
        }
    ]
} 

        

After deploying this modification, the code in the configurationManifest.json looks like this:

Copy
          
...
"properties": {
         "addToCartBehavior": {
               "group": "catalog",
               "subtab": "cart",
               "type": "string",
               "title": "Add to cart behavior",
               "description": "Choose the action that occurs when the user adds an item to the cart.",
               "default": "showCartConfirmationModal",
               "enum": [
                     "goToCart",
                     "showCartConfirmationModal"
               ],
               "id": "addToCartBehavior"
    },
... 

        

After deploying this modification, the SuiteCommerce Configuration record looks like this:

Shows the results of the deployed modifcation in the Configuration record of the NetSuite interface. The showMiniCart option has been removed.

Leave a comment

Your email address will not be published. Required fields are marked *