Soft Attributes for Shopping Parameters
You must use the getShoppingParameters() API on thecom.ptc.sc.services.plugins.CommerceDelegate interface to add custom shopping parameters. A shopping parameter is defined using the SCField conceptual model. For example, you can define a custom shopping parameter Dealer Code, by constructing the following SCField class in the getShoppingParameters() API:
SCFieldList resultList = new SCFieldList();

//Define all the options for “Dealer Code” field
SCField dealerCode = new SCField("Dealer Code", "input", "", "dealerCode", null);
//Add to the result List
resultList.addItem (dealerCode);
For more information about:
The SCField class, see the PTC Arbortext Content Delivery Javadoc.
The custom shopping parameters, see Shopping Parameters Customization.
Follow these steps to create a soft attribute dealerCode for the Dealer Code custom shopping parameter:
1. Log into PTC Arbortext Content Delivery administration home page as an administrator.
2. On the administration home page, click Attributes.
3. On the Types panel, click Shopping Cart, if not already selected by default.
4. On the Attributes panel, click Create Attribute.
5. Enter the internal name, data type, display name, and description for the soft attribute dealerCode and click Apply.
The soft attribute dealerCode is displayed on the administration home page in the Attributes section.
After you add the soft attribute for the Dealer Code custom shopping parameter, you can set the value of the shopping parameter. Use the Set Shopping Parameters option on the menu to set the values of all shopping parameters.
To include a custom shopping parameter in carts, you must define the soft attribute for that shopping parameter before creating the carts. In the following JSON file, the POST request result of carts displays the soft attribute dealerCode for the shopping parameter Dealer Code: