Installation Steps

Here all the installation steps are given for Windows OS. Please follow below steps to install Hybris and create your first B2B and B2C site. Here I’m describing steps to install Hybris and customize B2C Accelerator to have B2B and B2C storefront.

  1. Get SAP CX Commerce suite available in zip archived file.
  2. Extract the zip archives into the directory of your choice. Please note that there should not be any space in your directory path and it should be short. Also, I’ll suggest to use 7z to extract the zip archives otherwise you may face long path error during extraction. Once zip file is extracted successfully, your directory should have following structure.

3. Open a command line and navigate to installer directory of your SAP Commerce instance using following command.

cd <HYBRIS_HOME_DIR>\installer

4. Build SAP Commerce using the cx recipe that sets up B2B and B2C storefront. You can find cx recipe under F:\sapcx\installer\recipes\ where F:\sapcx is the directory where I extracted the zip archive. Use following command in windows command line.

install.bat -r cx -A initAdminPassword=<your_password>

Here, replace <your_password> with the password that you want for admin user in Hybris.

5. Remove the yb2bacceleratorstorefront extension from the localextensions.xml file.

6. Delete the yb2bacceleratorstorefront extension directory under hybris/bin/custom.

7. Create your new project module. For this navigate to platform folder using following command on command line and and set ant variable.

cd <HYBRIS_HOME_DIR>\hybris\bin\platform

setantenv.bat

And, execute following command to create new project module cxtraining.

ant modulegen -Dinput.module=accelerator -Dinput.name=cxtraining -Dinput.package=de.hybris.cxtraining -Dinput.template=develop

Above mentioned command creates B2C modules and relevant extensions.

Add the new extensions to the /localextensions.xml file.

    <extension name='cxtrainingbackoffice'/>
    <extension name='cxtrainingcore'/>
    <extension name='cxtrainingfacades'/>
    <extension name='cxtrainingfulfilmentprocess'/>
    <extension name='cxtraininginitialdata'/>
    <extension name='cxtrainingstorefront'/>

Remove all the yaccelerator* extensions from the localextensions.xml file.

8. To add a B2B storefront, we need to set B2C storefront extension as a template, so that ant extgen uses the right package names for the item type dependencies. For this create a new file named extgen.properties under cxtrainingstorefront and add the following content to extgen.properties.

YEXTNAME_TOKEN=cxtrainingstorefront
YMODULE_TOKEN=cxtraining
YMODULE_PACKAGE_ROOT=storefront
YMODULE_CLASS_PREFIX=Storefront
YPACKAGE_TOKEN=de.hybris.cxtraining.cxtrainingstorefront
YMANAGER_TOKEN=CxTrainingStorefrontManager
YCLASSPREFIX_TOKEN=CxTrainingStorefront
YGENERATED_TOKEN=Generated

9. To create the B2B storefront extension for your module, go to the <HYBRIS_BIN_DIR>/platform directory and run
ant extgen command with the following options.

template: cxtrainingstorefront
name: cxtrainingb2bstorefront
package: de.hybris.cxtraining.cxtrainingb2bstorefront

The new extension is created under the /custom/cxtrainingb2bstorefront directory.

10. Add the new extension cxtrainingb2bstorefront to the /localextensions.xml file as below.

<extension name=’cxtrainingb2bstorefront’/>

12. Add the required dependencies using ant addoninstall command as shown below.

ant addoninstall -Daddonnames=”b2bacceleratoraddon” -DaddonStorefront.cxtrainingstorefront=”cxtrainingb2bstorefront”

ant addoninstall -Daddonnames=”commerceorgaddon” -DaddonStorefront.cxtrainingstorefront=”cxtrainingb2bstorefront”

13. Provide access to the powertools B2B storefront website.

a) Navigate to /custom/myprojectb2bstorefront.

b) Open the cxtrainingb2bstorefront extension’s project.properties file and remove all existing properties

starting with website.* and replace them with the following properties.

website.powertools.http=http://powertools.local:9001/cxtrainingb2bstorefront
website.powertools.https=https://powertools.local:9002/cxtrainingb2bstorefront
media.powertools.http=http://powertools.local:9001
media.powertools.https=https://powertools.local:9002

c) Change the site channel filters so that the extension uses the B2B filters by modifying the
myprojectb2bstorefront/web/webroot/WEB-INF/config/spring-filter-config.xml file and replacing this code snippet with the following one.

d) Navigate to the directory and remove all properties starting with website.* from
the local.properties file since they are already provided by your B2C and B2B storefront extensions.

15. Run ant clean all and ant initialize from the hybris/bin/platform directory.

16. Start Hybris instance using command hybrisserver.bat from command line.

17. Add the following to your host file.

127.0.0.1 electronics.local apparel-uk.local apparel-de.local powertools.local

You can access the B2C electronics store and apparel store as well as the B2B powertools store.

      You can access all the storefront with the following URLs:

            https://electronics.local:9002/cxtrainingstorefront/
			https://apparel-uk.local:9002/cxtrainingstorefront/
			https://apparel-de.local:9002/cxtrainingstorefront/
			https://powertools.local:9002/cxtrainingb2bstorefront/