04.07.2014 Views

DEVELOPER’SGUIDE1.5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.belvg.com - Ecommerce Solutions and third party software integration<br />

Prestashop Modules<br />

Prestashop is an extensible system, which means that its functionality can be modified with the help<br />

of modules. Modules use hooks in order to alter the behavior of the system without intervening the<br />

core files. This process helps upgrade to the newer platform version easier and, moreover, it<br />

eliminates possible conflicts of modules that can change the behavior of the same function.<br />

Prestashop uses over 100 hooks.<br />

Hook: :exec( ‘displаyHeаder’) – this code initiates the execution of modules, registered in the hook<br />

“header”.<br />

The method module: :registerHооk( $hооk_nаme, $shоp_list = null) connects module to a hook<br />

The list of all hooks is available in the table “hook” :<br />

Let’s take a closer look at this table:<br />

• Id_hооk – auto-increment field;<br />

• Name – the name of the hook, can be used for registering a module;<br />

• Title – the title of the hook, understandable for a human;<br />

• Description – description of the hook;<br />

• Position – the sorting goes by this field. Also it can serve as a flag in the method Hook: :getHооks(<br />

$position = false);<br />

• Live_edit – bool. Is this hook usable with live edit;<br />

47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!