Prestashop Modules (Part II)

Photo of Aliaksandr Simanchyk
Aliaksandr Simanchyk
Lead Full Stack Developer
Jun 21, 2013 1149 Updated: July 3, 2025 8:41
Prestashop Modules (Part II)

In this article we continue exploring Prestashop modules. You’ll find out more about the Module class, the most demanded modules and conflicts between extensions.

1.1   The Module class

Almost all modules are inherited from the class Module. These are the hooks which are called in a class:

  • Hook::exec(‘actionModuleInstallBefore’, array(‘object’ => $this)); //is called before installing a module
  • Hook::exec(‘actionModuleInstallAfter’, array(‘object’ => $this));  //is called after installing a module
  • Hook::exec(‘displayPayment’); //this hook is designed for payment modules.

 

1.2   The main modules

Let’s take a look at some of Prestаshоp modules. We will not describe them in details, since there are over 100 of them and with each new Prestashop version this number may change.

1modules2 850x81

Bank Wire -the module which allows your customers to pay by bank transfer.

2modules2 850x85

CMS Block – displays a block with articles.  An administrator can create blocks himself and then select the location either in the left-hand or right-hand hooks.

3modules2 850x81

This is one of the most important modules that can be considered as a hallmark of Prestаshоp. It uses the hooks Top and Header. The constant PS_BLOCK_CART_AJAX is responsible for its usage. The function of the class cart- >getPrоduсts( ); is responsible for getting products into the shopping cart.

4modules2 850x85

This module is used to pay a courier. It uses the following hooks: payment, paymentReturn

5modules2 850x82

This one uses the hooks: leftColumn, footer, header

6modules2 850x84

7modules2 850x91

The module which displays the block with a choice of currency.

8modules2 850x85

This module is provided for free, but since the version 2.1.1 it is a paid option.

9modules2 850x84

10modules2 850x414

This module allows you to add content on your homepage.

Andrey_Dubina
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey

11modules2 850x83

This one adds a slider on your homepage.

12modules21 850x81

13modules21 850x83

This module displays a block with a language selection on the front-end.

14modules21 850x86

15modules22

This module outputs the block which allows users to quickly filter out products in a category.

16modules21 850x84

This allows users to leave comments to products. A website administrator can set the product evaluation criteria, enable or disable comment moderation.

$categoryProducts = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. * / – the place in the module code, which gets products from a category.

17modules21 850x80

Displays goods from the main category, to which a product is assigned, on a product page.

18modules21 850x83

The module allows you to search for items in a catalog. In the default theme it is displayed at the top of the page. It can either search for pages using аjаx or show the so-called instant search results (read our article on how Prestashop search works here).

19modules21 850x87

20modules21 850x373

The block with a horizontal menu.

21modules21 850x83

This module will help protect your unique products images from being copied. It adds a “watermark” with your store’s logo on all images.

22modules2 850x85

The block with a wishlist. It is a useful module, which for some reason is disabled by default. In general, many modules are turned off by default after the installation.

 

1.3  Conflicts between modules

Conflicts between modules are not a rare thing. Our support team is constantly customizing our modules with modules of other companies as we frequently deal with the stores which already have certain methods rewritten. The most common issue is the inability to install a module, interrupted by the error message “The method Boo in the class Foo is already overriden”. This means that your system already has a method rewritten, which has been changed in our module too. Here we have described in details the function addOverride which returns this error.

Another common problem is that modules are not compatible with the standard module layered navigation block. Sometimes you need to re-initialize the modules that use fаnсybоx or other js-libraries.

Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

1 comment

  1. Hello,

    Have you had the oportunity to test the hook actionModuleInstallBefore , actionModuleInstallAfter

    I guess not or you would you hook these are unusable

Post a new comment