Addon

What is Addons

An Addon is a special type of extension which extends functionality of the SAP commerce Accelerator. It allows us to add UI related changes without modifying the core code. Addons cannot run independently, and must be added to a base extension like yacceleratorstorefront.

Why to use Addons

  • Enhance existing functionality without modifying OOTB storefront code
  • We can easily install or uninstall addons
  • Reusable across multiple storefronts
  • We can safely upgrade our code and keep it modular.

Steps to create custom Addons

  1. Navigate to the platform folder in the command prompt and run command: setantenv.bat
  2. create extension using addon template
Extgen Command
  1. add the extension in localextensions.xml file
Add custom addon in localExtensions.xml file

<extension name='trainingaddon'/>
  1. do build. Command: ant all

Install Addon to specific storefront

To configure an Addons for a storefront we use ant addoninstall command.

We need to pass addons names and storefront names along with the above command. 

  1. addonnames : This is a mandatory parameter. If you want to include more than one addons, you must separate the names with commas.
  2. addonStorefront.<storefrontTemplateName> : This parameter specifies the storefront where you install addons. For multiple storefronts, separate the storefront names with commas.

Syntax:


ant addoninstall -Daddonnames="AddOn1,AddOn2" -DaddonStorefront.<storefrontTemplateName>="Storefront1,Storefront2"
Addon installation Command

Uninstall Addon from specific storefront

For removing an addons from the storefront we use ant addonuninstall command.

Same like addoninstall tool, we use addonnames and adonStorefront as a parameter in addonuninstall tool.

Syntax:


ant addonuninstall -Daddonnames="AddOn1,AddOn2" -DaddonStorefront.<storefrontTemplateName>="Storefront1,Storefront2"
Addon unistallation command

Leave a Reply

Your email address will not be published. Required fields are marked *