简体   繁体   中英

How to create Liferay hook in order to extend functionality of shopping cart portlet

Can anyone help me out on how to create a hook within Liferay for the shopping cart portlet? I would like to implement custom code at the point of a successful order. Any help is appreciated.

I've tried reading the documentation for overriding services: http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins

but I'm not sure what the service would be that I need to override.

Thanks!

The way to find it yourself is to use Liferay IDE and let the "New Hook" Wizard guide you. You can rely on Liferay's naming conventions. The shopping cart services all start with "Shopping", eg ShoppingOrderLocalService.

In this class, take a look at the methods in that class. Extend the Liferay implementation as the default implementation (best practice) and only implement the methods, where you want to add changed behaviour. You can call super to retain the old implementation (you typically want this) or just ignore that call if you completely change the behaviour.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM