There an example :
You can see a status there :
http://localhost/shop/ClicShoppingAdmin/index.php?A&Configuration\Modules&Configure
look the Module directory :Apps/Configuration/Modules/Module/ClicShoppingAdmin/Config/MO/Params
2/ Inside you can see a status files, copy and paste inside the same directory.
Change the filename : status_stats_products.php for example
You can have something like this :
<?php
/**
*
* @copyright 2008 - https://www.clicshopping.org
* @Brand : ClicShopping(Tm) at Inpi all right Reserved
* @Licence GPL 2 & MIT
* @licence MIT - Portion of osCommerce 2.4
* @Info : https://www.clicshopping.org/forum/trademark/
*
*/
namespace ClicShopping\Apps\Configuration\Modules\Module\ClicShoppingAdmin\Config\MO\Params;
use ClicShopping\OM\HTML;
class status_stats_products extends \ClicShopping\Apps\Configuration\Modules\Module\ClicShoppingAdmin\Config\ConfigParamAbstract {
public $default = 'True';
public $sort_order = 10;
protected function init() {
$this->title = $this->app->getDef('cfg_products_modules_status_stats_products_title');
$this->description = $this->app->getDef('cfg_products_modules_status_stats_products_description');
}
public function getInputField() {
$value = $this->getInputValue();
$input = HTML::radioField($this->key, 'True', $value, 'id="' . $this->key . '1" autocomplete="off"') . $this->app->getDef('cfg_products_modules_status_true') . ' ';
$input .= HTML::radioField($this->key, 'False', $value, 'id="' . $this->key . '2" autocomplete="off"') . $this->app->getDef('cfg_products_modules_status_false');
return $input;
}
}
2/ Now don't forget to reate the files inside your language directory
3/ Now actualize your page, a new configuration is added inside the configuration database : CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS
4/ now go in this directory : Includes/Module/Hooks/ClicShoppingAdmin/Dashboard
Edit your hooks stats_products .php for example and add after : function execute()
this :
if (!defined('CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS') || CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS == 'False') {
return false;
}
Now you can control your hook and display the information or not.