Servigistics InService Customization > Customizing Shopping Parameters > Shopping Parameters Customization > Using the Shopping Parameters
  
Using the Shopping Parameters
The shopping parameters can be used in determining the pricing and availability in a custom pricing delegate or passed to an external commerce system. These parameters are set in the request header and can be retrieved in the delegate using SCRequestContextUtility.getShoppingParameters() API. This API returns the SCFieldList, which represents the list of the shopping parameter as a SCField conceptual model.
When a shopping cart is ordered, if any of these shopping parameters’ internal names match the internal names of the soft attribute on the SCEOrder object, the system will save them. This order object will be available in the CommerceDelegate for further order processing.
A customization hook was also added to the client in delivery\app\services\cartsService.js to allow customizing the order functionality to use the shopping parameters.
/**
* This is a customization hook that allows specifying a function that performs
* order a cart.
* This function is used in cartDetails.
* The custom function should take the following arguments:
*
* 1) cart object the order operation is performed on
*
* 2) orderItem object containing the cart items included in the order
*
* 3) onSuccess is a function that takes as input a single argument "data"
* which is a json object parsed from the reponse. If this callback
* is not specified then the globally configured order cart success d.
* callback is use
*
* 4) onFailure is a function that takes as input a single argument "errorObject".
* This error object is the same that you would get from $http. It may have an
* "errorCode" attribute, and it may have a populated "response" attribute.
* If this callback is not specified then the globally configured order cart
* failure callback is used.
*
*/
cartsServiceProvider.setOrderCart = function (fn) {
if (typeof fn !== "function") {
throw new Error("Do not call setOrderCart without a function.");
}

orderCart = fn;
};
To make use of this customization hook, the configuration should be done inside customizations.js’s after() method as follows:
/**
* This function is called near the very end of main.js, after InService has
* initialized itself, and just before angular.bootstrap() is called.
*
* Use this function for config customizations.
*/
after: function () {
module.config(function (cartsServiceProvider) {
cartsServiceProvider.setOrderCart(function (orderItem, cart,
onSuccess, onFailure) {
// do custom logic here
});
});
}