Hybris Addons Document
Hybris Addons Document
Hybris Addons Document
When it comes to choose between add-on or extension, it becomes a tricky situation. Because we don’t
know actually, which one is preferable over another?
Extensions are basically a collection of related functionality, like we have promotion or a store front. It is
a larger artefact, in terms of complexity and purpose it solves.
On the other hand, add ons, as their name suggests, are introduced to garnish a existing functionality.
They are like toppings over your meal (extensions). For example, a Captcha addon.
When we need functionality, which is used across multiple store fronts, like captcha; we can go for a
addon. We need not to write a separate extension for that. But we can not go for an addon, if we need
multiple sites, for multiple country or language. In that case, we need to create separate extension for
that.
Suppose, you are working with a legacy system, where you cannot modify the code base, but you want
to modify the look and feel of it’s store front, in that case we can go for a add on.
Let’s check respective solutions. We will consider new feature “Shop the Look” to evaluate above
solution approach.
Retailer: Using this functionality, retailer can group products to create one sellable “Fashion Outfit”, for
example under shop the look one can club Shirt, Pant, Belt, Cap, Socks, sweater and sell it as one look.
Customer: Customer can view individual shop the look items and then they can purchase some or all
items from that look.
a. Create WCMS Component
Under this approach, we will create custom “ShopTheLook” component. This would bean
combination of a “ShowLook” button and modal displaying items configured as shop the look,
along with individual selection option.
Advantage
1. This solution is not dependent on the accelerator’s PDP structure or PDP logic.
2. This way in future, one need to make very minimal changes in the addon logic to make sure
addon is in sync with the accelerator code.
3. Being Data driven, it is very easy to disable component’s visibility on the accelerator pages.
-
-
-
-
-
-
-
-
-
-
-
- Create new mapping for the controller which we moved
- If there are any new configs or spring beans to be added, then add them in the xmlfile and
add them in the project.properties.template (of addon)
-
Advantage
1. Easier to implement.
Disadvantage
1. Since we are copying existing controllers, one needs to make sure addon codes gets
upgraded with Hybris version upgrades.
2. It may end up creating redundant code.
3. Even for the smallest change, one needs to copy more files.
1. Create new controller and mapping so that at the end of the controller, we can land on the
newly designed UI.
2. You may use existing ui logic to generate new UI, in that case, accelerator’s ui files (jsps, tags,
css, js) needs to be copied from accelerator to accleratoraddon/web/webroot…. And respective
folders.
How to add security related config files in the addon?
For very comple functionality, having it done via WCMs component way would e helpful.