Cancellations and Returns
Note: Spartacus 4.x is no longer maintained. Please upgrade to the latest version.
Note: Spartacus 4.x was tested with SAP Commerce Cloud versions 1905 to 2205. Spartacus 4.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.
Note: This feature is introduced with version 1.4 of the Spartacus libraries.
The Cancellations and Returns feature in Spartacus allows customers to request a complete or partial cancellation for an order that has been placed, or a return for an order that has already been received. This allows customers to bypass having to call a customer service agent to cancel or return an order that was placed.
The Cancellations and Returns feature in Spartacus requires SAP Commerce Cloud version 2005.0 or newer. The minimum version of 2005.0 is required because earlier versions do not include the endpoints related to this feature.
You should also consider installing Order Management in the back end. For more information, see Installing Order Management on the SAP Help Portal.
Enabling Cancellations and Returns in Spartacus
The Cancellations and Returns feature is disabled by default in Spartacus.
Since the feature is CMS-driven, the only way to enable it is through the CMS. The following procedure describes the changes you should make to the
spartacussampledata extension, or to your own, custom extension.
Note: All of the required CMS data is already included in the
Enabling Cancellations and Returns through the CMS
Import the following ImpEx to make the
INSERT_UPDATE CMSFlexComponent;$contentCV[unique=true];uid[unique=true];visible ;;AccountOrderDetailsActionsComponent;true
When this ImpEx is imported, the cancel or return action buttons are displayed on the Order Details page. The following is an example:
Add the All Orders and Returns tabs to the Order History page by importing the following ImpEx:
UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];cmsComponents(uid, $contentCV) ;;BodyContent-orders;AccountOrderHistoryTabContainer
By replacing the
AccountOrderHistoryTabContainercomponent in the
BodyContent-ordersslot, you can then see tabs in the Order History page, as follows:
These steps can also be done in Backoffice.
No special configuration is required.
No special extensibility is available for this feature.