Adding the module configuration

We will now add configuration options to our module. To do so, we just have to add the getContent function to our module. The return value of this function will be the content displayed on your screen.

In our case, we will write the following code:

public function getContent()
{
  return 'My name is Raphael, I am a tourist';
}

Note

The sentence returned is only an example (and a private joke from one of the PrestaShop core developers).

When the getContent function is placed in a module's class, PrestaShop automatically displays a Configure link in the back office. When the Configure link is clicked, this function is called and the return value is displayed.

So, if you refresh the modules list in the back office and your ...

Get PrestaShop Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.