Commerce

SAP Hybris – How to Customize B2C Accelerator

SAP Hybris Commerce provides the modulegen tool to generate sets of dependent extensions. The out-of-box B2C accelerator can be customized using the modulegen tool. The modulegen tool replaces the schema, package name and extension class prefixes across the set of generated extensions.

Customizing the B2C Accelerator

Here are the steps to customize the B2C accelerator using modulegen

  • Install the B2C accelerator provided out-of-box by SAP Hybris. Here is a blog post that can help you with the installation steps – https://labs.tadigital.com/index.php/2018/03/20/sap-hybris-how-to-install-b2c-accelerator/
  • Open a command prompt and navigate to <HYBRIS_HOME_DIR>/hybris/bin/platform
  • Set environment variables for ant by running setantenv.bat
  • Run the modulegen command by running ant modulegen -Dinput.module=accelerator -Dinput.name=TA Digital -Dinput.package=com.techaspect
  • In the above command
    • input.module value configures modulegen to use the accelerator module
    • input.name value is the prefix added to all the generated extensions
    • input.package value is the default Java package prefix to be used within the generated extensions
  • Once the modulegen command has completed running successfully, it would have created 7 new extensions within <HYBRIS_HOME_DIR>/hybris/bin/custom/TA Digital folder.
  • Here is a list of the 7 extensions that would have been created
    • techaspectcockpits
    • techaspectcore
    • techaspectfacades
    • techaspectfulfilmentprocess
    • techaspectinitialdata
    • techaspectstorefront
    • techaspecttest
  • Add all the generated extensions to localextensions.xml. The exact XML snippet to add is displayed on the console output.

  • Also, as instructed on the console output, remove the following extensions, if present, from localextensions.xml
    • yacceleratorcockpits
    • yacceleratorcore
    • yacceleratorfacades
    • yacceleratorfulfilmentprocess
    • yacceleratorinitialdata
    • yacceleratorstorefront
    • yacceleratortest
  • Build and initialize Hybris by running ant initialize. Depending on your machine, this could take anywhere between 10 – 40 minutes.
  • Start the server by running hybrisserver.bat
  • Once the server is up, you can access the newly created accelerator storefront by typing https://localhost:9002/techaspectstorefront/?site=electronics in the browser

About The Author

Leave a Reply

*