Creating AddOns
Learn how to create an empty AddOn, which is the first step in creating your own custom AddOns.
AddOns allow you to extend or override storefront extensions without having to modify the extensions directly. In addition to simply using the preconfigured AddOns provided by SAP, you can create your own custom AddOns. To do so you create a blank AddOn, install it, and then modify its logic.
To create a blank AddOn.
-
In the command prompt window or Terminal, navigate to the <HYBRIS_HOME>/hybris/bin/platform folder.
-
Run the appropriate command:
-
setantenv.bat on Microsoft Windows systems.
-
. ./setantenv.sh on Unix-related systems (such as Linux or Mac OS).
-
-
Run the following command to create a new extension named myextension. The new extension is created under <HYBRIS_HOME>/hybris/bin/custom.
ant extgen -Dinput.template=yaddon -Dinput.name=myextension -Dinput.package=com.myapp.myextension
-
Open the <HYBRIS_HOME>/hybris/config/localextensions.xml file and add your new extension:
<extension name="myextension" />