Like every ecommerce management platform, PrestaShop has endless functions that you can juggle within your online store. One of these things are called “hooks”. Today we will see what hooks are in PrestaShop, what types there are and where you can find them.
Contenido del artículo
What is a Hook in PrestaShop?
To know what a hook is, first we have to know its meaning. In English we are referring to hook. If you know how to make a sales funnel on your landing page, you will see that we are not referring to it exactly. A hook in PrestaShop is an anchor that attaches its own code to basic functions like creating a user account, showing some offers or featured products, etc
Depending on the hook that is going to be used, we will see that the functionality of the inserted code changes. That’s why it’s very important that you know the different codes you can use
- If we come across ‘actionAddCartRuleToCart’, we will use it to tell the “Additional Bonus Limit” module that the user has added a discount in the shopping cart.
- In the case of ‘displayRightColumn’, we’ll use it to anchor a column on the right, mainly to put a featured product, for example.
- With the code ‘displayMobileTopSiteMap’ you can display the mobile sitemap.
- We will use ‘actionProdcutListOverride’ to replace and fix a specific product or on the contrary, we will use ‘actionProductDelete’ to delete instead of replace. Finally, if we want to see the best selling products (by week) we’ll use ‘actionProductAdd’.
To be able to edit any hook, we have the “Live Edit” section, where you can see in which position are each of the activated modules, this way, you can delete, replace, add or change the hooks you want
Note that some of them are fully visible to the user, but others are not. You can see all this from this commented section
Types of Hooks
Depending on what your goal is, you have 2 types of hooks available to use them as you wish, the division is made between display hooks or action hooks
Observation or Display Hooks
PrestaShop display hooks are used, like any display, to show elements in a visual way, as is the example of the columns, category lists, best selling products, on sale or featured, etc..
These hooks are the most used in any ecommerce, after all they are calls to action that the customer will see and possibly you can give better user experience and therefore, sell more. That is why I recommend that you see all that you already have in your PrestaShop store and modify to your liking and objectives all these displays.
In an ecommerce is essential to have controlled these anchors, they will appear throughout your PrestaShop store and the more optimized you have them, the better.
These are the hooks that are in charge of the interaction with the client, that is, the ones that send an email to confirm that the account has been created correctly or that the discount has been applied with the marked percentage. These anchor points are only visible to you, and interact with the user automatically. For its proper functioning, we will make use of the “tiggers”, they are a kind of call to action designed specifically to tell the module to do what it has been asked to do
Where to find them?
If you are one of those who get lost navigating PrestaShop, we’ll tell you how to find them without getting lost and without touching anything strange
Entering the back, you will see the option to enter the world of “modules“, once you have seen it, enter and click on “module positions”, there you will see all the modules activated in your PrestaShop.
You will find the hooks above each block