Blogs

Local system setup of SAP Commerce Hybris 2105 version with the use of Spartacus

Purpose of the article: To know the process of Hybris 2105 version setup in the local system

Intended Audience: E commerce

Tools and Technology: SAP Commerce Hybris, Spartacus

Keywords: Hybris, Spartacus

SAP Commerce Cloud 2105 Installation for Spartacus

Before I begin the blog, I would like to provide a brief overview of what Spartacus is and why we are using it.

Spartacus:

  • It is an angular JS application for storefront development, which interacts with the Hybris backend applications using REST API calls.
  • It is only for SAP Hybris Commerce / SAP Commerce Cloud.

Step 1: The creation of a new recipe

Create a folder called Hybris-2105-Spartacus in your D drive or any drive, which you want.

Installation links:

  • Download and unzip the following.
  1. SAP Commerce Cloud 2105 from this link
  2. Please refer to this link for Spartacus- sample data.
  • By clicking on the links, it will redirect to the login page. Provide S user id and password to log in.

Username: Your S user id

Password: Your password

  • After downloading the commerce2105 zip file, place that within the Hybris-2105-Spartacus folder and unzip it.

  • Do direct extract here for the cx folder. Then you can see like below, after extraction.

  • Now, copy the sample data from your downloads to the Hybris-2105-Spartacus folder and unzip it.

  • Move the custom properties file from location one to location two.

Location 1:

Location 2:

  • After moving, you can see like below:

  • Now rename the spartacussampledata.2105 to spartacussampledata

  • Now, go to the path: Hybris/bin.

  • Create a folder referred to as custom inside Hybris/bin.

  • Move the whole spartacussampledata to the custom folder.

  • Now, go to the installer/recipes folder and duplicate the cx folder.

  • And rename the duplicate cx folder, i.e., cx-Copy to cx-for-spa

  • Uncomment the extension name in the build file, which is a Gradle source file located in the cx-for-spa directory.
  • Save and close the file.

Step 2: New recipe building and initialization

  • Go to the below location and open the command prompt.

  • Set up a recipe using the below command

         install.bat –r cx-for-spa

Click on enter

  • After running the above command, you will get a build success.

  • Do setantenv.bat and then do ant clean all by going to platform path.
  • Now, do initialize the system by running the below command.

        install.bat -r cx-for-spa initialize

  • This process takes some time.
  • When initialization is complete, a build success message appears.

  • Now start the SAP Commerce Cloud by using the below command. It takes a few more minutes to start.

        install.bat –r cx-for-spa start

Once the server is up, check the below URLs.

https://localhost:9002

https://localhost:9002/backoffice

https://localhost:9002/yacceleratorstorefront/?site=electronics

  • In the back office, check to see if the Spartacus version of the sample data has been created.
  • Login to Backoffice – WCMS Website

Username: admin

Password: nimda (Letter N should be in small letter n).

Step 3: Import OCC credentials

  • Spartacus uses OCC REST API calls to urge info from and create changes to the backend. For this, the backend should be organized with bound credentials.
  • Open the admin page and head to Console – Impex Import.

  • Paste the following code and click on import content.
  • You can find the code at point three from this link.

  • Once the import is complete, use the curl command in a terminal or command prompt window to confirm that the OAuth client has been defined successfully.
  • Open a new command prompt and paste the below:
  • Using the client ID and password, you added to the back end, the curl program performs a POST request for an access token. The command should provide a result that looks like this:

  • So, we are done with installing the SAP Commerce Cloud by using Spartacus.
  • We will see building the Spartacus Storefront from libraries in the next blog.

Note:

If you face an error associated with the java version, change the java home in path variables to jdk11.

  • Now, do initialize the system by running the below command.

        install.bat -r cx-for-spa initialize

  • If you encounter a haul like a build failed exception for semantic analysis, as it appears in the below screen:

Comment out the build. Parallel=true line in the local. Properties file.

Path: D:\Hybris-2105-Spartacus\Hybris\config\local.properties

  • Run the initialize command.

Leave A Comment

Related Post

Making the Web Accessible

Purpose of the Article: How to create a custom Vue component and publish it as an npm package Intended Audience: Frontend Developers(Vuejs) Tools and Technology:

Read More »