SAP CPQ Configurable Products Integration
The SAP CPQ Configurable Products integration provides a user interface for configuring and selling products modeled with SAP CPQ, and includes features like bundling and guided selling. This integration streamlines the configuration and sales process of customizable products in your storefront.
The SAP CPQ Configurable Products integration provides a user interface in composable storefront for configuring and selling configurable products that have been modeled using SAP CPQ Integration for Configurable Products and the associated configuration engine. Note that the composable storefront library does not include SAP CPQ itself.
The initial version of the composable storefront library for SAP CPQ Integration for Configurable Products includes the following features:
- Bundling and guided-selling scenarios, where the bundle in SAP Commerce contains simple (non-configurable) products. The dependencies within this bundle are controlled by the underlying SAP CPQ configurable product.
- Single-level configurable products in your composable storefront where the product model resides in SAP CPQ.
- A configuration page with the most commonly used attribute types, especially attributes that are linked to a (non-configurable) product. For more information, see Supported Attribute Types and Display Types.
- A price summary at the bottom of the configuration page that includes the base price, the price of the selected options, and the overall total price of the configured product.
- An overview page with all user selections accessible at any time during configuration.
- SAP CPQ messages that are displayed in the composable storefront in case of conflicts.
With this integration, configurable bundles become a part of the storefront's standard processes, such as catalog browsing, viewing product details pages, adding items to the cart, checking out, and viewing order history pages.
For more information about the underlying functionality, and for information about features that are currently not supported, see SAP CPQ Integration for Configurable Products.
Requirements
The CPQ Configurable Products integration requires the cpqproductconfigocc extension. For more information, see Configurator for Complex Products Module.
The CPQ Configurable Products integration also requires the following releases of SAP Commerce Cloud:
- SAP Commerce Cloud 2105 or newer
- SAP Commerce Cloud, Integration Extension Pack 2108 or newer
Adding the SAP CPQ Configurable Products Integration to Composable Storefront
To add theSAP CPQ Configurable Products integration to composable storefront, you install the @spartacus/product-configurator library.
You options are either Installing the Product Configurator Library During the Initial Setup of Composable Storefront, or Adding the Product Configurator Library to an Existing composable storefront Project.
Installing the Product Configurator Library During the Initial Setup of Composable Storefront
Procedure
Adding the Product Configurator Library to an Existing composable storefront Project
If you already have a composable storefront project up and running, you can add the product configurator library to your project by running the following command from the root directory of your storefront app:
ng add @spartacus/product-configurator
This command uses schematics to modify your application and add the modules needed to launch the library.
After running this command, you are asked which product configurator features you would like to set up. Choose Product Configurator - CPQ Configurator (b2b feature).
Early Login
You must have early login enabled to be able to use the configurable products integration with composable storefront. For more information, see Early Login.
Supported Attribute Types and Display Types
The following CPQ attributes types are supported in the storefront:
- User input or computed (string)
- User input or computed (number)
- User selection
- User selection with quantity for each attribute value
- User selection with attribute quantity input
The following CPQ display types are supported in the storefront:
- Checkbox
- Dropdown
- Radio button
- Free input, no matching (string or number)
Handling of Quantity on Attribute and Value Level
Multiselect Attributes
For multiselect attributes (checkbox list) that are line items, quantities are supported both on attribute level and on value level. Multiselect attributes that are non-line items cannot have quantities on the value level. They can only have quantities on the attribute level.
Single-Select Attributes
For single-select attributes (radio button group, DDLB), only quantities on the attribute level are supported. Any quantities that have been defined on the value level for the attribute in CPQ product administration are ignored in the UI.
Price on Attribute Value Level
The display of prices for individual options or attribute values is supported for both bundle items (attributes linked to products) and for simple attribute values (non-bundle items).
If the attribute value allows a quantity to be entered, the resulting price is displayed in the form of a formula (for example, 3x70 EUR = 210 EUR).
When a price-relevant attribute value is selected, the price of the attribute value is added to the total price of the product.
Text Labels for Attributes
The attribute label on the configuration screen displays the content of the attribute's Custom Label in CPQ. You can find this field for the attribute in CPQ product administration, as follows:
Procedure
Translations for Product Texts in the UI
Product texts coming from the CPQ product model are translated in the composable storefront if the translations are maintained in CPQ. However, there are a few exceptions.
The following translations are currently not displayed in the composable storefront, but are instead shown in English:
- Standard labels Choose and Select, as well as standard label No option selected
- Error and validation messages coming from CPQ
- Product names in the cart summary
Product ID (Article Number) in SAP Commerce
In SAP Commerce, product IDs (article numbers) cannot contain slashes, backslashes, encoded slashes (%2F), or encoded backslashes (%5C). If necessary, adjust the product IDs in CPQ.
Group Status Handling
Group status handling in the CPQ composable storefront UI is different from the composable storefront UI for SAP Variant Configuration and Pricing. The CPQ composable storefront group menu only shows whether orders are "complete" in the sense that no mandatory fields are missing. The group menu does not provide any information about conflicts at the group level. Currently, CPQ composable storefront does not know whether a group is consistent (no conflicts) for the current group. This information also is not known for the attribute itself.
Resolving Issues
Resolve Issues only leads to the first incomplete group for which mandatory fields are missing.
In CPQ, conflicts are rendered as messages. Consequently, there is no conflict solving with generated conflict groups, nor navigation to conflicting attributes through Resolve Issues.
Error and Warning Messages
CPQ can generate different kinds of messages, which cause the following responses in composable storefront.
| CPQ Message Type | Counted Towards Total Number of Issues | Message Shown in Global Message Area | UI Message Type |
|---|---|---|---|
| Incomplete attributes | Yes | No | N/A |
| Incomplete messages | Yes | Yes | ERROR |
| Error messages | Yes | Yes | ERROR |
| Conflict messages | Yes | Yes | ERROR |
| Invalid messages | Yes | Yes | Error |
| Failed validations | Yes | Yes | WARNING |
Bundle Item Product Not Available in Commerce
If a bundle item cannot be found in SAP Commerce, only the product ID is displayed. Information about the bundle item (such as a picture or description) is not shown. This may occur if there are issues with master data replication.
Cart Summary
When added to the cart, the CPQ bundle product results in a single cart item entry. There are no subitems representing the products contained in the bundle. However, to give customers an overview of their selections and to confirm what exactly they are buying, the information in the cart has been extended to show the list of products that have been selected inside the bundle. The list contains the product description, the quantity, and the item price if these are maintained in CPQ.
The following prerequisites apply for a product to appear in the cart summary:
- In CPQ, the attribute value has been linked to a product
- In CPQ, the attribute has been marked as line item
Cart Validation
The cart validation feature allows composable storefront to verify a user's cart at every step during checkout to ensure that the requested quantity of each item is available. For information, see Cart Validation.
Configuring composable storefront for Cart Validation
Procedure
Configuring SAP Commerce 2005 and 2011 for Cart Validation
The steps that can be done on the composable storefront side ensure that for a standard UI flow, a configuration cannot be ordered if it has issues. However, you still need to block the creation of orders that could be done through OCC. Otherwise, an order containing such configurations can be created using, for example, the developer tools in the end user's browser. It is therefore necessary to make the adjustments described in this section if you are using SAP Commerce 2011, and to make the adjustments described in this section and the following section if you are using SAP Commerce 2005.
Note that these adjustments will guarantee that orders are validated for product configuration issues before they are submitted, but it will not ensure that any error message that is returned reflects the actual issue. The error message will state that the issue is because of low stock.
Enhance B2BOrdersController
The validateCart method in B2BOrdersController needs to be enhanced or replaced with a custom version. Cart validation is rudimentary and does not call the standard cart validation that is used in regular B2C scenarios. The new method should look like the following example:
protected void validateCart(final CartData cartData) throws InvalidCartException
{
final Errors errors = new BeanPropertyBindingResult(cartData, "sessionCart");
placeOrderCartValidator.validate(cartData, errors);
if (errors.hasErrors())
{
throw new WebserviceValidationException(errors);
}
try
{
final List<CartModificationData> modificationList = cartFacade.validateCurrentCartData();
if(CollectionUtils.isNotEmpty(modificationList))
{
final CartModificationDataList cartModificationDataList = new CartModificationDataList();
cartModificationDataList.setCartModificationList(modificationList);
throw new WebserviceValidationException(cartModificationDataList);
}
}
catch (final CommerceCartModificationException e)
{
throw new InvalidCartException(e);
}
}
Configuring SAP Commerce 2005 for Cart Validation
In your spring configuration, ensure that the commerceWebServicesCartService bean refers to cartValidationStrategy instead of cartValidationWithoutCartAlteringStrategy. This can be achieved, for example, in the spring.xml of a custom extension, as follows:
<alias name="customWebServicesCartService" alias="commerceWebServicesCartService"/> <bean id="customWebServicesCartService" parent="defaultCommerceCartService"> <property name="cartValidationStrategy" ref="cartValidationStrategy"/> <property name="productConfigurationStrategy" ref="productConfigurationStrategy"/> </bean>
Commerce Business Rules in Combination with SAP CPQ Configurable Products
Commerce business rules that are specific to product configuration (for example, hiding a certain value if another value is selected) are not supported for SAP CPQ configurable products.
Other Commerce business rules (such as those for promotions) still work and apply (such as, 2% off if the cart value exceeds $4,000 USD, for example).
Browser Refresh
When you refresh the browser, the product configuration is reset to the default configuration. You therefore have to reconfigure your products after reloading the page.
Cart Import and Export
Cart import and export is currently not supported with the CPQ Configurable Products integration.