B2B Unit-Level Orders
The unit-level orders functionality is meant for use as part of the B2B Commerce Organization. It allows authorized buyers to access information on orders placed by peers in the same root unit and its subunits down the organizational hierarchy.
For more information, see B2B Unit-Level Orders.
Architecture
The following section presents feature highlights from the perspective of headless architecture:
-
Authorized B2B agents can access two custom content pages for the feature, both having pre-configured routes to history and details views.
-
An agent with the B2B Admin role can access the Rights and Roles panel to manage the View Unit-Level Orders right.
-
Calls to back-end SAP Commerce Cloud are made through OCC REST APIs to endpoints in the @spartacus/organization library.
-
By default, OAuth 2.0 protocol handles secure authentication.
-
Access to the database resources is read-only. Agents fetch information on nonpersonal orders of peers, including buyer details and B2B unit name, with two GET methods.
The following Technical Architecture Modeling (TAM) diagram shows the details of access and communication for the unit-level orders feature with the back-end SAP Commerce Cloud instance:
Requirements
-
SAP Commerce Cloud version 2211 or higher
-
The installation of the B2B Accelerator Module, specifically the following extensions:
-
b2bacceleratorfacades Extension
-
b2bocc Extension
-
b2bwebservicescommons Extension
-
-
The installation of the B2B Commerce Module, specifically the following extensions:
-
b2bcommerce Extension
-
b2bcommercefacades Extension
-
-
The installation of the @spartacus/organization library, version 5.1, or higher, and its dependencies
For more information, see Installing Additional Composable Storefront Libraries.
CMS Components
Unit-level orders are CMS-driven and consist of various CMS components that make up the two page views of the feature.
-
UnitLevelOrderHistoryComponent
The Unit-Level Orders Details page consists of the following CMS components:
-
UnitLevelOrderDetailsOverviewComponent
-
UnitLevelOrderDetailsItemsComponent
-
ExportOrderEntriesComponent
-
UnitLevelOrderDetailsTotalsComponent
You can configure unit-level orders by using SmartEdit to display the unit-level orders components in the composable storefront, or you can manually add them to content slots using ImpEx.
If you're using the Spartacus Sample Data Extension, the unit-level orders components are already enabled. However, if you decide not to use the spartacussampledata extension, you can enable the unit-level CMS components through ImpEx.
Adding CMS Components Manually
You can add various unit-level orders CMS components to the composable storefront using ImpEx.
Context
$contentCatalog=powertools-spaContentCatalog $contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
Procedure
- Set up the Unit-Level Orders link with the following series of ImpEx import operations:
- Create the Unit-Level Orders History page with the following series of ImpEx import operations:
- Create the Unit-Level Orders Details page with the following series of ImpEx import operations:
Enabling Unit-Level Orders
By default, unit-level orders are disabled in the back end, through the use of a feature flag, for all customers who install SAP Commerce Cloud manually, that is, without an installation script.
To enable the feature, change the value of the b2bcommerce.unitlevelorders.enabled property in hybris/bin/modules/b2b-commerce/b2bcommerce/project.properties to “true”.
By default, unit-level orders are enabled in the back end, through the use of a feature flag, for all customers who install SAP Commerce Cloud based on the cx_old_occ recipe. Here, the b2bcommerce.unitlevelorders.enabled property in installer/recipes/cx_old_occ/build.gradle is set to “true”. The same setting applies to all available recipes.
Disabling Unit-Level Orders
To disable unit-level orders, you can revert the value of b2bcommerce.unitlevelorders.enabled to “false”.
Configuring
No special configuration is required.
Extending
No special extensibility is available for this feature.
Limitations
-
In both Units and Users workflows, a B2B Administrator can only assign the right to view unit-level orders to individuals, not user groups. This is in line with a general rule that an admin of the composable storefront manages roles and rights only on the user level. Even if authorized Backoffice users can assign rights to user groups so that all group members inherit the respective permissions, such assignments aren't supported by and shown in the composable storefront. Therefore, to benefit from unit-level orders, the right must always be assigned on a user-by-user basis.
-
The unit-level order details view doesn't include a dedicated component for Customer Approval Details because pertinent information is fetched through a different endpoint.