Prestashop: Hook displayProductExtraContent does not trigger

Created on 2 Apr 2020  路  2Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

Hook displayProductExtraContent does not trigger.

Expected behavior

Product Page in Front Office should render added extra content into a new information tab.

Steps to Reproduce

  1. Create a new module

  2. Register hook on install()

public function install()
{
    $this->registerHook('displayProductExtraContent');
    return parent::install();
}
  1. Add hook function into module
public function hookDisplayProductExtraContent($params)
{
    $productExtraContent = new ProductExtraContent();
    $productExtraContent->setTitle($this->l('Additional info'));
    $productExtraContent->setContent("Hard coded additional info");
    return array($productExtraContent);
}
  1. Install module and look at product page - nothing shows

Additional information

  • PrestaShop version: 1.7.6.4
  • PHP version: 7.3
1.7.6.4 Bug FO No change required Products

All 2 comments

Hi @iibs,

I did not manage to reproduce the issue with PS1.7.6.4.
image
I used this module
mymodule.zip
PS: PrestaShop is not compatible with PHP 7.3, in fact, PrestaShop 1.7.0 to 1.7.3 is compatible with PHP 7.1 and PrestaShop 1.7.4 & 1.7.5 & PS1.7.6 are compatible with PHP 7.2.
For more details, you can follow this link: http://build.prestashop.com/news/prestashop-1-7-is-moving-to-symfony-3-4-and-php-5-6/
Next Major release PS1.7.7 will be compatible with PHP7.3.
You need to downgrade your PHP version.

Thanks!

Hi @khouloudbelguith,

I tried adding the module aswell, and that worked ok. Must have been something wrong with my syntax.

Thanks for help :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rGaillard picture rGaillard  路  3Comments

matks picture matks  路  3Comments

vincent-dp picture vincent-dp  路  3Comments

sandra2n picture sandra2n  路  3Comments

Fabuloops picture Fabuloops  路  3Comments