Editing $root.settings and $root.vlocityCPQ.features Variables

Editing $root.settings and $root.vlocityCPQ.features Variables

In Winter '18, the UI settings for Industries CPQ have been moved from rootScope to a service. If you have custom templates that use $root.settings or $root.vlocityCPQ.features variables, you must some base files.

  • cpq-base-grid.html

  • cpq-base-header.html

  • cpq-base-header-card.html

  • cpq-left-sidebar.html

  • cpq-product-cart.html

  • mobile-ret-cart.html

Take These Files

Make These Changes

cpq-base-grid.html

mobile-ret-cart.html

  • Delete the initApiSettingsController from the JavaScript section.

  • Delete references to the initApiSettingsController controller; for example:

    vlocity.cardframework.registerModule.controller('initApiSettingsController', 
       ['$rootScope', function($rootScope) {
    $rootScope.apiSettings = {
    'addToCartAPIRequiresPricing': true,
    'addToCartAPIRequiresValidation': true,
    ...
    };
    $rootScope.vlocityCPQ.features = {
    enablePromotions : true,
    ...
    };
    }]);

cpq-base-header-card.html

Replace $root.vlocityCPQ.features.enablePricing with attrs.enablePricing.

cpq-base-header.html

  • Update the vloc-card directive.

  • Add the enable-pricing parameter:

    <vloc-card enable-pricing="attrs.enablePricing">

cpq-left-sidebar.html

cpq-product-cart.html:

Replace $root.vlocityCPQ.features with importedScope.featureSettings.