GTM snippet

Monday, August 30, 2021

Setup Installation Guide for SAP CX 2011 with Spartacus

 Step 1: Download the latest SAP Commerce Cloud suite (in our case its 2011 version).

SAP CX suite

Step 2: Extract it in a folder.

Extracted

Step 3: Download spartacussampledata zip file.

Step 4: Move the file custom.properties from spartacussampledata/resources/installer/customconfig to hybris-commerce-suite-2011/installer/customconfig, set build.parallel= false.



Step 5: Create a custom folder inside bin (hybris/bin), copy spartacussampledata inside custom.

Spartacus Sample Data

Step 6: Go to installer/recipes, duplicate cx folder, rename duplicate folder as cx-for-spa.


Receipe

Step 7: Inside cx-for-spa open build.gradle uncomment extName 'spartacussampledata' save and close.



Step 8: Open cmd inside installer

Step 9: Install the recipe run cmd “install.bat –r cx-for-spa”

Step 10: Initialize the system run cmd  “install.bat -r cx-for-spa initialize” (this will take a while)


Init

Step 11: Strat the server run cmd “install.bat -r cx-for-spa start”


Sap Server Start

 

Step 12: Verify if things are working as expected or not hit the following urls

·       Display the Admin Console: https://localhost:9002


HAC

·       Display Backoffice: https://localhost:9002/backoffice


Backoffice

·       Display the Accelerator Electronics storefront: https://apparel-uk.local:9002/yacceleratorstorefront/


Storefront

 

Step 13: Import the below impex  for Auth client to accept OCC

INSERT_UPDATE OAuthClientDetails;clientId[unique=true]    ;resourceIds       ;scope        ;authorizedGrantTypes                                            ;authorities             ;clientSecret    ;registeredRedirectUri

                                ;client-side              ;hybris            ;basic        ;implicit,client_credentials                                  ;ROLE_CLIENT             ;secret          ;http://localhost:9001/authorizationserver/oauth2_implicit_callback;

                                ;mobile_android           ;hybris            ;basic        ;authorization_code,refresh_token,password,client_credentials    ;ROLE_CLIENT             ;secret          ;http://localhost:9001/authorizationserver/oauth2_callback;

 

######################### NOW WE NEED TO START SPARTACUS ###################

Front End Development Requirement:

·       Angular CLI: V 12.0.5 or later

·       Node js: V 12.x

·       Yarn: 1.15 or later

Assuming you have all requirements installed to check angular version run command “ng  - -version”

Angular CLI

Step 1: Create a new angular project, go to the location where you want to create open cmd and run this cmd “ng new <storename> --style=scss” (in our case storename is “electronicsspa”).



Step 2: Check whether you are able to see the sample store or not, go to the folder created above (in our case its electronicsspa) to do that run cmd “cd <foldername>”



Step 3: Start the server, run cmd “yarn start”






Step 4: After server is started hit “localhost:4200”, you see a sample angular site running

Step 5: To set Spartacus you must be in same folder i.e electronicsspa, run cmd “ng add @spartacus/schematics - -baseSite electronics-spa”, after running this command it will ask for several moduels just press enter or you can select your desired modules and press enter.

 

After above steps start you’re both servers

·       SAP Commerce suite (run command inside platform hybrisserver.bat)



·       Angular (ng serve inside your folder in our case it is electronicsspa)



Hit localhost:4200 and you will see something like this


Spartacus Storefront