Creating the module’s initial structure
Now that you have mastered the folder structure and the main class creation for a module, you can create the /modules/whcallback/
folder containing logo.png
, whcallback.php
, and index.php
.
As a reminder, feel free to go to the GitHub repository of this book at any time if you want to get the code for this module directly, via this URL: https://github.com/PacktPublishing/Practical-Module-Development-for-Prestashop-8/tree/main/Chapter%209/whcallback.
Let’s now create the main class for our module, as follows:
<?php if (!defined('_PS_VERSION_')) { exit; } class WHCallback extends Module { public function __construct() { //Required attributes $this->name = 'whcallback'; $this->tab = 'front_office_features'; ...