Addons

  • AddOns are a type of extension that allow you to extend the functionality of storefront.
  • Its always a good practice to create a new Addon if any new functionality needs to be added in any project.
  • In addon you can access all the services , facades and populator from any extensions according to the use of your project.
  • Addon looks like Extensions by structure. The only way to indentify an addon by its extensionsinfo.xml. In this file its defined about  this whether it is addon or extension.

The purpose of an AddOn is to wrap an extension. By wrapping an extension, it provides additional features to an extension without needing to modify the code of the extension. An AddOn extends the Commerce Accelerator without touching its codebase. Technically, an AddOn is an extension but at build time its codebase is copied inside target extensions to become a part of the extension itself.

How to create an Addon:

Have a look this link:

  • Navigate to ${HYBRIS_HOME}/hybris/bin/platform and open a command prompt.
  • Run the appropriate command:
    • setantenv.bat on Microsoft Windows systems.
    • . ./setantenv.sh on Unix-related systems (such as Linux or Mac OS).
      Do not close the command prompt window.
  • In the command prompt, navigate to ${HYBRIS_HOME}/hybris/bin/platform/extgen .
  • Run the following command to create a new extension named myextension. The new extension is created under ${HYBRIS_HOME}/hybris/bin/custom .
    ant -Dinput.template=yaddon -Dinput.name=myextension -Dinput.package=com.myapp.myextension
  • Navigate to ${HYBRIS_HOME}/hybris/config/localextensions.xml file and add your new extension.
    <extension name="myextension" />

How to Install:

  • Navigate to {HYBRIS_HOME}\hybris\bin\platform directory and call the following ant command:
ant addoninstall -Daddonnames="financialcheckout" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"