The following instructions describe how to install and configure SAP Commerce Cloud release 1905 for use with a Spartacus storefront. In these instructions, SAP Commerce Cloud is installed to your local computer, so localhost is used in the browser URLs.
The installation procedure includes steps for creating and using a b2c_for_spartacus recipe that makes use of the Spartacus Sample Data Addon, but you can use you own sample data or recipe as long as it includes the cmsoccaddon and ycommercewebservices extensions.
For more information about the changes that are implemented with the Spartacus Sample Data AddOn, see Spartacus Sample Data Addon.
Installing and configuring SAP Commerce Cloud for use with Spartacus involves the following procedures:
1. Setting Up SAP Commerce Cloud with the Spartacus Sample Data Addon
Some of the steps in this procedure are derived from the documentation for installing SAP Commerce Cloud using recipes. For more information, see Installing SAP Commerce Using Installer Recipes in the SAP Help Portal.
- Unzip the SAP Commerce Cloud zip archive.
Note: The name of the zip archive for release 1905 starts with CXCOMM1905#…. This folder will be referred to as CXCOMM* for the rest of these instructions.
- Download the Spartacus Sample Data AddOn.
- Unzip the spartacussampledataaddon.zip archive.
- Move the spartacussampledataaddon folder to hybris/bin/modules/b2c-accelerator.
Tip:
The spartacussampledataaddon folder can be stored anywhere in the modules folder. The b2c-accelerator folder is chosen as it contains other B2C sample data.
- In the installer/recipes folder, duplicate the b2c_acc_plus folder.
- Rename the copy of the b2c_acc_plus folder to b2c_for_spartacus.
- In b2c_for_spartacus, open build.gradle with a text editor.
- In the list of extensions, add the following:
extName 'spartacussampledataaddon'
You can put the new entry anywhere in the list of extensions, but it’s usually added near electronicsstore. The following is an example:
extName 'electronicsstore'
extName 'apparelstore'
extName 'spartacussampledataaddon'
Note:
If you do not need to install the Apparel store, you can remove extName ‘apparelstore‘ from the build.gradle file.
- In the addons { forStoreFronts(‘yacceleratorstorefront’) section of the build.gradle file, add ‘spartacussampledataaddon’ to the names list. The following is an example:
addons {
forStoreFronts('yacceleratorstorefront') {
names('spartacussampledataaddon', 'captchaaddon', ...
- Save the file.
- Open a terminal or command prompt window inside the CXCOMM*\installer folder.
- Set up the recipe using the following command:
./install.sh -r b2c_for_spartacus -A local_property:initialpassword.admin=nimda
Note:
nimda is a dummy password, you can change as per your choice
If you are using Windows, change ./install.sh to install.bat.
Note:
Starting with release 1905, SAP Commerce Cloud releases do not ship with a default admin password. You must specify a password when running recipe commands (as shown above), or you can specify a password in a file named custom.properties stored in CXCOMM*\installer\customconfig. See the Alternate Method for Setting the SAP Commerce Cloud Admin Password procedure below for information on setting a password in the custom.properties file.
- Initialize the system using the following command:
./install.sh -r b2c_for_spartacus -A local_property:initialpassword.admin=nimda initialize
Have a Coffee 🙂
Initialization of the b2c_for_spartacus recipe can take about 30 minutes. Sample data for this recipe includes Electronics, Apparel, and Electronics for Spartacus sample stores.
- Start SAP Commerce Cloud with the following command:
./install.sh -r b2c_for_spartacus -A local_property:initialpassword.admin=nimda start
- Verify that the system is working.
- Display the Admin Console: https://localhost:9002
- Display Backoffice: https://localhost:9002/backoffice
- Display the Accelerator Electronics storefront: https://localhost:9002/yacceleratorstorefront/?site=electronics
Note:
When setting up your Spartacus storefront, set the base site in app.module.ts to electronics-spa. The following is an example:
context: {
baseSite: [‘electronics-spa’]
},