Adding new hooks in PrestaShop helps reduce the use of overrides, simplify development, and ensure better compatibility with future updates. This approach enhances platform stability, scalability, and module reliability.
Benefits of Hooks
-
Ease of implementation: Simple to develop from both a technical and functional perspective.
-
Better extensibility: Reduces overrides for improved stability and scalability.
-
Fast deployment: Can be added in corrective versions for quick implementation.
Hook Placement
List of project functions on which we have identified overrides:
-
ProductCore.priceCalculation
-
CartControllerCore.processChangeProductInCart
-
HookCore.getHookModuleExecList
-
CartCore.getPackageShippingCost
-
PaymentModuleCore.validateOrder
-
CartCore.getOrderTotal
-
CartRuleCore.checkValidity
-
HTMLTemplateInvoiceCore.getContent
-
OrderControllerCore.initContent
-
CarrierCore.getAvailableCarrierList
-
ProductControllerCore.init
-
CartControllerCore.areProductsAvailable
-
CartControllerCore.processChangeProductInCart
-
CartCore.getOrderTotal
-
CategoryCore.getProducts
-
FrontControllerCore.init
-
LinkCore.getCatImageLink
-
AdminCustomersControllerCore.array_insert
-
CartControllerCore.init
-
AdminCustomersControllerCore.renderList
-
AdminOrdersControllerCore.__construct
-
Contactform.sendMessage
-
LinkCore.getManufacturerImageLink
-
ManufacturerCore.getProducts
-
ProductControllerCore.initContent
-
ProductCore.getNewProducts
-
SearchCore.find
-
CartCore.checkQuantities
-
FrontControllerCore.smartyOutputContent
Updated Documentation
A detailed guide is available to assist in adding new hooks.