开发者

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

开发者 https://www.devze.com 2023-03-17 23:05 出处:网络
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.

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开发者_如何学Python 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", e.g. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消