示例#1
0
 public function install()
 {
     if (!$this->installDB() || !parent::install()) {
         return false;
     }
     if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
         $valid_hooks = AdvancedSearchClass::$_valid_hooks_1_5;
     } else {
         $valid_hooks = AdvancedSearchClass::$_valid_hooks;
     }
     foreach ($valid_hooks as $k => $hook_name) {
         if (!$this->registerHook($hook_name)) {
             return false;
         }
     }
     if (!$this->registerHook('backOfficeHeader') || !$this->registerHook('header') || !$this->registerHook('updateProduct') || !$this->registerHook('addProduct') || !$this->registerHook('deleteProduct')) {
         return false;
     }
     if (version_compare(_PS_VERSION_, '1.5.0.0', '>=') && (!$this->registerHook('actionObjectSpecificPriceDeleteAfter') || !$this->registerHook('actionAdminProductsControllerSaveAfter'))) {
         return false;
     }
     $this->checkIfModuleIsUpdate(true, false);
     return true;
 }