'DisplayCarrierList Hook Alternative on Prestashop 1.7

I'm trying to create a shipping Module for 1.7, based on 1.6 module.

Everything looks right except the displayCarrierList Hook.

At displayCarrierList I tried to show a list with available relay points, it works perfectly on 1.6, but not in 1.7.

With some searches, I found that displayCarrierList hook is deprecated since 1.7.0 (Ref. https://github.com/PrestaShop/PrestaShop/blob/develop/classes/Hook.php#L93)

I need to show a list (select) with ajax calls at the order carrier choice step, any idea (without displayCarrierList) ?



Solution 1:[1]

You have just to use : DisplayCarrierExtraContent instead of the deprecated one displayCarrierList.

ref : https://www.waschier-design.at/tutorials/prestashop-1-7-globale-variablen-hooks/

Display additional content for a carrier (e.g pickup points) This hook calls only the module related to the carrier, in order to add options when needed

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AIT MANSOUR Mohamed