Prestashop - Module, SEO & URL and parameters?

Show Details

Solution 1: [1]

you need to hook to moduleRoutes,

1) in your module install method:

if (!parent::install()           
    || !$this->registerHook('moduleRoutes')
    || !$this->registerHook('displayFooter'))
       return false;

2) creating corresponding hook

public function hookmoduleRoutes($params) {
    $routes = array();
    $routes['module-examplemodule-handler'] = array(

    return $routes;

module may have multi routes. the convention is module-[MODULE_NAME]-[MODULE_CONTROLLER_NAME]

array explanation:

controller - handler (modules/examplemodule/controllers/front/handler.php)

rule - curly braces are params.. you can get an idea from

keywords - here you configure your params (curly braces) defined in the rule.

usage example:

in controller 'handler':

$short_code = Tools::getValue('short_code');

tested on prestashop 1.6



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

Source: Stack Overflow

Solution Credit
Solution 1 salexch