[*] PROJECT : New Module API (part 1)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9790 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fSerny
2011-11-02 10:49:01 +00:00
parent 953cb8b872
commit 0ba4fe9c7e
53 changed files with 640 additions and 339 deletions
+2 -2
View File
@@ -244,7 +244,7 @@ if (Tools::isSubmit('ajaxCategoriesPositions'))
{ {
if (isset($position) && $category->updatePosition($way, $position)) if (isset($position) && $category->updatePosition($way, $position))
{ {
Module::hookExec('categoryUpdate'); Hook::exec('categoryUpdate');
die(true); die(true);
} }
else else
@@ -605,7 +605,7 @@ if (Tools::isSubmit('getHookableModuleList'))
include_once(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php'); include_once(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php');
$mod = new $module['name'](); $mod = new $module['name']();
if ($mod->isHookableOn($hook_name)) if ($mod->isHookableOn($hook_name))
$hookableModulesList[] = array('id' => (int)$mod->id, 'name' => $mod->displayName, 'display' => Module::hookExec($hook_name, array(), (int)$mod->id)); $hookableModulesList[] = array('id' => (int)$mod->id, 'name' => $mod->displayName, 'display' => Hook::exec($hook_name, array(), (int)$mod->id));
} }
} }
die(Tools::jsonEncode($hookableModulesList)); die(Tools::jsonEncode($hookableModulesList));
+1 -1
View File
@@ -27,7 +27,7 @@
echo ' </div> echo ' </div>
</div> </div>
'.Module::hookExec('backOfficeFooter').' '.Hook::exec('backOfficeFooter').'
<div id="footer"> <div id="footer">
<div style="float:left;margin-left:10px;padding-top:6px"> <div style="float:left;margin-left:10px;padding-top:6px">
<a href="http://www.prestashop.com/" target="_blank" style="font-weight:700;color:#666666">PrestaShop&trade; '._PS_VERSION_.'</a><br /> <a href="http://www.prestashop.com/" target="_blank" style="font-weight:700;color:#666666">PrestaShop&trade; '._PS_VERSION_.'</a><br />
+2 -2
View File
@@ -54,7 +54,7 @@ echo '
<script type="text/javascript" src="'._PS_JS_DIR_.'tools.js"></script> <script type="text/javascript" src="'._PS_JS_DIR_.'tools.js"></script>
<script type="text/javascript" src="'._PS_JS_DIR_.'ajax.js"></script> <script type="text/javascript" src="'._PS_JS_DIR_.'ajax.js"></script>
<link rel="shortcut icon" href="'._PS_IMG_.'favicon.ico" /> <link rel="shortcut icon" href="'._PS_IMG_.'favicon.ico" />
'.Module::hookExec('backOfficeHeader').' '.Hook::exec('backOfficeHeader').'
<!--[if IE]> <!--[if IE]>
<link type="text/css" rel="stylesheet" href="'._PS_CSS_DIR_.'admin-ie.css" /> <link type="text/css" rel="stylesheet" href="'._PS_CSS_DIR_.'admin-ie.css" />
<![endif]--> <![endif]-->
@@ -272,7 +272,7 @@ echo ' </select>
echo '<div id="header_shoplist">'.translate('Select your shop:').' '.generateShopList().'</div>'; echo '<div id="header_shoplist">'.translate('Select your shop:').' '.generateShopList().'</div>';
echo '<div class="flatclear">&nbsp;</div>'; echo '<div class="flatclear">&nbsp;</div>';
echo Module::hookExec('backOfficeTop'); echo Hook::exec('backOfficeTop');
echo '<ul id="menu">'; echo '<ul id="menu">';
if (empty($tab)) if (empty($tab))
+2 -2
View File
@@ -211,7 +211,7 @@ class AdminFeatures extends AdminTab
echo '</div>'; echo '</div>';
} }
echo ' echo '
'.Module::hookExec('featureForm', array('id_feature' => $obj->id)).' '.Hook::exec('featureForm', array('id_feature' => $obj->id)).'
<div class="margin-form"> <div class="margin-form">
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" /> <input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
</div> </div>
@@ -236,7 +236,7 @@ class AdminFeatures extends AdminTab
if (Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('submitDelfeature_value')) if (Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('submitDelfeature_value'))
$this->adminFeaturesValues->postProcess($this->token); $this->adminFeaturesValues->postProcess($this->token);
Module::hookExec('postProcessFeature', Hook::exec('postProcessFeature',
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeature to stop saving process array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeature to stop saving process
if(Tools::getValue('submitDel'.$this->table)) if(Tools::getValue('submitDel'.$this->table))
+3 -3
View File
@@ -84,7 +84,7 @@ class AdminFeaturesValues extends AdminTab
echo ' echo '
</select><sup> *</sup> </select><sup> *</sup>
</div> </div>
'.Module::hookExec('featureValueForm', array('id_feature_value' => $obj->id)).' '.Hook::exec('featureValueForm', array('id_feature_value' => $obj->id)).'
<div class="margin-form"> <div class="margin-form">
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" /> <input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
</div> </div>
@@ -98,7 +98,7 @@ class AdminFeaturesValues extends AdminTab
*/ */
public function postProcess($token = NULL) public function postProcess($token = NULL)
{ {
Module::hookExec('postProcessFeatureValue', Hook::exec('postProcessFeatureValue',
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process
if(Tools::getValue('submitDel'.$this->table)) if(Tools::getValue('submitDel'.$this->table))
@@ -121,4 +121,4 @@ class AdminFeaturesValues extends AdminTab
else else
parent::postProcess(); parent::postProcess();
} }
} }
+2 -2
View File
@@ -485,7 +485,7 @@ class AdminImport extends AdminTab
foreach ($imagesTypes AS $k => $imageType) foreach ($imagesTypes AS $k => $imageType)
imageResize($tmpfile, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']); imageResize($tmpfile, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
if (in_array($imageType['id_image_type'], $watermark_types)) if (in_array($imageType['id_image_type'], $watermark_types))
Module::hookExec('watermark', array('id_image' => $id_image, 'id_product' => $id_entity)); Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_entity));
} }
else else
{ {
@@ -1864,4 +1864,4 @@ class AdminImport extends AdminTab
{ {
$this->_warnings[] = $product_name.(isset($product_id) ? ' (ID '.$product_id.')' : '').' '.Tools::displayError($message); $this->_warnings[] = $product_name.(isset($product_id) ? ' (ID '.$product_id.')' : '').' '.Tools::displayError($message);
} }
} }
+1 -1
View File
@@ -225,7 +225,7 @@ abstract class AdminStatsTab extends AdminPreferences
if (!isset($moduleInstance)) if (!isset($moduleInstance))
$moduleInstance = Module::getInstanceByName($moduleName); $moduleInstance = Module::getInstanceByName($moduleName);
if ($moduleInstance AND $moduleInstance->active) if ($moduleInstance AND $moduleInstance->active)
echo Module::hookExec('AdminStatsModules', NULL, $moduleInstance->id); echo Hook::exec('AdminStatsModules', NULL, $moduleInstance->id);
else else
echo $this->l('Module not found', 'AdminStatsTab'); echo $this->l('Module not found', 'AdminStatsTab');
} }
+3 -3
View File
@@ -1050,8 +1050,8 @@ class AdminControllerCore extends Controller
'pic_dir' => _THEME_PROD_PIC_DIR_ 'pic_dir' => _THEME_PROD_PIC_DIR_
)); ));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_HEADER' => Module::hookExec('backOfficeHeader'), 'HOOK_HEADER' => Hook::exec('backOfficeHeader'),
'HOOK_TOP' => Module::hookExec('backOfficeTop'), 'HOOK_TOP' => Hook::exec('backOfficeTop'),
)); ));
} }
@@ -1132,7 +1132,7 @@ class AdminControllerCore extends Controller
)); ));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_FOOTER' => Module::hookExec('backOfficeFooter'), 'HOOK_FOOTER' => Hook::exec('backOfficeFooter'),
)); ));
} }
+3 -3
View File
@@ -110,7 +110,7 @@ class AttributeCore extends ObjectModel
$return = parent::delete(); $return = parent::delete();
if ($return) if ($return)
Module::hookExec('afterDeleteAttribute', array('id_attribute' => $this->id)); Hook::exec('afterDeleteAttribute', array('id_attribute' => $this->id));
return $return; return $return;
} }
@@ -118,7 +118,7 @@ class AttributeCore extends ObjectModel
{ {
$return = parent::update($null_values); $return = parent::update($null_values);
if ($return) if ($return)
Module::hookExec('afterSaveAttribute', array('id_attribute' => $this->id)); Hook::exec('afterSaveAttribute', array('id_attribute' => $this->id));
return $return; return $return;
} }
@@ -129,7 +129,7 @@ class AttributeCore extends ObjectModel
$return = parent::add($autodate, $null_values); $return = parent::add($autodate, $null_values);
if ($return) if ($return)
Module::hookExec('afterSaveAttribute', array('id_attribute' => $this->id)); Hook::exec('afterSaveAttribute', array('id_attribute' => $this->id));
return $return; return $return;
} }
+3 -3
View File
@@ -76,14 +76,14 @@ class AttributeGroupCore extends ObjectModel
$this->position = AttributeGroup::getHigherPosition() + 1; $this->position = AttributeGroup::getHigherPosition() + 1;
$return = parent::add($autodate, true); $return = parent::add($autodate, true);
Module::hookExec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id)); Hook::exec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id));
return $return; return $return;
} }
public function update($nullValues = false) public function update($nullValues = false)
{ {
$return = parent::update($nullValues); $return = parent::update($nullValues);
Module::hookExec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id)); Hook::exec('afterSaveAttributeGroup', array('id_attribute_group' => $this->id));
return $return; return $return;
} }
@@ -149,7 +149,7 @@ class AttributeGroupCore extends ObjectModel
return false; return false;
$return = parent::delete(); $return = parent::delete();
if ($return) if ($return)
Module::hookExec('afterDeleteAttributeGroup', array('id_attribute_group' => $this->id)); Hook::exec('afterDeleteAttributeGroup', array('id_attribute_group' => $this->id));
return $return; return $return;
} }
+2 -2
View File
@@ -167,7 +167,7 @@ class CartCore extends ObjectModel
public function add($autodate = true, $nullValues = false) public function add($autodate = true, $nullValues = false)
{ {
$return = parent::add($autodate); $return = parent::add($autodate);
Module::hookExec('cart'); Hook::exec('cart');
return $return; return $return;
} }
@@ -179,7 +179,7 @@ class CartCore extends ObjectModel
unset(self::$_totalWeight[$this->id]); unset(self::$_totalWeight[$this->id]);
$this->_products = NULL; $this->_products = NULL;
$return = parent::update(); $return = parent::update();
Module::hookExec('cart'); Hook::exec('cart');
return $return; return $return;
} }
+5 -5
View File
@@ -183,7 +183,7 @@ class CategoryCore extends ObjectModel
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree) if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
self::regenerateEntireNtree(); self::regenerateEntireNtree();
$this->updateGroup($this->groupBox); $this->updateGroup($this->groupBox);
Module::hookExec('categoryAddition', array('category' => $this)); Hook::exec('categoryAddition', array('category' => $this));
return $ret; return $ret;
} }
@@ -208,7 +208,7 @@ class CategoryCore extends ObjectModel
self::regenerateEntireNtree(); self::regenerateEntireNtree();
$this->recalculateLevelDepth($this->id_category); $this->recalculateLevelDepth($this->id_category);
} }
Module::hookExec('categoryUpdate', array('category' => $this)); Hook::exec('categoryUpdate', array('category' => $this));
return $ret; return $ret;
} }
@@ -218,7 +218,7 @@ class CategoryCore extends ObjectModel
public function toggleStatus() public function toggleStatus()
{ {
$result = parent::toggleStatus(); $result = parent::toggleStatus();
Module::hookExec('categoryUpdate'); Hook::exec('categoryUpdate');
return $result; return $result;
} }
@@ -347,7 +347,7 @@ class CategoryCore extends ObjectModel
if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree) if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)
self::regenerateEntireNtree(); self::regenerateEntireNtree();
Module::hookExec('categoryDeletion', array('category' => $this)); Hook::exec('categoryDeletion', array('category' => $this));
/* Delete Categories in GroupReduction */ /* Delete Categories in GroupReduction */
foreach ($to_delete as $category) foreach ($to_delete as $category)
@@ -1055,7 +1055,7 @@ class CategoryCore extends ObjectModel
SET `position` = '.(int)$position.' SET `position` = '.(int)$position.'
WHERE `id_parent` = '.(int)$moved_category['id_parent'].' WHERE `id_parent` = '.(int)$moved_category['id_parent'].'
AND `id_category`='.(int)$moved_category['id_category'])); AND `id_category`='.(int)$moved_category['id_category']));
Module::hookExec('categoryUpdate'); Hook::exec('categoryUpdate');
return $result; return $result;
} }
+3 -3
View File
@@ -113,7 +113,7 @@ class FeatureCore extends ObjectModel
public function add($autodate = true, $nullValues = false) public function add($autodate = true, $nullValues = false)
{ {
$return = parent::add($autodate, true); $return = parent::add($autodate, true);
Module::hookExec('afterSaveFeature', array('id_feature' => $this->id)); Hook::exec('afterSaveFeature', array('id_feature' => $this->id));
return $return; return $return;
} }
@@ -127,7 +127,7 @@ class FeatureCore extends ObjectModel
$return = parent::delete(); $return = parent::delete();
if($return) if($return)
Module::hookExec('afterDeleteFeature', array('id_feature' => $this->id)); Hook::exec('afterDeleteFeature', array('id_feature' => $this->id));
/* Reinitializing position */ /* Reinitializing position */
$this->cleanPositions(); $this->cleanPositions();
@@ -155,7 +155,7 @@ class FeatureCore extends ObjectModel
Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'. Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'.
pSQL($this->identifier).'` = '.(int)$this->id.' AND `id_lang` = '.(int)$field['id_lang']); pSQL($this->identifier).'` = '.(int)$this->id.' AND `id_lang` = '.(int)$field['id_lang']);
} }
Module::hookExec('afterSaveFeature', array('id_feature' => $this->id)); Hook::exec('afterSaveFeature', array('id_feature' => $this->id));
return $result; return $result;
} }
+4 -4
View File
@@ -171,7 +171,7 @@ class FeatureValueCore extends ObjectModel
{ {
$return = parent::add($autodate, $nullValues); $return = parent::add($autodate, $nullValues);
if ($return) if ($return)
Module::hookExec('afterSaveFeatureValue', array('id_feature_value' => $this->id)); Hook::exec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
return $return; return $return;
} }
@@ -182,7 +182,7 @@ class FeatureValueCore extends ObjectModel
$return = parent::delete(); $return = parent::delete();
if ($return) if ($return)
Module::hookExec('afterDeleteFeatureValue', array('id_feature_value' => $this->id)); Hook::exec('afterDeleteFeatureValue', array('id_feature_value' => $this->id));
return $return; return $return;
} }
@@ -190,7 +190,7 @@ class FeatureValueCore extends ObjectModel
{ {
$return = parent::update($nullValues); $return = parent::update($nullValues);
if ($return) if ($return)
Module::hookExec('afterSaveFeatureValue', array('id_feature_value' => $this->id)); Hook::exec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
return $return; return $return;
} }
} }
+1 -1
View File
@@ -91,7 +91,7 @@ class qqUploadedFileXhr
return array('error' => Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name'])); return array('error' => Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']));
} }
unlink($tmpName); unlink($tmpName);
Module::hookExec('watermark', array('id_image' => $id_image, 'id_product' => $id_product)); Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_product));
$lang = Context::getContext()->employee->id_lang; $lang = Context::getContext()->employee->id_lang;
foreach (Language::getLanguages(false) as $l) foreach (Language::getLanguages(false) as $l)
+5 -5
View File
@@ -543,9 +543,9 @@ class FrontControllerCore extends Controller
'content_only' => (int)Tools::getValue('content_only') 'content_only' => (int)Tools::getValue('content_only')
)); ));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_HEADER' => Hook::exec('header'),
'HOOK_TOP' => Module::hookExec('top'), 'HOOK_TOP' => Hook::exec('top'),
'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn') 'HOOK_LEFT_COLUMN' => Hook::exec('leftColumn')
)); ));
if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache')) if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache'))
@@ -564,8 +564,8 @@ class FrontControllerCore extends Controller
public function initFooter() public function initFooter()
{ {
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn', array('cart' => $this->context->cart)), 'HOOK_RIGHT_COLUMN' => Hook::exec('rightColumn', array('cart' => $this->context->cart)),
'HOOK_FOOTER' => Module::hookExec('footer'), 'HOOK_FOOTER' => Hook::exec('footer'),
)); ));
} }
+175 -22
View File
@@ -29,6 +29,7 @@ class HookCore extends ObjectModel
{ {
/** @var string Name */ /** @var string Name */
public $name; public $name;
public $title;
protected $fieldsRequired = array('name'); protected $fieldsRequired = array('name');
protected $fieldsSize = array('name' => 32); protected $fieldsSize = array('name' => 32);
@@ -37,12 +38,16 @@ class HookCore extends ObjectModel
protected $table = 'hook'; protected $table = 'hook';
protected $identifier = 'id_hook'; protected $identifier = 'id_hook';
protected static $_hookModulesCache;
static $preloadModulesFromHooks = null; static $preloadModulesFromHooks = null;
static $preloadHookAlias = null;
public function getFields() public function getFields()
{ {
$this->validateFields(); $this->validateFields();
$fields['name'] = pSQL($this->name); $fields['name'] = pSQL($this->name);
$fields['title'] = pSQL($this->title);
return $fields; return $fields;
} }
@@ -95,6 +100,15 @@ class HookCore extends ObjectModel
'.($position ? 'WHERE h.`position` = 1' : '')); '.($position ? 'WHERE h.`position` = 1' : ''));
} }
static public function preloadHookAlias()
{
if (!is_null(self::$preloadHookAlias))
return ;
$hookAliasList = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'hook_alias`');
foreach ($hookAliasList as $ha)
self::$preloadHookAlias[$ha['alias']] = $ha['name'];
}
static public function preloadModulesFromHooks() static public function preloadModulesFromHooks()
{ {
if (!is_null(self::$preloadModulesFromHooks)) if (!is_null(self::$preloadModulesFromHooks))
@@ -138,23 +152,144 @@ class HookCore extends ObjectModel
return $list; return $list;
} }
static public function newOrder($cart, $order, $customer, $currency, $orderStatus)
/**
* Execute modules for specified hook
*
* @param string $hook_name Hook Name
* @param array $hookArgs Parameters for the functions
* @return string modules output
*/
public static function exec($hook_name, $hookArgs = array(), $id_module = NULL)
{ {
return Module::hookExec('newOrder', array( $context = Context::getContext();
'cart' => $cart, if ((!empty($id_module) && !Validate::isUnsignedId($id_module)) || !Validate::isHookName($hook_name))
'order' => $order, die(Tools::displayError());
'customer' => $customer,
'currency' => $currency, self::preloadHookAlias();
'orderStatus' => $orderStatus)); $hook_name_retro = strtolower($hook_name);
if (isset(self::$preloadHookAlias[$hook_name]))
$hook_name = self::$preloadHookAlias[$hook_name];
$live_edit = false;
if (!isset($hookArgs['cookie']) || !$hookArgs['cookie'])
$hookArgs['cookie'] = $context->cookie;
if (!isset($hookArgs['cart']) || !$hookArgs['cart'])
$hookArgs['cart'] = $context->cart;
$hook_name = strtolower($hook_name);
if (!isset(self::$_hookModulesCache))
{
$db = Db::getInstance(_PS_USE_SQL_SLAVE_);
$list = $context->shop->getListOfID();
if (isset($context->customer) && $context->customer->isLogged())
$groups = $context->customer->getGroups();
$sql = 'SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`
FROM `'._DB_PREFIX_.'module` m
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm
ON hm.`id_module` = m.`id_module`';
if (isset($context->customer) && $context->customer->isLogged())
$sql .= '
LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr
ON gmr.`id_module` = m.`id_module`';
$sql .= '
LEFT JOIN `'._DB_PREFIX_.'hook` h
ON hm.`id_hook` = h.`id_hook`
WHERE (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).'
AND hm.id_shop IN('.implode(', ', $list).')';
if (isset($context->customer) && $context->customer->isLogged())
$sql .= '
AND (gmr.`authorized` = 1 AND gmr.`id_group` IN('.implode(', ', $groups).'))';
$sql .= '
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`';
$result = $db->executeS($sql, false);
self::$_hookModulesCache = array();
if ($result)
while ($row = $db->nextRow())
{
$row['hook'] = strtolower($row['hook']);
if (!isset(self::$_hookModulesCache[$row['hook']]))
self::$_hookModulesCache[$row['hook']] = array();
self::$_hookModulesCache[$row['hook']][] = array('id_hook' => $row['id_hook'], 'module' => $row['module'], 'id_module' => $row['id_module'], 'live_edit' => $row['live_edit']);
}
}
if (!isset(self::$_hookModulesCache[$hook_name]) && !isset(self::$_hookModulesCache[$hook_name_retro]))
return;
$hookModulesCache = array();
if (isset(self::$_hookModulesCache[$hook_name]))
$hookModulesCache = self::$_hookModulesCache[$hook_name];
if (isset(self::$_hookModulesCache[$hook_name_retro]))
$hookModulesCache = self::$_hookModulesCache[$hook_name_retro];
$altern = 0;
$output = '';
foreach ($hookModulesCache as $array)
{
if ($id_module && $id_module != $array['id_module'])
continue;
if (!($moduleInstance = Module::getInstanceByName($array['module'])))
continue;
$exceptions = $moduleInstance->getExceptions($array['id_hook']);
if (in_array(Dispatcher::getInstance()->getController(), $exceptions))
continue;
if (isset($context->employee) && !$moduleInstance->getPermission('view', $context->employee))
continue;
$hook_callable = is_callable(array($moduleInstance, 'hook'.$hook_name));
$hook_retro_callable = is_callable(array($moduleInstance, 'hook'.$hook_name_retro));
if (($hook_callable || $hook_retro_callable) && Module::preCall($moduleInstance->name))
{
$hookArgs['altern'] = ++$altern;
if ($hook_callable)
$display = call_user_func(array($moduleInstance, 'hook'.$hook_name), $hookArgs);
else if ($hook_retro_callable)
$display = call_user_func(array($moduleInstance, 'hook'.$hook_name_retro), $hookArgs);
if ($array['live_edit'] && ((Tools::isSubmit('live_edit') && Tools::getValue('ad') && (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_)))))
{
$live_edit = true;
$output .= '<script type="text/javascript"> modules_list.push(\''.$moduleInstance->name.'\');</script>
<div id="hook_'.$array['id_hook'].'_module_'.$moduleInstance->id.'_moduleName_'.$moduleInstance->name.'"
class="dndModule" style="border: 1px dotted red;'.(!strlen($display) ? 'height:50px;' : '').'">
<span><img src="'.$moduleInstance->_path.'/logo.gif">'
.$moduleInstance->displayName.'<span style="float:right">
<a href="#" id="'.$array['id_hook'].'_'.$moduleInstance->id.'" class="moveModule">
<img src="'._PS_ADMIN_IMG_.'arrow_out.png"></a>
<a href="#" id="'.$array['id_hook'].'_'.$moduleInstance->id.'" class="unregisterHook">
<img src="'._PS_ADMIN_IMG_.'delete.gif"></span></a>
</span>'.$display.'</div>';
}
else
$output .= $display;
}
}
return ($live_edit ? '<script type="text/javascript">hooks_list.push(\''.$hook_name.'\'); </script><!--<div id="add_'.$hook_name.'" class="add_module_live_edit">
<a class="exclusive" href="#">Add a module</a></div>--><div id="'.$hook_name.'" class="dndHook" style="min-height:50px">' : '').$output.($live_edit ? '</div>' : '');
} }
static public function updateOrderStatus($newOrderStatusId, $id_order) static public function updateOrderStatus($newOrderStatusId, $id_order)
{ {
$order = new Order((int)($id_order)); $order = new Order((int)($id_order));
$newOS = new OrderState((int)($newOrderStatusId), $order->id_lang); $newOS = new OrderState((int)($newOrderStatusId), $order->id_lang);
$return = ((int)($newOS->id) == Configuration::get('PS_OS_PAYMENT')) ? Module::hookExec('paymentConfirm', array('id_order' => (int)($order->id))) : true; $return = ((int)($newOS->id) == Configuration::get('PS_OS_PAYMENT')) ? Hook::exec('paymentConfirm', array('id_order' => (int)($order->id))) : true;
$return = Module::hookExec('updateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id))) AND $return; $return = Hook::exec('updateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id))) AND $return;
return $return; return $return;
} }
@@ -162,7 +297,7 @@ class HookCore extends ObjectModel
{ {
$order = new Order((int)($id_order)); $order = new Order((int)($id_order));
$newOS = new OrderState((int)($newOrderStatusId), $order->id_lang); $newOS = new OrderState((int)($newOrderStatusId), $order->id_lang);
$return = Module::hookExec('postUpdateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id))); $return = Hook::exec('postUpdateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id)));
return $return; return $return;
} }
@@ -172,39 +307,57 @@ class HookCore extends ObjectModel
* @param Product * @param Product
* @param Order * @param Order
*/ */
static public function newOrder($cart, $order, $customer, $currency, $orderStatus)
{
Tools::displayAsDeprecated();
return Hook::exec('newOrder', array(
'cart' => $cart,
'order' => $order,
'customer' => $customer,
'currency' => $currency,
'orderStatus' => $orderStatus));
}
static public function updateQuantity($product, $order = null) static public function updateQuantity($product, $order = null)
{ {
return Module::hookExec('updateQuantity', array('product' => $product, 'order' => $order)); Tools::displayAsDeprecated();
return Hook::exec('updateQuantity', array('product' => $product, 'order' => $order));
} }
static public function productFooter($product, $category) static public function productFooter($product, $category)
{ {
return Module::hookExec('productFooter', array('product' => $product, 'category' => $category)); Tools::displayAsDeprecated();
return Hook::exec('productFooter', array('product' => $product, 'category' => $category));
} }
static public function productOutOfStock($product) static public function productOutOfStock($product)
{ {
return Module::hookExec('productOutOfStock', array('product' => $product)); Tools::displayAsDeprecated();
return Hook::exec('productOutOfStock', array('product' => $product));
} }
static public function addProduct($product) static public function addProduct($product)
{ {
return Module::hookExec('addProduct', array('product' => $product)); Tools::displayAsDeprecated();
return Hook::exec('addProduct', array('product' => $product));
} }
static public function updateProduct($product) static public function updateProduct($product)
{ {
return Module::hookExec('updateProduct', array('product' => $product)); Tools::displayAsDeprecated();
return Hook::exec('updateProduct', array('product' => $product));
} }
static public function deleteProduct($product) static public function deleteProduct($product)
{ {
return Module::hookExec('deleteProduct', array('product' => $product)); Tools::displayAsDeprecated();
return Hook::exec('deleteProduct', array('product' => $product));
} }
static public function updateProductAttribute($id_product_attribute) static public function updateProductAttribute($id_product_attribute)
{ {
return Module::hookExec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute)); Tools::displayAsDeprecated();
return Hook::exec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute));
} }
static public function orderConfirmation($id_order) static public function orderConfirmation($id_order)
@@ -222,7 +375,7 @@ class HookCore extends ObjectModel
$params['objOrder'] = $order; $params['objOrder'] = $order;
$params['currencyObj'] = $currency; $params['currencyObj'] = $currency;
return Module::hookExec('orderConfirmation', $params); return Hook::exec('orderConfirmation', $params);
} }
} }
return false; return false;
@@ -243,7 +396,7 @@ class HookCore extends ObjectModel
$params['objOrder'] = $order; $params['objOrder'] = $order;
$params['currencyObj'] = $currency; $params['currencyObj'] = $currency;
return Module::hookExec('paymentReturn', $params, (int)($id_module)); return Hook::exec('paymentReturn', $params, (int)($id_module));
} }
} }
return false; return false;
@@ -253,7 +406,7 @@ class HookCore extends ObjectModel
{ {
if (!is_object($pdf) OR !Validate::isUnsignedId($id_order)) if (!is_object($pdf) OR !Validate::isUnsignedId($id_order))
return false; return false;
return Module::hookExec('PDFInvoice', array('pdf' => $pdf, 'id_order' => $id_order)); return Hook::exec('PDFInvoice', array('pdf' => $pdf, 'id_order' => $id_order));
} }
static public function backBeforePayment($module) static public function backBeforePayment($module)
@@ -261,14 +414,14 @@ class HookCore extends ObjectModel
$params['module'] = strval($module); $params['module'] = strval($module);
if (!$params['module']) if (!$params['module'])
return false; return false;
return Module::hookExec('backBeforePayment', $params); return Hook::exec('backBeforePayment', $params);
} }
static public function updateCarrier($id_carrier, $carrier) static public function updateCarrier($id_carrier, $carrier)
{ {
if (!Validate::isUnsignedId($id_carrier) OR !is_object($carrier)) if (!Validate::isUnsignedId($id_carrier) OR !is_object($carrier))
return false; return false;
return Module::hookExec('updateCarrier', array('id_carrier' => $id_carrier, 'carrier' => $carrier)); return Hook::exec('updateCarrier', array('id_carrier' => $id_carrier, 'carrier' => $carrier));
} }
} }
+35 -108
View File
@@ -78,7 +78,6 @@ abstract class ModuleCore
public $limited_countries = array(); public $limited_countries = array();
protected static $modulesCache; protected static $modulesCache;
protected static $_hookModulesCache;
protected static $_INSTANCE = array(); protected static $_INSTANCE = array();
@@ -343,13 +342,26 @@ abstract class ModuleCore
if (!isset($this->id) OR !is_numeric($this->id)) if (!isset($this->id) OR !is_numeric($this->id))
return false; return false;
// Retrocompatibility
Hook::preloadHookAlias();
if (isset(Hook::$preloadHookAlias[$hook_name]))
$hook_name = Hook::$preloadHookAlias[$hook_name];
// Get hook id // Get hook id
$sql = 'SELECT `id_hook` $sql = 'SELECT `id_hook`
FROM `'._DB_PREFIX_.'hook` FROM `'._DB_PREFIX_.'hook`
WHERE `name` = \''.pSQL($hook_name).'\''; WHERE `name` = \''.pSQL($hook_name).'\'';
$hookID = Db::getInstance()->getValue($sql); $hookID = Db::getInstance()->getValue($sql);
if (!$hookID) if (!$hookID)
return false; {
$newHook = new Hook();
$newHook->name = pSQL($hook_name);
$newHook->title = pSQL($hook_name);
$newHook->add();
$hookID = $newHook->id;
if (!$hookID)
return false;
}
if (is_null($shopList)) if (is_null($shopList))
$shopList = Shop::getShops(true, null, true); $shopList = Shop::getShops(true, null, true);
@@ -402,6 +414,11 @@ abstract class ModuleCore
// Get hook id if a name is given as argument // Get hook id if a name is given as argument
if (!is_numeric($hook_id)) if (!is_numeric($hook_id))
{ {
// Retrocompatibility
Hook::preloadHookAlias();
if (isset(Hook::$preloadHookAlias[$hook_id]))
$hook_id = Hook::$preloadHookAlias[$hook_id];
$sql = 'SELECT `id_hook` $sql = 'SELECT `id_hook`
FROM `'._DB_PREFIX_.'hook` FROM `'._DB_PREFIX_.'hook`
WHERE `name` = \''.pSQL($hook_id).'\''; WHERE `name` = \''.pSQL($hook_id).'\'';
@@ -775,118 +792,24 @@ abstract class ModuleCore
*/ */
public static function hookExec($hook_name, $hookArgs = array(), $id_module = NULL) public static function hookExec($hook_name, $hookArgs = array(), $id_module = NULL)
{ {
$context = Context::getContext(); Tools::displayAsDeprecated();
if ((!empty($id_module) && !Validate::isUnsignedId($id_module)) || !Validate::isHookName($hook_name)) return Hook::exec($hook_name, $hookArgs, $id_module);
die(Tools::displayError());
$live_edit = false;
if (!isset($hookArgs['cookie']) || !$hookArgs['cookie'])
$hookArgs['cookie'] = $context->cookie;
if (!isset($hookArgs['cart']) || !$hookArgs['cart'])
$hookArgs['cart'] = $context->cart;
$hook_name = strtolower($hook_name);
if (!isset(self::$_hookModulesCache))
{
$db = Db::getInstance(_PS_USE_SQL_SLAVE_);
$list = $context->shop->getListOfID();
if (isset($context->customer) && $context->customer->isLogged())
$groups = $context->customer->getGroups();
$sql = 'SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`
FROM `'._DB_PREFIX_.'module` m
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm
ON hm.`id_module` = m.`id_module`';
if (isset($context->customer) && $context->customer->isLogged())
$sql .= '
LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr
ON gmr.`id_module` = m.`id_module`';
$sql .= '
LEFT JOIN `'._DB_PREFIX_.'hook` h
ON hm.`id_hook` = h.`id_hook`
WHERE (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).'
AND hm.id_shop IN('.implode(', ', $list).')';
if (isset($context->customer) && $context->customer->isLogged())
$sql .= '
AND (gmr.`authorized` = 1 AND gmr.`id_group` IN('.implode(', ', $groups).'))';
$sql .= '
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`';
$result = $db->executeS($sql, false);
self::$_hookModulesCache = array();
if ($result)
while ($row = $db->nextRow())
{
$row['hook'] = strtolower($row['hook']);
if (!isset(self::$_hookModulesCache[$row['hook']]))
self::$_hookModulesCache[$row['hook']] = array();
self::$_hookModulesCache[$row['hook']][] = array('id_hook' => $row['id_hook'], 'module' => $row['module'], 'id_module' => $row['id_module'], 'live_edit' => $row['live_edit']);
}
}
if (!isset(self::$_hookModulesCache[$hook_name]))
return;
$altern = 0;
$output = '';
foreach (self::$_hookModulesCache[$hook_name] as $array)
{
if ($id_module && $id_module != $array['id_module'])
continue;
if (!($moduleInstance = Module::getInstanceByName($array['module'])))
continue;
$exceptions = $moduleInstance->getExceptions($array['id_hook']);
if (in_array(Dispatcher::getInstance()->getController(), $exceptions))
continue;
if (isset($context->employee) && !$moduleInstance->getPermission('view', $context->employee))
continue;
if (is_callable(array($moduleInstance, 'hook'.$hook_name)))
{
$hookArgs['altern'] = ++$altern;
$display = call_user_func(array($moduleInstance, 'hook'.$hook_name), $hookArgs);
if ($array['live_edit'] && ((Tools::isSubmit('live_edit') && Tools::getValue('ad') && (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_)))))
{
$live_edit = true;
$output .= '<script type="text/javascript"> modules_list.push(\''.$moduleInstance->name.'\');</script>
<div id="hook_'.$array['id_hook'].'_module_'.$moduleInstance->id.'_moduleName_'.$moduleInstance->name.'"
class="dndModule" style="border: 1px dotted red;'.(!strlen($display) ? 'height:50px;' : '').'">
<span><img src="'.$moduleInstance->_path.'/logo.gif">'
.$moduleInstance->displayName.'<span style="float:right">
<a href="#" id="'.$array['id_hook'].'_'.$moduleInstance->id.'" class="moveModule">
<img src="'._PS_ADMIN_IMG_.'arrow_out.png"></a>
<a href="#" id="'.$array['id_hook'].'_'.$moduleInstance->id.'" class="unregisterHook">
<img src="'._PS_ADMIN_IMG_.'delete.gif"></span></a>
</span>'.$display.'</div>';
}
else
$output .= $display;
}
}
return ($live_edit ? '<script type="text/javascript">hooks_list.push(\''.$hook_name.'\'); </script><!--<div id="add_'.$hook_name.'" class="add_module_live_edit">
<a class="exclusive" href="#">Add a module</a></div>--><div id="'.$hook_name.'" class="dndHook" style="min-height:50px">' : '').$output.($live_edit ? '</div>' : '');
} }
public static function hookExecPayment() public static function hookExecPayment()
{ {
$context = Context::getContext(); Tools::displayAsDeprecated();
$hookArgs = array('cookie' => $context->cookie, 'cart' => $context->cart); return Hook::exec('payment');
$output = '';
$result = self::getPaymentModules();
if ($result)
foreach ($result AS $module)
if (($moduleInstance = Module::getInstanceByName($module['name'])) AND is_callable(array($moduleInstance, 'hookpayment')))
if (!$moduleInstance->currencies OR ($moduleInstance->currencies AND sizeof(Currency::checkPaymentCurrencies($moduleInstance->id))))
$output .= call_user_func(array($moduleInstance, 'hookpayment'), $hookArgs);
return $output;
} }
public static function preCall($moduleName)
{
return true;
}
/** /**
* Returns the list of the payment module associated to the current customer * Returns the list of the payment module associated to the current customer
* @see PaymentModule::getInstalledPaymentModules() if you don't care about the context * @see PaymentModule::getInstalledPaymentModules() if you don't care about the context
@@ -901,6 +824,10 @@ abstract class ModuleCore
if (isset($context->customer)) if (isset($context->customer))
$groups = $context->customer->getGroups(); $groups = $context->customer->getGroups();
$hookPayment = 'Payment';
if (Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'displayPayment\''))
$hookPayment = 'displayPayment';
$list = Context::getContext()->shop->getListOfID(); $list = Context::getContext()->shop->getListOfID();
$sql = 'SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position` $sql = 'SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position`
FROM `'._DB_PREFIX_.'module_country` mc FROM `'._DB_PREFIX_.'module_country` mc
@@ -913,7 +840,7 @@ abstract class ModuleCore
$sql .= ' $sql .= '
LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr ON gmr.`id_module` = m.`id_module`'; LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr ON gmr.`id_module` = m.`id_module`';
$sql .= ' $sql .= '
WHERE h.`name` = \'payment\' WHERE h.`name` = \''.$hookPayment.'\'
AND mc.id_country = '.(int)($billing->id_country).' AND mc.id_country = '.(int)($billing->id_country).'
AND mc.id_shop = '.(int)$context->shop->getID(true).' AND mc.id_shop = '.(int)$context->shop->getID(true).'
AND mg.id_shop = '.(int)$context->shop->getID(true).' AND mg.id_shop = '.(int)$context->shop->getID(true).'
+21
View File
@@ -205,6 +205,9 @@ abstract class ObjectModelCore
if (!Validate::isTableOrIdentifier($this->table)) if (!Validate::isTableOrIdentifier($this->table))
die(Tools::displayError('not table or identifier : ').$this->table); die(Tools::displayError('not table or identifier : ').$this->table);
/* Hook */
Hook::exec('actionObject'.get_class($this).'AddBefore');
/* Automatically fill dates */ /* Automatically fill dates */
if ($autodate AND key_exists('date_add', $this)) if ($autodate AND key_exists('date_add', $this))
$this->date_add = date('Y-m-d H:i:s'); $this->date_add = date('Y-m-d H:i:s');
@@ -258,6 +261,10 @@ abstract class ObjectModelCore
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'group_shop') if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'group_shop')
$result &= $this->associateTo(Context::getContext()->shop->getGroupID(), 'group_shop'); $result &= $this->associateTo(Context::getContext()->shop->getGroupID(), 'group_shop');
} }
/* Hook */
Hook::exec('actionObject'.get_class($this).'AddAfter');
return $result; return $result;
} }
@@ -271,6 +278,9 @@ abstract class ObjectModelCore
if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))
die(Tools::displayError()); die(Tools::displayError());
/* Hook */
Hook::exec('actionObject'.get_class($this).'UpdateBefore');
$this->clearCache(); $this->clearCache();
/* Automatically fill dates */ /* Automatically fill dates */
if (key_exists('date_upd', $this)) if (key_exists('date_upd', $this))
@@ -326,6 +336,10 @@ abstract class ObjectModelCore
} }
} }
} }
/* Hook */
Hook::exec('actionObject'.get_class($this).'UpdateAfter');
return $result; return $result;
} }
@@ -339,6 +353,9 @@ abstract class ObjectModelCore
if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))
die(Tools::displayError()); die(Tools::displayError());
/* Hook */
Hook::exec('actionObject'.get_class($this).'DeleteBefore');
$this->clearCache(); $this->clearCache();
/* Database deletion */ /* Database deletion */
@@ -349,6 +366,10 @@ abstract class ObjectModelCore
/* Database deletion for multilingual fields related to the object */ /* Database deletion for multilingual fields related to the object */
if (method_exists($this, 'getTranslationsFieldsChild')) if (method_exists($this, 'getTranslationsFieldsChild'))
Db::getInstance()->execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); Db::getInstance()->execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id));
/* Hook */
Hook::exec('actionObject'.get_class($this).'DeleteAfter');
return $result; return $result;
} }
+1 -1
View File
@@ -65,7 +65,7 @@ class PaymentCCCore extends ObjectModel
{ {
if (parent::add($autodate, $nullValues)) if (parent::add($autodate, $nullValues))
{ {
Module::hookExec('paymentCCAdded', array('paymentCC' => $this)); Hook::exec('paymentCCAdded', array('paymentCC' => $this));
return true; return true;
} }
return false; return false;
+17 -3
View File
@@ -293,11 +293,11 @@ abstract class PaymentModuleCore extends Module
$message->update(); $message->update();
} }
// Hook new order // Hook validate order
$orderStatus = new OrderState((int)$id_order_state, (int)$order->id_lang); $orderStatus = new OrderState((int)$id_order_state, (int)$order->id_lang);
if (Validate::isLoadedObject($orderStatus)) if (Validate::isLoadedObject($orderStatus))
{ {
Hook::newOrder($cart, $order, $customer, $currency, $orderStatus); Hook::exec('newOrder', array('cart' => $cart, 'order' => $order, 'customer' => $customer, 'currency' => $currency, 'orderStatus' => $orderStatus));
foreach ($cart->getProducts() AS $product) foreach ($cart->getProducts() AS $product)
if ($orderStatus->logable) if ($orderStatus->logable)
ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']); ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']);
@@ -513,7 +513,7 @@ abstract class PaymentModuleCore extends Module
$modules = PaymentModuleCore::getInstalledPaymentModules(); $modules = PaymentModuleCore::getInstalledPaymentModules();
foreach ($modules as $module) foreach ($modules as $module)
$id_module_list[] = $module['id_module']; $id_module_list[] = $module['id_module'];
} }
foreach ($id_module_list as $id_module) foreach ($id_module_list as $id_module)
$values .= '('.(int)$id_module.','.(int)$id_currency.'),'; $values .= '('.(int)$id_module.','.(int)$id_currency.'),';
@@ -547,5 +547,19 @@ abstract class PaymentModuleCore extends Module
AND m.`active` = 1 AND m.`active` = 1
'); ');
} }
public static function preCall($moduleName)
{
if (!parent::preCall($moduleName))
return false;
if (($moduleInstance = Module::getInstanceByName($moduleName)))
if (!$moduleInstance->currencies OR ($moduleInstance->currencies AND sizeof(Currency::checkPaymentCurrencies($moduleInstance->id))))
return true;
return false;
}
} }
+7 -7
View File
@@ -391,14 +391,14 @@ class ProductCore extends ObjectModel
{ {
if (!parent::add($autodate, $nullValues)) if (!parent::add($autodate, $nullValues))
return false; return false;
Module::hookExec('afterSaveProduct', array('id_product' => $this->id)); Hook::exec('afterSaveProduct', array('id_product' => $this->id));
return true; return true;
} }
public function update($nullValues = false) public function update($nullValues = false)
{ {
$return = parent::update($nullValues); $return = parent::update($nullValues);
Module::hookExec('afterSaveProduct', array('id_product' => $this->id)); Hook::exec('afterSaveProduct', array('id_product' => $this->id));
return $return; return $return;
} }
@@ -590,7 +590,7 @@ class ProductCore extends ObjectModel
if (!GroupReduction::deleteProductReduction($this->id)) if (!GroupReduction::deleteProductReduction($this->id))
return false; return false;
Hook::deleteProduct($this); Hook::exec('deleteProduct', array('product' => $this));
if (!parent::delete() OR if (!parent::delete() OR
!$this->deleteCategories(true) OR !$this->deleteCategories(true) OR
!$this->deleteImages() OR !$this->deleteImages() OR
@@ -1061,7 +1061,7 @@ class ProductCore extends ObjectModel
if (!Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', $data, 'UPDATE', '`id_product_attribute` = '.(int)($id_product_attribute)) OR !Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'product_attribute_image` WHERE `id_product_attribute` = '.(int)($id_product_attribute))) if (!Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', $data, 'UPDATE', '`id_product_attribute` = '.(int)($id_product_attribute)) OR !Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'product_attribute_image` WHERE `id_product_attribute` = '.(int)($id_product_attribute)))
return false; return false;
if ($quantity) if ($quantity)
Hook::updateProductAttribute($id_product_attribute); Hook::exec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute));
Product::updateDefaultAttribute($this->id); Product::updateDefaultAttribute($this->id);
if (empty($id_images)) if (empty($id_images))
return true; return true;
@@ -1094,7 +1094,7 @@ class ProductCore extends ObjectModel
*/ */
public function deleteProductAttributes() public function deleteProductAttributes()
{ {
Module::hookExec('deleteProductAttribute', array('id_product_attribute' => 0, 'id_product' => $this->id, 'deleteAllAttributes' => true)); Hook::exec('deleteProductAttribute', array('id_product_attribute' => 0, 'id_product' => $this->id, 'deleteAllAttributes' => true));
$result = Db::getInstance()->execute(' $result = Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` DELETE FROM `'._DB_PREFIX_.'product_attribute_combination`
@@ -1239,7 +1239,7 @@ class ProductCore extends ObjectModel
if (!$this->id || !$id_product_attribute OR !is_numeric($id_product_attribute)) if (!$this->id || !$id_product_attribute OR !is_numeric($id_product_attribute))
return false; return false;
Module::hookExec('deleteProductAttribute', array('id_product_attribute' => $id_product_attribute, 'id_product' => $this->id, 'deleteAllAttributes' => false)); Hook::exec('deleteProductAttribute', array('id_product_attribute' => $id_product_attribute, 'id_product' => $this->id, 'deleteAllAttributes' => false));
$sql = 'DELETE FROM `'._DB_PREFIX_.'product_attribute` $sql = 'DELETE FROM `'._DB_PREFIX_.'product_attribute`
WHERE `id_product_attribute` = '.$id_product_attribute.' WHERE `id_product_attribute` = '.$id_product_attribute.'
@@ -3257,7 +3257,7 @@ class ProductCore extends ObjectModel
if ($stockMvt->add()) if ($stockMvt->add())
{ {
$this->quantity = $this->getStock(); $this->quantity = $this->getStock();
Hook::updateQuantity($this, null); Hook::exec('updateQuantity', array('product' => $this, 'order' => null));
return true; return true;
} }
return false; return false;
+1 -1
View File
@@ -1526,7 +1526,7 @@ FileETag INode MTime Size
fwrite($write_fd, "\n\n".trim($specific_after)); fwrite($write_fd, "\n\n".trim($specific_after));
fclose($write_fd); fclose($write_fd);
Module::hookExec('afterCreateHtaccess'); Hook::exec('afterCreateHtaccess');
return true; return true;
} }
@@ -517,7 +517,7 @@ class AdminCustomersControllerCore extends AdminController
'messages' => $messages, 'messages' => $messages,
// Display hook specified to this page : AdminCustomers // Display hook specified to this page : AdminCustomers
'hook' => Module::hookExec('adminCustomers', array('id_customer' => $customer->id)), 'hook' => Hook::exec('adminCustomers', array('id_customer' => $customer->id)),
// Groups // Groups
'groups' => $groups, 'groups' => $groups,
+1 -1
View File
@@ -554,7 +554,7 @@ class AdminHomeControllerCore extends AdminController
$tpl_vars['last_orders'] =$this->getLastOrders(); $tpl_vars['last_orders'] =$this->getLastOrders();
$tpl_vars['tips_optimization'] = $this->_displayOptimizationTips(); $tpl_vars['tips_optimization'] = $this->_displayOptimizationTips();
$HOOK_BACKOFFICEHOME = Module::hookExec('backOfficeHome'); $HOOK_BACKOFFICEHOME = Hook::exec('backOfficeHome');
$tpl_vars['HOOK_BACKOFFICEHOME'] = $HOOK_BACKOFFICEHOME; $tpl_vars['HOOK_BACKOFFICEHOME'] = $HOOK_BACKOFFICEHOME;
$smarty->assign($tpl_vars); $smarty->assign($tpl_vars);
+1 -1
View File
@@ -206,7 +206,7 @@ class AdminMetaControllerCore extends AdminController
else else
$_POST['url_rewrite_'.$lang['id_lang']] = Tools::getValue('url_rewrite_1'); $_POST['url_rewrite_'.$lang['id_lang']] = Tools::getValue('url_rewrite_1');
} }
Module::hookExec('afterSaveAdminMeta'); Hook::exec('afterSaveAdminMeta');
} }
return parent::postProcess(); return parent::postProcess();
+5 -5
View File
@@ -364,14 +364,14 @@ class AdminOrdersControllerCore extends AdminController
$updProduct['stock_quantity'] = (int)($newProductQty); $updProduct['stock_quantity'] = (int)($newProductQty);
$product['stock_quantity'] = $updProduct['stock_quantity']; $product['stock_quantity'] = $updProduct['stock_quantity'];
} }
Hook::updateQuantity($product, $order); Hook::exec('updateQuantity', array('product' => $product, 'order' => $order));
} }
} }
// Delete product // Delete product
if (!$order->deleteProduct($order, $orderDetail, $qtyCancelProduct)) if (!$order->deleteProduct($order, $orderDetail, $qtyCancelProduct))
$this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>'; $this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>';
Module::hookExec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail)); Hook::exec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail));
} }
if (!sizeof($this->_errors) AND $customizationList) if (!sizeof($this->_errors) AND $customizationList)
foreach ($customizationList AS $id_customization => $id_order_detail) foreach ($customizationList AS $id_customization => $id_order_detail)
@@ -397,7 +397,7 @@ class AdminOrdersControllerCore extends AdminController
$this->_errors[] = Tools::displayError('Cannot generate credit slip'); $this->_errors[] = Tools::displayError('Cannot generate credit slip');
else else
{ {
Module::hookExec('orderSlip', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list)); Hook::exec('orderSlip', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list));
@Mail::Send((int)$order->id_lang, 'credit_slip', Mail::l('New credit slip regarding your order', $order->id_lang), @Mail::Send((int)$order->id_lang, 'credit_slip', Mail::l('New credit slip regarding your order', $order->id_lang),
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL, $params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
_PS_MAIL_DIR_, true); _PS_MAIL_DIR_, true);
@@ -547,8 +547,8 @@ class AdminOrdersControllerCore extends AdminController
// Assign Hook // Assign Hook
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_INVOICE' => Module::hookExec('invoice', array('id_order' => $order->id)), 'HOOK_INVOICE' => Hook::exec('invoice', array('id_order' => $order->id)),
'HOOK_ADMIN_ORDER' => Module::hookExec('adminOrder', array('id_order' => $order->id)) 'HOOK_ADMIN_ORDER' => Hook::exec('adminOrder', array('id_order' => $order->id))
)); ));
} }
public function ajaxProcessSearchCustomers() public function ajaxProcessSearchCustomers()
@@ -328,7 +328,7 @@ class AdminProductsController extends AdminController
$this->_errors[] = Tools::displayError('An error occurred while copying images.'); $this->_errors[] = Tools::displayError('An error occurred while copying images.');
else else
{ {
Hook::addProduct($product); Hook::exec('addProduct', array('product' => $product));
Search::indexation(false, $product->id); Search::indexation(false, $product->id);
Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token));
} }
@@ -561,7 +561,7 @@ class AdminProductsController extends AdminController
if (!$product->addStockMvt(Tools::getValue('attribute_mvt_quantity'), $id_reason, $id_product_attribute, null, $this->context->employee->id)) if (!$product->addStockMvt(Tools::getValue('attribute_mvt_quantity'), $id_reason, $id_product_attribute, null, $this->context->employee->id))
$this->_errors[] = Tools::displayError('An error occurred while updating qty.'); $this->_errors[] = Tools::displayError('An error occurred while updating qty.');
} }
Hook::updateProductAttribute((int)$id_product_attribute); Hook::exec('updateProductAttribute', array('id_product_attribute' => (int)$id_product_attribute));
$this->updateDownloadProduct($product, 1, $id_product_attribute); $this->updateDownloadProduct($product, 1, $id_product_attribute);
} }
else else
@@ -1081,7 +1081,7 @@ if (false)
} }
@unlink($tmpName); @unlink($tmpName);
Module::hookExec('watermark', array('id_image' => $id_image, 'id_product' => $id_product)); Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_product));
} }
} }
@@ -1195,7 +1195,7 @@ if (false)
else if ($id_image = $this->addProductImage($object, Tools::getValue('resizer'))) else if ($id_image = $this->addProductImage($object, Tools::getValue('resizer')))
{ {
self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image'); self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image');
Hook::updateProduct($object); Hook::exec('updateProduct', array('product' => $object));
Search::indexation(false, $object->id); Search::indexation(false, $object->id);
if (Tools::getValue('resizer') == 'man' && isset($id_image) && is_int($id_image) && $id_image) if (Tools::getValue('resizer') == 'man' && isset($id_image) && is_int($id_image) && $id_image)
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') || Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') || Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
@@ -1253,7 +1253,7 @@ if (false)
$this->_errors[] = Tools::displayError('An error occurred while adding tags.'); $this->_errors[] = Tools::displayError('An error occurred while adding tags.');
else if ($id_image = $this->addProductImage($object)) else if ($id_image = $this->addProductImage($object))
{ {
Hook::addProduct($object); Hook::exec('addProduct', array('product' => $object));
Search::indexation(false, $object->id); Search::indexation(false, $object->id);
// Save and preview // Save and preview
+7 -7
View File
@@ -118,8 +118,8 @@ class AuthControllerCore extends FrontController
// Call a hook to display more information on form // Call a hook to display more information on form
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'), 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop') 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop')
)); ));
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
} }
@@ -235,7 +235,7 @@ class AuthControllerCore extends FrontController
*/ */
protected function processSubmitLogin() protected function processSubmitLogin()
{ {
Module::hookExec('beforeAuthentication'); Hook::exec('beforeAuthentication');
$passwd = trim(Tools::getValue('passwd')); $passwd = trim(Tools::getValue('passwd'));
$email = trim(Tools::getValue('email')); $email = trim(Tools::getValue('email'));
if (empty($email)) if (empty($email))
@@ -275,7 +275,7 @@ class AuthControllerCore extends FrontController
$this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id));
$this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id));
$this->context->cart->update(); $this->context->cart->update();
Module::hookExec('authentication'); Hook::exec('authentication');
// Login information have changed, so we check if the cart rules still apply // Login information have changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart(); CartRule::autoRemoveFromCart();
@@ -352,7 +352,7 @@ class AuthControllerCore extends FrontController
$this->updateContext($customer); $this->updateContext($customer);
$this->context->cart->update(); $this->context->cart->update();
Module::hookExec('createAccount', array( Hook::exec('createAccount', array(
'_POST' => $_POST, '_POST' => $_POST,
'newCustomer' => $customer 'newCustomer' => $customer
)); ));
@@ -472,7 +472,7 @@ class AuthControllerCore extends FrontController
// If a logged guest logs in as a customer, the cart secure key was already set and needs to be updated // If a logged guest logs in as a customer, the cart secure key was already set and needs to be updated
$this->context->cart->update(); $this->context->cart->update();
Module::hookExec('createAccount', array( Hook::exec('createAccount', array(
'_POST' => $_POST, '_POST' => $_POST,
'newCustomer' => $customer 'newCustomer' => $customer
)); ));
@@ -581,4 +581,4 @@ class AuthControllerCore extends FrontController
$customer->firstname.' '.$customer->lastname $customer->firstname.' '.$customer->lastname
); );
} }
} }
+2 -2
View File
@@ -213,8 +213,8 @@ class CartControllerCore extends FrontController
} }
$result['summary'] = $this->context->cart->getSummaryDetails(); $result['summary'] = $this->context->cart->getSummaryDetails();
$result['customizedDatas'] = Product::getAllCustomizedDatas($this->context->cart->id, null, true); $result['customizedDatas'] = Product::getAllCustomizedDatas($this->context->cart->id, null, true);
$result['HOOK_SHOPPING_CART'] = Module::hookExec('shoppingCart', $result['summary']); $result['HOOK_SHOPPING_CART'] = Hook::exec('shoppingCart', $result['summary']);
$result['HOOK_SHOPPING_CART_EXTRA'] = Module::hookExec('shoppingCartExtra', $result['summary']); $result['HOOK_SHOPPING_CART_EXTRA'] = Hook::exec('shoppingCartExtra', $result['summary']);
// Display reduced price (or not) without quantity discount // Display reduced price (or not) without quantity discount
if (Tools::getIsset('getproductprice')) if (Tools::getIsset('getproductprice'))
+1 -1
View File
@@ -162,7 +162,7 @@ class CategoryControllerCore extends FrontController
public function assignProductList() public function assignProductList()
{ {
$hookExecuted = false; $hookExecuted = false;
Module::hookExec('productListAssign', array( Hook::exec('productListAssign', array(
'nbProducts' => &$this->nbProducts, 'nbProducts' => &$this->nbProducts,
'catProducts' => &$this->cat_products, 'catProducts' => &$this->cat_products,
'hookExecuted' => &$hookExecuted, 'hookExecuted' => &$hookExecuted,
+1 -1
View File
@@ -159,7 +159,7 @@ class CompareControllerCore extends FrontController
'width' => $width, 'width' => $width,
'homeSize' => Image::getSize('home') 'homeSize' => Image::getSize('home')
)); ));
$this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Module::hookExec('extraProductComparison', array('list_ids_product' => $ids))); $this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Hook::exec('extraProductComparison', array('list_ids_product' => $ids)));
} }
} }
} }
@@ -156,8 +156,8 @@ class GuestTrackingControllerCore extends FrontController
'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues)); 'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues));
if ($carrier->url && $order->shipping_number) if ($carrier->url && $order->shipping_number)
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); $this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order))); $this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Hook::exec('orderDetailDisplayed', array('order' => $order)));
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order)); Hook::exec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
} }
public function setMedia() public function setMedia()
+1 -1
View File
@@ -35,7 +35,7 @@ class IndexControllerCore extends FrontController
*/ */
public function initContent() public function initContent()
{ {
$this->context->smarty->assign('HOOK_HOME', Module::hookExec('home')); $this->context->smarty->assign('HOOK_HOME', Hook::exec('home'));
$this->setTemplate(_PS_THEME_DIR_.'index.tpl'); $this->setTemplate(_PS_THEME_DIR_.'index.tpl');
} }
} }
+1 -1
View File
@@ -48,7 +48,7 @@ class MyAccountControllerCore extends FrontController
'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')), 'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')),
'returnAllowed' => (int)(Configuration::get('PS_ORDER_RETURN')) 'returnAllowed' => (int)(Configuration::get('PS_ORDER_RETURN'))
)); ));
$this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Module::hookExec('customerAccount')); $this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('customerAccount'));
$this->setTemplate(_PS_THEME_DIR_.'my-account.tpl'); $this->setTemplate(_PS_THEME_DIR_.'my-account.tpl');
} }
+2 -2
View File
@@ -192,8 +192,8 @@ class OrderDetailControllerCore extends FrontController
)); ));
if ($carrier->url && $order->shipping_number) if ($carrier->url && $order->shipping_number)
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); $this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order))); $this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Hook::exec('orderDetailDisplayed', array('order' => $order)));
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order)); Hook::exec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
unset($carrier, $addressInvoice, $addressDelivery); unset($carrier, $addressInvoice, $addressDelivery);
} }
+1 -1
View File
@@ -67,7 +67,7 @@ class OrderFollowControllerCore extends FrontController
$orderReturn->state = 1; $orderReturn->state = 1;
$orderReturn->add(); $orderReturn->add();
$orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput); $orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput);
Module::hookExec('orderReturn', array('orderReturn' => $orderReturn)); Hook::exec('orderReturn', array('orderReturn' => $orderReturn));
Tools::redirect('index.php?controller=order-follow'); Tools::redirect('index.php?controller=order-follow');
} }
} }
+11 -11
View File
@@ -67,7 +67,7 @@ class OrderOpcControllerCore extends ParentOrderController
{ {
$return = array( $return = array(
'summary' => $this->context->cart->getSummaryDetails(), 'summary' => $this->context->cart->getSummaryDetails(),
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), 'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
'HOOK_PAYMENT' => $this->_getPaymentMethods() 'HOOK_PAYMENT' => $this->_getPaymentMethods()
); );
die(Tools::jsonEncode($return)); die(Tools::jsonEncode($return));
@@ -84,7 +84,7 @@ class OrderOpcControllerCore extends ParentOrderController
{ {
$this->context->cookie->checkedTOS = (int)(Tools::getValue('checked')); $this->context->cookie->checkedTOS = (int)(Tools::getValue('checked'));
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), 'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
'HOOK_PAYMENT' => $this->_getPaymentMethods() 'HOOK_PAYMENT' => $this->_getPaymentMethods()
))); )));
} }
@@ -137,7 +137,7 @@ class OrderOpcControllerCore extends ParentOrderController
'order_opc_adress' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-address.tpl'), 'order_opc_adress' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-address.tpl'),
'block_user_info' => (isset($blockUserInfo) ? $blockUserInfo->hookTop(array()) : ''), 'block_user_info' => (isset($blockUserInfo) ? $blockUserInfo->hookTop(array()) : ''),
'carrier_list' => $this->_getCarrierList(), 'carrier_list' => $this->_getCarrierList(),
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), 'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
'HOOK_PAYMENT' => $this->_getPaymentMethods(), 'HOOK_PAYMENT' => $this->_getPaymentMethods(),
'no_address' => 0, 'no_address' => 0,
'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)($this->context->cookie->id_currency)))) 'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)($this->context->cookie->id_currency))))
@@ -190,7 +190,7 @@ class OrderOpcControllerCore extends ParentOrderController
$wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100))); $wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100)));
$result = array_merge($result, array( $result = array_merge($result, array(
'summary' => $this->context->cart->getSummaryDetails(), 'summary' => $this->context->cart->getSummaryDetails(),
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), 'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
'HOOK_PAYMENT' => $this->_getPaymentMethods(), 'HOOK_PAYMENT' => $this->_getPaymentMethods(),
'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)($this->context->cookie->id_currency)))) 'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)($this->context->cookie->id_currency))))
)); ));
@@ -256,8 +256,8 @@ class OrderOpcControllerCore extends ParentOrderController
)); ));
/* Call a hook to display more information on form */ /* Call a hook to display more information on form */
self::$smarty->assign(array( self::$smarty->assign(array(
'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'), 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop') 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop')
)); ));
$years = Tools::dateYears(); $years = Tools::dateYears();
$months = Tools::dateMonths(); $months = Tools::dateMonths();
@@ -333,7 +333,7 @@ class OrderOpcControllerCore extends ParentOrderController
'carriers' => $carriers, 'carriers' => $carriers,
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')), 'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')),
'HOOK_EXTRACARRIER' => NULL, 'HOOK_EXTRACARRIER' => NULL,
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)) 'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers))
)); ));
} }
else else
@@ -343,7 +343,7 @@ class OrderOpcControllerCore extends ParentOrderController
protected function _assignPayment() protected function _assignPayment()
{ {
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_TOP_PAYMENT' => ($this->isLogged ? Module::hookExec('paymentTop') : ''), 'HOOK_TOP_PAYMENT' => ($this->isLogged ? Hook::exec('paymentTop') : ''),
'HOOK_PAYMENT' => $this->_getPaymentMethods() 'HOOK_PAYMENT' => $this->_getPaymentMethods()
)); ));
} }
@@ -389,7 +389,7 @@ class OrderOpcControllerCore extends ParentOrderController
if ($this->context->cart->getOrderTotal() <= 0) if ($this->context->cart->getOrderTotal() <= 0)
return '<p class="center"><input type="button" class="exclusive_large" name="confirmOrder" id="confirmOrder" value="'.Tools::displayError('I confirm my order').'" onclick="confirmFreeOrder();" /></p>'; return '<p class="center"><input type="button" class="exclusive_large" name="confirmOrder" id="confirmOrder" value="'.Tools::displayError('I confirm my order').'" onclick="confirmFreeOrder();" /></p>';
$return = Module::hookExecPayment(); $return = Hook::exec('payment');
if (!$return) if (!$return)
return '<p class="warning">'.Tools::displayError('No payment method is available').'</p>'; return '<p class="warning">'.Tools::displayError('No payment method is available').'</p>';
return $return; return $return;
@@ -412,8 +412,8 @@ class OrderOpcControllerCore extends ParentOrderController
$result = array( $result = array(
'checked' => $this->_setDefaultCarrierSelection($carriers), 'checked' => $this->_setDefaultCarrierSelection($carriers),
'carriers' => $carriers, 'carriers' => $carriers,
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)), 'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers)),
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address_delivery)) 'HOOK_EXTRACARRIER' => Hook::exec('extraCarrier', array('address' => $address_delivery))
); );
return $result; return $result;
} }
+7 -7
View File
@@ -222,7 +222,7 @@ class ParentOrderControllerCore extends FrontController
else if (!$this->context->cart->isVirtualCart() && (int)(Tools::getValue('id_carrier')) == 0) else if (!$this->context->cart->isVirtualCart() && (int)(Tools::getValue('id_carrier')) == 0)
$this->errors[] = Tools::displayError('Invalid carrier or no carrier selected'); $this->errors[] = Tools::displayError('Invalid carrier or no carrier selected');
Module::hookExec('processCarrier', array('cart' => $this->context->cart)); Hook::exec('processCarrier', array('cart' => $this->context->cart));
if (!$this->context->cart->update()) if (!$this->context->cart->update())
return false; return false;
@@ -293,8 +293,8 @@ class ParentOrderControllerCore extends FrontController
'currencyFormat' => $this->context->currency->format, 'currencyFormat' => $this->context->currency->format,
'currencyBlank' => $this->context->currency->blank)); 'currencyBlank' => $this->context->currency->blank));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary), 'HOOK_SHOPPING_CART' => Hook::exec('shoppingCart', $summary),
'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary) 'HOOK_SHOPPING_CART_EXTRA' => Hook::exec('shoppingCartExtra', $summary)
)); ));
} }
@@ -383,8 +383,8 @@ class ParentOrderControllerCore extends FrontController
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')) 'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT'))
)); ));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)), 'HOOK_EXTRACARRIER' => Hook::exec('extraCarrier', array('address' => $address)),
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)) 'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers))
)); ));
} }
@@ -419,8 +419,8 @@ class ParentOrderControllerCore extends FrontController
protected function _assignPayment() protected function _assignPayment()
{ {
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), 'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
'HOOK_PAYMENT' => Module::hookExecPayment() 'HOOK_PAYMENT' => Hook::exec('payment'),
)); ));
} }
+7 -7
View File
@@ -178,12 +178,12 @@ class ProductControllerCore extends FrontController
'attachments' => (($this->product->cache_has_attachments) ? $this->product->getAttachments($this->context->language->id) : array()), 'attachments' => (($this->product->cache_has_attachments) ? $this->product->getAttachments($this->context->language->id) : array()),
'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)$this->product->out_of_stock), 'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)$this->product->out_of_stock),
'last_qties' => (int)Configuration::get('PS_LAST_QTIES'), 'last_qties' => (int)Configuration::get('PS_LAST_QTIES'),
'HOOK_EXTRA_LEFT' => Module::hookExec('extraLeft'), 'HOOK_EXTRA_LEFT' => Hook::exec('extraLeft'),
'HOOK_EXTRA_RIGHT' => Module::hookExec('extraRight'), 'HOOK_EXTRA_RIGHT' => Hook::exec('extraRight'),
'HOOK_PRODUCT_OOS' => Hook::productOutOfStock($this->product), 'HOOK_PRODUCT_OOS' => Hook::exec('productOutOfStock', array('product' => $this->product)),
'HOOK_PRODUCT_ACTIONS' => Module::hookExec('productActions'), 'HOOK_PRODUCT_ACTIONS' => Hook::exec('productActions'),
'HOOK_PRODUCT_TAB' => Module::hookExec('productTab'), 'HOOK_PRODUCT_TAB' => Hook::exec('productTab'),
'HOOK_PRODUCT_TAB_CONTENT' => Module::hookExec('productTabContent'), 'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('productTabContent'),
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'), 'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
'display_ht' => !Tax::excludeTaxeOption(), 'display_ht' => !Tax::excludeTaxeOption(),
'currencySign' => $this->context->currency->sign, 'currencySign' => $this->context->currency->sign,
@@ -499,7 +499,7 @@ class ProductControllerCore extends FrontController
$this->context->smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name)); $this->context->smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name));
$this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id)); $this->context->smarty->assign('categories', Category::getHomeCategories($this->context->language->id));
$this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::productFooter($this->product, $category))); $this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('productFooter', array('product' => $this->product, 'category' => $category))));
} }
public function transformDescriptionWithImg($desc) public function transformDescriptionWithImg($desc)
+4 -4
View File
@@ -64,7 +64,7 @@ class SearchControllerCore extends FrontController
$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')))); $this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
$this->p = abs((int)(Tools::getValue('p', 1))); $this->p = abs((int)(Tools::getValue('p', 1)));
$search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay); $search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
Module::hookExec('search', array('expr' => $query, 'total' => $search['total'])); Hook::exec('search', array('expr' => $query, 'total' => $search['total']));
$nbProducts = $search['total']; $nbProducts = $search['total'];
$this->pagination($nbProducts); $this->pagination($nbProducts);
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -81,7 +81,7 @@ class SearchControllerCore extends FrontController
$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')))); $this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
$this->p = abs((int)(Tools::getValue('p', 1))); $this->p = abs((int)(Tools::getValue('p', 1)));
$search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay); $search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
Module::hookExec('search', array('expr' => $query, 'total' => $search['total'])); Hook::exec('search', array('expr' => $query, 'total' => $search['total']));
$nbProducts = $search['total']; $nbProducts = $search['total'];
$this->pagination($nbProducts); $this->pagination($nbProducts);
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -96,7 +96,7 @@ class SearchControllerCore extends FrontController
$nbProducts = (int)(Search::searchTag($this->context->language->id, $tag, true)); $nbProducts = (int)(Search::searchTag($this->context->language->id, $tag, true));
$this->pagination($nbProducts); $this->pagination($nbProducts);
$result = Search::searchTag($this->context->language->id, $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay); $result = Search::searchTag($this->context->language->id, $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay);
Module::hookExec('search', array('expr' => $tag, 'total' => count($result))); Hook::exec('search', array('expr' => $tag, 'total' => count($result)));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'search_tag' => $tag, 'search_tag' => $tag,
'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
@@ -138,4 +138,4 @@ class SearchControllerCore extends FrontController
if (!$this->instant_search && !$this->ajax_search) if (!$this->instant_search && !$this->ajax_search)
$this->addCSS(_THEME_CSS_DIR_.'product_list.css'); $this->addCSS(_THEME_CSS_DIR_.'product_list.css');
} }
} }
+8
View File
@@ -840,6 +840,14 @@ CREATE TABLE `PREFIX_hook` (
UNIQUE KEY `hook_name` (`name`) UNIQUE KEY `hook_name` (`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_hook_alias` (
`id_hook_alias` int(10) unsigned NOT NULL auto_increment,
`alias` varchar(64) NOT NULL,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`id_hook_alias`),
UNIQUE KEY `alias` (`alias`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_hook_module` ( CREATE TABLE `PREFIX_hook_module` (
`id_module` int(10) unsigned NOT NULL, `id_module` int(10) unsigned NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1', `id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
+173 -85
View File
@@ -1,91 +1,179 @@
SET NAMES 'utf8'; SET NAMES 'utf8';
INSERT INTO `PREFIX_hook_alias` (`id_hook_alias`, `name`, `alias`) VALUES
(1, 'displayPayment', 'payment'),
(2, 'actionValidateOrder', 'newOrder'),
(3, 'actionPaymentConfirmation', 'paymentConfirm'),
(4, 'displayPaymentReturn', 'paymentReturn'),
(5, 'actionUpdateQuantity', 'updateQuantity'),
(6, 'displayRightColumn', 'rightColumn'),
(7, 'displayLeftColumn', 'leftColumn'),
(8, 'displayHome', 'home'),
(9, 'displayHeader', 'header'),
(10, 'actionCartSave', 'cart'),
(11, 'actionAuthentication', 'authentication'),
(12, 'actionProductAdd', 'addproduct'),
(13, 'actionProductUpdate', 'updateproduct'),
(14, 'displayTop', 'top'),
(15, 'displayRightColumnProduct', 'extraRight'),
(16, 'actionProductDelete', 'deleteproduct'),
(17, 'displayFooterProduct', 'productfooter'),
(18, 'displayInvoice', 'invoice'),
(19, 'actionOrderStatusUpdate', 'updateOrderStatus'),
(20, 'displayAdminOrder', 'adminOrder'),
(21, 'displayFooter', 'footer'),
(22, 'displayPDFInvoice', 'PDFInvoice'),
(23, 'displayAdminCustomers', 'adminCustomers'),
(24, 'displayOrderConfirmation', 'orderConfirmation'),
(25, 'actionCustomerAccountAdd', 'createAccount'),
(26, 'displayCustomerAccount', 'customerAccount'),
(27, 'actionOrderSlipAdd', 'orderSlip'),
(28, 'displayProductTab', 'productTab'),
(29, 'displayProductTabContent', 'productTabContent'),
(30, 'displayShoppingCartFooter', 'shoppingCart'),
(31, 'displayCustomerAccountForm', 'createAccountForm'),
(32, 'displayAdminStatsModules', 'AdminStatsModules'),
(33, 'displayAdminStatsGraphEngine', 'GraphEngine'),
(34, 'actionOrderReturn', 'orderReturn'),
(35, 'displayProductButtons', 'productActions'),
(36, 'displayBackOfficeHome', 'backOfficeHome'),
(37, 'displayAdminStatsGridEngine', 'GridEngine'),
(38, 'actionWatermark', 'watermark'),
(39, 'actionProductCancel', 'cancelProduct'),
(40, 'displayLeftColumnProduct', 'extraLeft'),
(41, 'actionProductOutOfStock', 'productOutOfStock'),
(42, 'actionProductAttributeUpdate', 'updateProductAttribute'),
(43, 'displayCarrierList', 'extraCarrier'),
(44, 'displayShoppingCart', 'shoppingCartExtra'),
(45, 'actionSearch', 'search'),
(46, 'displayBeforePayment', 'backBeforePayment'),
(47, 'actionCarrierUpdate', 'updateCarrier'),
(48, 'actionOrderStatusPostUpdate', 'postUpdateOrderStatus'),
(49, 'displayCustomerAccountFormTop', 'createAccountTop'),
(50, 'displayBackOfficeHeader', 'backOfficeHeader'),
(51, 'displayBackOfficeTop', 'backOfficeTop'),
(52, 'displayBackOfficeFooter', 'backOfficeFooter'),
(53, 'actionProductAttributeDelete', 'deleteProductAttribute'),
(54, 'actionCarrierProcess', 'processCarrier'),
(55, 'actionOrderDetail', 'orderDetail'),
(56, 'displayBeforeCarrier', 'beforeCarrier'),
(57, 'displayOrderDetail', 'orderDetailDisplayed'),
(58, 'actionPaymentCCAdd', 'paymentCCAdded'),
(59, 'displayProductComparison', 'extraProductComparison'),
(60, 'actionCategoryAdd', 'categoryAddition'),
(61, 'actionCategoryUpdate', 'categoryUpdate'),
(62, 'actionCategoryDelete', 'categoryDeletion'),
(63, 'actionBeforeAuthentication', 'beforeAuthentication'),
(64, 'displayPaymentTop', 'paymentTop'),
(65, 'actionHtaccessCreate', 'afterCreateHtaccess'),
(66, 'actionAdminMetaSave', 'afterSaveAdminMeta'),
(67, 'displayAttributeGroupForm', 'attributeGroupForm'),
(68, 'actionAttributeGroupSave', 'afterSaveAttributeGroup'),
(69, 'actionAttributeGroupDelete', 'afterDeleteAttributeGroup'),
(70, 'displayFeatureForm', 'featureForm'),
(71, 'actionFeatureSave', 'afterSaveFeature'),
(72, 'actionFeatureDelete', 'afterDeleteFeature'),
(73, 'actionProductSave', 'afterSaveProduct'),
(74, 'actionProductListOverride', 'productListAssign'),
(75, 'displayAttributeGroupPostProcess', 'postProcessAttributeGroup'),
(76, 'displayFeaturePostProcess', 'postProcessFeature'),
(77, 'displayFeatureValueForm', 'featureValueForm'),
(78, 'displayFeatureValuePostProcess', 'postProcessFeatureValue'),
(79, 'actionFeatureValueDelete', 'afterDeleteFeatureValue'),
(80, 'actionFeatureValueSave', 'afterSaveFeatureValue'),
(81, 'displayAttributeForm', 'attributeForm'),
(82, 'actionAttributePostProcess', 'postProcessAttribute'),
(83, 'actionAttributeDelete', 'afterDeleteAttribute'),
(84, 'actionAttributeSave', 'afterSaveAttribute'),
(85, 'actionTaxManager', 'taxManager');
INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`, `live_edit`) VALUES INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`, `live_edit`) VALUES
(1, 'payment', 'Payment', NULL, 1, 1), (1, 'displayPayment', 'Payment', NULL, 1, 1),
(2, 'newOrder', 'New orders', NULL, 0, 0), (2, 'actionValidateOrder', 'New orders', NULL, 0, 0),
(3, 'paymentConfirm', 'Payment confirmation', NULL, 0, 0), (3, 'actionPaymentConfirmation', 'Payment confirmation', NULL, 0, 0),
(4, 'paymentReturn', 'Payment return', NULL, 0, 0), (4, 'displayPaymentReturn', 'Payment return', NULL, 0, 0),
(5, 'updateQuantity', 'Quantity update', 'Quantity is updated only when the customer effectively <b>place</b> his order.', 0, 0), (5, 'actionUpdateQuantity', 'Quantity update', 'Quantity is updated only when the customer effectively <b>place</b> his order.', 0, 0),
(6, 'rightColumn', 'Right column blocks', NULL, 1, 1), (6, 'displayRightColumn', 'Right column blocks', NULL, 1, 1),
(7, 'leftColumn', 'Left column blocks', NULL, 1, 1), (7, 'displayLeftColumn', 'Left column blocks', NULL, 1, 1),
(8, 'home', 'Homepage content', NULL, 1, 1), (8, 'displayHome', 'Homepage content', NULL, 1, 1),
(9, 'header', 'Header of pages', 'A hook which allow you to do things in the header of each pages', 1, 0), (9, 'displayHeader', 'Header of pages', 'A hook which allow you to do things in the header of each pages', 1, 0),
(10, 'cart', 'Cart creation and update', NULL, 0, 0), (10, 'actionCartSave', 'Cart creation and update', NULL, 0, 0),
(11, 'authentication', 'Successful customer authentication', NULL, 0, 0), (11, 'actionAuthentication', 'Successful customer authentication', NULL, 0, 0),
(12, 'addproduct', 'Product creation', NULL, 0, 0), (12, 'actionProductAdd', 'Product creation', NULL, 0, 0),
(13, 'updateproduct', 'Product Update', NULL, 0, 0), (13, 'actionProductUpdate', 'Product Update', NULL, 0, 0),
(14, 'top', 'Top of pages', 'A hook which allow you to do things a the top of each pages.', 1, 0), (14, 'displayTop', 'Top of pages', 'A hook which allow you to do things a the top of each pages.', 1, 0),
(15, 'extraRight', 'Extra actions on the product page (right column).', NULL, 0, 0), (15, 'displayRightColumnProduct', 'Extra actions on the product page (right column).', NULL, 0, 0),
(16, 'deleteproduct', 'Product deletion', 'This hook is called when a product is deleted', 0, 0), (16, 'actionProductDelete', 'Product deletion', 'This hook is called when a product is deleted', 0, 0),
(17, 'productfooter', 'Product footer', 'Add new blocks under the product description', 1, 1), (17, 'displayFooterProduct', 'Product footer', 'Add new blocks under the product description', 1, 1),
(18, 'invoice', 'Invoice', 'Add blocks to invoice (order)', 1, 0), (18, 'displayInvoice', 'Invoice', 'Add blocks to invoice (order)', 1, 0),
(19, 'updateOrderStatus', 'Order''s status update event', 'Launch modules when the order''s status of an order change.', 0, 0), (19, 'actionOrderStatusUpdate', 'Order''s status update event', 'Launch modules when the order''s status of an order change.', 0, 0),
(20, 'adminOrder', 'Display in Back-Office, tab AdminOrder', 'Launch modules when the tab AdminOrder is displayed on back-office.', 0, 0), (20, 'displayAdminOrder', 'Display in Back-Office, tab AdminOrder', 'Launch modules when the tab AdminOrder is displayed on back-office.', 0, 0),
(21, 'footer', 'Footer', 'Add block in footer', 1, 0), (21, 'displayFooter', 'Footer', 'Add block in footer', 1, 0),
(22, 'PDFInvoice', 'PDF Invoice', 'Allow the display of extra informations into the PDF invoice', 0, 0), (22, 'displayPDFInvoice', 'PDF Invoice', 'Allow the display of extra informations into the PDF invoice', 0, 0),
(23, 'adminCustomers', 'Display in Back-Office, tab AdminCustomers', 'Launch modules when the tab AdminCustomers is displayed on back-office.', 0, 0), (23, 'displayAdminCustomers', 'Display in Back-Office, tab AdminCustomers', 'Launch modules when the tab AdminCustomers is displayed on back-office.', 0, 0),
(24, 'orderConfirmation', 'Order confirmation page', 'Called on order confirmation page', 0, 0), (24, 'displayOrderConfirmation', 'Order confirmation page', 'Called on order confirmation page', 0, 0),
(25, 'createAccount', 'Successful customer create account', 'Called when new customer create account successfuled', 0, 0), (25, 'actionCustomerAccountAdd', 'Successful customer create account', 'Called when new customer create account successfuled', 0, 0),
(26, 'customerAccount', 'Customer account page display in front office', 'Display on page account of the customer', 1, 0), (26, 'displayCustomerAccount', 'Customer account page display in front office', 'Display on page account of the customer', 1, 0),
(27, 'orderSlip', 'Called when a order slip is created', 'Called when a quantity of one product change in an order.', 0, 0), (27, 'actionOrderSlipAdd', 'Called when a order slip is created', 'Called when a quantity of one product change in an order.', 0, 0),
(28, 'productTab', 'Tabs on product page', 'Called on order product page tabs', 0, 0), (28, 'displayProductTab', 'Tabs on product page', 'Called on order product page tabs', 0, 0),
(29, 'productTabContent', 'Content of tabs on product page', 'Called on order product page tabs', 0, 0), (29, 'displayProductTabContent', 'Content of tabs on product page', 'Called on order product page tabs', 0, 0),
(30, 'shoppingCart', 'Shopping cart footer', 'Display some specific informations on the shopping cart page', 0, 0), (30, 'displayShoppingCartFooter', 'Shopping cart footer', 'Display some specific informations on the shopping cart page', 0, 0),
(31, 'createAccountForm', 'Customer account creation form', 'Display some information on the form to create a customer account', 1, 0), (31, 'displayCustomerAccountForm', 'Customer account creation form', 'Display some information on the form to create a customer account', 1, 0),
(32, 'AdminStatsModules','Stats - Modules', NULL, 1, 0), (32, 'displayAdminStatsModules','Stats - Modules', NULL, 1, 0),
(33, 'GraphEngine','Graph Engines', NULL, 0, 0), (33, 'displayAdminStatsGraphEngine','Graph Engines', NULL, 0, 0),
(34, 'orderReturn','Product returned', NULL, 0, 0), (34, 'actionOrderReturn','Product returned', NULL, 0, 0),
(35, 'productActions', 'Product actions', 'Put new action buttons on product page', 1, 0), (35, 'displayProductButtons', 'Product actions', 'Put new action buttons on product page', 1, 0),
(36, 'backOfficeHome', 'Administration panel homepage', NULL, 1, 0), (36, 'displayBackOfficeHome', 'Administration panel homepage', NULL, 1, 0),
(37, 'GridEngine','Grid Engines', NULL, 0, 0), (37, 'displayAdminStatsGridEngine','Grid Engines', NULL, 0, 0),
(38, 'watermark','Watermark', NULL, 0, 0), (38, 'actionWatermark','Watermark', NULL, 0, 0),
(39, 'cancelProduct', 'Product cancelled', 'This hook is called when you cancel a product in an order', 0, 0), (39, 'actionProductCancel', 'Product cancelled', 'This hook is called when you cancel a product in an order', 0, 0),
(40, 'extraLeft', 'Extra actions on the product page (left column).', NULL, 0, 0), (40, 'displayLeftColumnProduct', 'Extra actions on the product page (left column).', NULL, 0, 0),
(41, 'productOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1, 0), (41, 'actionProductOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1, 0),
(42, 'updateProductAttribute', 'Product attribute update', NULL, 0, 0), (42, 'actionProductAttributeUpdate', 'Product attribute update', NULL, 0, 0),
(43, 'extraCarrier', 'Extra carrier (module mode)', NULL, 0, 0), (43, 'displayCarrierList', 'Extra carrier (module mode)', NULL, 0, 0),
(44, 'shoppingCartExtra', 'Shopping cart extra button', 'Display some specific informations', 1, 0), (44, 'displayShoppingCart', 'Shopping cart extra button', 'Display some specific informations', 1, 0),
(45, 'search', 'Search', NULL, 0, 0), (45, 'actionSearch', 'Search', NULL, 0, 0),
(46, 'backBeforePayment', 'Redirect in order process', 'Redirect user to the module instead of displaying payment modules', 0, 0), (46, 'displayBeforePayment', 'Redirect in order process', 'Redirect user to the module instead of displaying payment modules', 0, 0),
(47, 'updateCarrier', 'Carrier Update', 'This hook is called when a carrier is updated', 0, 0), (47, 'actionCarrierUpdate', 'Carrier Update', 'This hook is called when a carrier is updated', 0, 0),
(48, 'postUpdateOrderStatus', 'Post update of order status', NULL, 0, 0), (48, 'actionOrderStatusPostUpdate', 'Post update of order status', NULL, 0, 0),
(49, 'createAccountTop', 'Block above the form for create an account', NULL, 1, 0), (49, 'displayCustomerAccountFormTop', 'Block above the form for create an account', NULL, 1, 0),
(50, 'backOfficeHeader', 'Administration panel header', NULL , 0, 0), (50, 'displayBackOfficeHeader', 'Administration panel header', NULL , 0, 0),
(51, 'backOfficeTop', 'Administration panel hover the tabs', NULL , 1, 0), (51, 'displayBackOfficeTop', 'Administration panel hover the tabs', NULL , 1, 0),
(52, 'backOfficeFooter', 'Administration panel footer', NULL , 1, 0), (52, 'displayBackOfficeFooter', 'Administration panel footer', NULL , 1, 0),
(53, 'deleteProductAttribute', 'Product Attribute Deletion', NULL, 0, 0), (53, 'actionProductAttributeDelete', 'Product Attribute Deletion', NULL, 0, 0),
(54, 'processCarrier', 'Carrier Process', NULL, 0, 0), (54, 'actionCarrierProcess', 'Carrier Process', NULL, 0, 0),
(55, 'orderDetail', 'Order Detail', 'To set the follow-up in smarty when order detail is called', 0, 0), (55, 'actionOrderDetail', 'Order Detail', 'To set the follow-up in smarty when order detail is called', 0, 0),
(56, 'beforeCarrier', 'Before carrier list', 'This hook is display before the carrier list on Front office', 1, 0), (56, 'displayBeforeCarrier', 'Before carrier list', 'This hook is display before the carrier list on Front office', 1, 0),
(57, 'orderDetailDisplayed', 'Order detail displayed', 'Displayed on order detail on front office', 1, 0), (57, 'displayOrderDetail', 'Order detail displayed', 'Displayed on order detail on front office', 1, 0),
(58, 'paymentCCAdded', 'Payment CC added', 'Payment CC added', 0, 0), (58, 'actionPaymentCCAdd', 'Payment CC added', 'Payment CC added', 0, 0),
(59, 'extraProductComparison', 'Extra Product Comparison', 'Extra Product Comparison', 0, 0), (59, 'displayProductComparison', 'Extra Product Comparison', 'Extra Product Comparison', 0, 0),
(60, 'categoryAddition', 'Category creation', '', 0, 0), (60, 'actionCategoryAdd', 'Category creation', '', 0, 0),
(61, 'categoryUpdate', 'Category modification', '', 0, 0), (61, 'actionCategoryUpdate', 'Category modification', '', 0, 0),
(62, 'categoryDeletion', 'Category removal', '', 0, 0), (62, 'actionCategoryDelete', 'Category removal', '', 0, 0),
(63, 'beforeAuthentication', 'Before Authentication', 'Before authentication', 0, 0), (63, 'actionBeforeAuthentication', 'Before Authentication', 'Before authentication', 0, 0),
(64, 'paymentTop', 'Top of payment page', 'Top of payment page', 0, 0), (64, 'displayPaymentTop', 'Top of payment page', 'Top of payment page', 0, 0),
(65, 'afterCreateHtaccess', 'After htaccess creation', 'After htaccess creation', 0, 0), (65, 'actionHtaccessCreate', 'After htaccess creation', 'After htaccess creation', 0, 0),
(66, 'afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0), (66, 'actionAdminMetaSave', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0),
(67, 'attributeGroupForm', 'Add fileds to the form "attribute group"', 'Add fileds to the form "attribute group"', 0, 0), (67, 'displayAttributeGroupForm', 'Add fileds to the form "attribute group"', 'Add fileds to the form "attribute group"', 0, 0),
(68, 'afterSaveAttributeGroup', 'On saving attribute group', 'On saving attribute group', 0, 0), (68, 'actionAttributeGroupSave', 'On saving attribute group', 'On saving attribute group', 0, 0),
(69, 'afterDeleteAttributeGroup', 'On deleting attribute group', 'On deleting attribute group', 0, 0), (69, 'actionAttributeGroupDelete', 'On deleting attribute group', 'On deleting attribute group', 0, 0),
(70, 'featureForm', 'Add fields to the form "feature"', 'Add fields to the form "feature"', 0, 0), (70, 'displayFeatureForm', 'Add fields to the form "feature"', 'Add fields to the form "feature"', 0, 0),
(71, 'afterSaveFeature', 'On saving attribute feature', 'On saving attribute feature', 0, 0), (71, 'actionFeatureSave', 'On saving attribute feature', 'On saving attribute feature', 0, 0),
(72, 'afterDeleteFeature', 'On deleting attribute feature', 'On deleting attribute feature', 0, 0), (72, 'actionFeatureDelete', 'On deleting attribute feature', 'On deleting attribute feature', 0, 0),
(73, 'afterSaveProduct', 'On saving products', 'On saving products', 0, 0), (73, 'actionProductSave', 'On saving products', 'On saving products', 0, 0),
(74, 'productListAssign', 'Assign product list to a category', 'Assign product list to a category', 0, 0), (74, 'actionProductListOverride', 'Assign product list to a category', 'Assign product list to a category', 0, 0),
(75, 'postProcessAttributeGroup', 'On post-process in admin attribute group', 'On post-process in admin attribute group', 0, 0), (75, 'displayAttributeGroupPostProcess', 'On post-process in admin attribute group', 'On post-process in admin attribute group', 0, 0),
(76, 'postProcessFeature', 'On post-process in admin feature', 'On post-process in admin feature', 0, 0), (76, 'displayFeaturePostProcess', 'On post-process in admin feature', 'On post-process in admin feature', 0, 0),
(77, 'featureValueForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0), (77, 'displayFeatureValueForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0),
(78, 'postProcessFeatureValue', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0), (78, 'displayFeatureValuePostProcess', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
(79, 'afterDeleteFeatureValue', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0), (79, 'actionFeatureValueDelete', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
(90, 'afterSaveFeatureValue', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0), (90, 'actionFeatureValueSave', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0),
(91, 'attributeForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0), (91, 'displayAttributeForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0),
(92, 'postProcessAttribute', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0), (92, 'actionAttributePostProcess', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
(93, 'afterDeleteAttribute', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0), (93, 'actionAttributeDelete', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
(94, 'afterSaveAttribute', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0), (94, 'actionAttributeSave', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0),
(95, 'taxManager', 'Tax Manager Factory', '' , 0, 0); (95, 'actionTaxManager', 'Tax Manager Factory', '' , 0, 0);
INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES
(1, 'PS_LANG_DEFAULT', '1', NOW(), NOW()), (1, 'PS_LANG_DEFAULT', '1', NOW(), NOW()),
+90
View File
@@ -316,3 +316,93 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) (
); );
UPDATE `PREFIX_tab` SET class_name = 'AdminCartRules' WHERE class_name = 'AdminDiscounts'; UPDATE `PREFIX_tab` SET class_name = 'AdminCartRules' WHERE class_name = 'AdminDiscounts';
UPDATE `PREFIX_hook` SET `name` = 'displayPayment' WHERE `name` = 'payment';
UPDATE `PREFIX_hook` SET `name` = 'actionValidateOrder' WHERE `name` = 'newOrder';
UPDATE `PREFIX_hook` SET `name` = 'actionPaymentConfirmation' WHERE `name` = 'paymentConfirm';
UPDATE `PREFIX_hook` SET `name` = 'displayPaymentReturn' WHERE `name` = 'paymentReturn';
UPDATE `PREFIX_hook` SET `name` = 'actionUpdateQuantity' WHERE `name` = 'updateQuantity';
UPDATE `PREFIX_hook` SET `name` = 'displayRightColumn' WHERE `name` = 'rightColumn';
UPDATE `PREFIX_hook` SET `name` = 'displayLeftColumn' WHERE `name` = 'leftColumn';
UPDATE `PREFIX_hook` SET `name` = 'displayHome' WHERE `name` = 'home';
UPDATE `PREFIX_hook` SET `name` = 'displayHeader' WHERE `name` = 'header';
UPDATE `PREFIX_hook` SET `name` = 'actionCartSave' WHERE `name` = 'cart';
UPDATE `PREFIX_hook` SET `name` = 'actionAuthentication' WHERE `name` = 'authentication';
UPDATE `PREFIX_hook` SET `name` = 'actionProductAdd' WHERE `name` = 'addproduct';
UPDATE `PREFIX_hook` SET `name` = 'actionProductUpdate' WHERE `name` = 'updateproduct';
UPDATE `PREFIX_hook` SET `name` = 'displayTop' WHERE `name` = 'top';
UPDATE `PREFIX_hook` SET `name` = 'displayRightColumnProduct' WHERE `name` = 'extraRight';
UPDATE `PREFIX_hook` SET `name` = 'actionProductDelete' WHERE `name` = 'deleteproduct';
UPDATE `PREFIX_hook` SET `name` = 'displayFooterProduct' WHERE `name` = 'productfooter';
UPDATE `PREFIX_hook` SET `name` = 'displayInvoice' WHERE `name` = 'invoice';
UPDATE `PREFIX_hook` SET `name` = 'actionOrderStatusUpdate' WHERE `name` = 'updateOrderStatus';
UPDATE `PREFIX_hook` SET `name` = 'displayAdminOrder' WHERE `name` = 'adminOrder';
UPDATE `PREFIX_hook` SET `name` = 'displayFooter' WHERE `name` = 'footer';
UPDATE `PREFIX_hook` SET `name` = 'displayPDFInvoice' WHERE `name` = 'PDFInvoice';
UPDATE `PREFIX_hook` SET `name` = 'displayAdminCustomers' WHERE `name` = 'adminCustomers';
UPDATE `PREFIX_hook` SET `name` = 'displayOrderConfirmation' WHERE `name` = 'orderConfirmation';
UPDATE `PREFIX_hook` SET `name` = 'actionCustomerAccountAdd' WHERE `name` = 'createAccount';
UPDATE `PREFIX_hook` SET `name` = 'displayCustomerAccount' WHERE `name` = 'customerAccount';
UPDATE `PREFIX_hook` SET `name` = 'actionOrderSlipAdd' WHERE `name` = 'orderSlip';
UPDATE `PREFIX_hook` SET `name` = 'displayProductTab' WHERE `name` = 'productTab';
UPDATE `PREFIX_hook` SET `name` = 'displayProductTabContent' WHERE `name` = 'productTabContent';
UPDATE `PREFIX_hook` SET `name` = 'displayShoppingCartFooter' WHERE `name` = 'shoppingCart';
UPDATE `PREFIX_hook` SET `name` = 'displayCustomerAccountForm' WHERE `name` = 'createAccountForm';
UPDATE `PREFIX_hook` SET `name` = 'displayAdminStatsModules' WHERE `name` = 'AdminStatsModules';
UPDATE `PREFIX_hook` SET `name` = 'displayAdminStatsGraphEngine' WHERE `name` = 'GraphEngine';
UPDATE `PREFIX_hook` SET `name` = 'actionOrderReturn' WHERE `name` = 'orderReturn';
UPDATE `PREFIX_hook` SET `name` = 'displayProductButtons' WHERE `name` = 'productActions';
UPDATE `PREFIX_hook` SET `name` = 'displayBackOfficeHome' WHERE `name` = 'backOfficeHome';
UPDATE `PREFIX_hook` SET `name` = 'displayAdminStatsGridEngine' WHERE `name` = 'GridEngine';
UPDATE `PREFIX_hook` SET `name` = 'actionWatermark' WHERE `name` = 'watermark';
UPDATE `PREFIX_hook` SET `name` = 'actionProductCancel' WHERE `name` = 'cancelProduct';
UPDATE `PREFIX_hook` SET `name` = 'displayLeftColumnProduct' WHERE `name` = 'extraLeft';
UPDATE `PREFIX_hook` SET `name` = 'actionProductOutOfStock' WHERE `name` = 'productOutOfStock';
UPDATE `PREFIX_hook` SET `name` = 'actionProductAttributeUpdate' WHERE `name` = 'updateProductAttribute';
UPDATE `PREFIX_hook` SET `name` = 'displayCarrierList' WHERE `name` = 'extraCarrier';
UPDATE `PREFIX_hook` SET `name` = 'displayShoppingCart' WHERE `name` = 'shoppingCartExtra';
UPDATE `PREFIX_hook` SET `name` = 'actionSearch' WHERE `name` = 'search';
UPDATE `PREFIX_hook` SET `name` = 'displayBeforePayment' WHERE `name` = 'backBeforePayment';
UPDATE `PREFIX_hook` SET `name` = 'actionCarrierUpdate' WHERE `name` = 'updateCarrier';
UPDATE `PREFIX_hook` SET `name` = 'actionOrderStatusPostUpdate' WHERE `name` = 'postUpdateOrderStatus';
UPDATE `PREFIX_hook` SET `name` = 'displayCustomerAccountFormTop' WHERE `name` = 'createAccountTop';
UPDATE `PREFIX_hook` SET `name` = 'displayBackOfficeHeader' WHERE `name` = 'backOfficeHeader';
UPDATE `PREFIX_hook` SET `name` = 'displayBackOfficeTop' WHERE `name` = 'backOfficeTop';
UPDATE `PREFIX_hook` SET `name` = 'displayBackOfficeFooter' WHERE `name` = 'backOfficeFooter';
UPDATE `PREFIX_hook` SET `name` = 'actionProductAttributeDelete' WHERE `name` = 'deleteProductAttribute';
UPDATE `PREFIX_hook` SET `name` = 'actionCarrierProcess' WHERE `name` = 'processCarrier';
UPDATE `PREFIX_hook` SET `name` = 'actionOrderDetail' WHERE `name` = 'orderDetail';
UPDATE `PREFIX_hook` SET `name` = 'displayBeforeCarrier' WHERE `name` = 'beforeCarrier';
UPDATE `PREFIX_hook` SET `name` = 'displayOrderDetail' WHERE `name` = 'orderDetailDisplayed';
UPDATE `PREFIX_hook` SET `name` = 'actionPaymentCCAdd' WHERE `name` = 'paymentCCAdded';
UPDATE `PREFIX_hook` SET `name` = 'displayProductComparison' WHERE `name` = 'extraProductComparison';
UPDATE `PREFIX_hook` SET `name` = 'actionCategoryAdd' WHERE `name` = 'categoryAddition';
UPDATE `PREFIX_hook` SET `name` = 'actionCategoryUpdate' WHERE `name` = 'categoryUpdate';
UPDATE `PREFIX_hook` SET `name` = 'actionCategoryDelete' WHERE `name` = 'categoryDeletion';
UPDATE `PREFIX_hook` SET `name` = 'actionBeforeAuthentication' WHERE `name` = 'beforeAuthentication';
UPDATE `PREFIX_hook` SET `name` = 'displayPaymentTop' WHERE `name` = 'paymentTop';
UPDATE `PREFIX_hook` SET `name` = 'actionHtaccessCreate' WHERE `name` = 'afterCreateHtaccess';
UPDATE `PREFIX_hook` SET `name` = 'actionAdminMetaSave' WHERE `name` = 'afterSaveAdminMeta';
UPDATE `PREFIX_hook` SET `name` = 'displayAttributeGroupForm' WHERE `name` = 'attributeGroupForm';
UPDATE `PREFIX_hook` SET `name` = 'actionAttributeGroupSave' WHERE `name` = 'afterSaveAttributeGroup';
UPDATE `PREFIX_hook` SET `name` = 'actionAttributeGroupDelete' WHERE `name` = 'afterDeleteAttributeGroup';
UPDATE `PREFIX_hook` SET `name` = 'displayFeatureForm' WHERE `name` = 'featureForm';
UPDATE `PREFIX_hook` SET `name` = 'actionFeatureSave' WHERE `name` = 'afterSaveFeature';
UPDATE `PREFIX_hook` SET `name` = 'actionFeatureDelete' WHERE `name` = 'afterDeleteFeature';
UPDATE `PREFIX_hook` SET `name` = 'actionProductSave' WHERE `name` = 'afterSaveProduct';
UPDATE `PREFIX_hook` SET `name` = 'actionProductListOverride' WHERE `name` = 'productListAssign';
UPDATE `PREFIX_hook` SET `name` = 'displayAttributeGroupPostProcess' WHERE `name` = 'postProcessAttributeGroup';
UPDATE `PREFIX_hook` SET `name` = 'displayFeaturePostProcess' WHERE `name` = 'postProcessFeature';
UPDATE `PREFIX_hook` SET `name` = 'displayFeatureValueForm' WHERE `name` = 'featureValueForm';
UPDATE `PREFIX_hook` SET `name` = 'displayFeatureValuePostProcess' WHERE `name` = 'postProcessFeatureValue';
UPDATE `PREFIX_hook` SET `name` = 'actionFeatureValueDelete' WHERE `name` = 'afterDeleteFeatureValue';
UPDATE `PREFIX_hook` SET `name` = 'actionFeatureValueSave' WHERE `name` = 'afterSaveFeatureValue';
UPDATE `PREFIX_hook` SET `name` = 'displayAttributeForm' WHERE `name` = 'attributeForm';
UPDATE `PREFIX_hook` SET `name` = 'actionAttributePostProcess' WHERE `name` = 'postProcessAttribute';
UPDATE `PREFIX_hook` SET `name` = 'actionAttributeDelete' WHERE `name` = 'afterDeleteAttribute';
UPDATE `PREFIX_hook` SET `name` = 'actionAttributeSave' WHERE `name` = 'afterSaveAttribute';
UPDATE `PREFIX_hook` SET `name` = 'actionTaxManager' WHERE `name` = 'taxManager';
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>blocklayered</name> <name>blocklayered</name>
<displayName><![CDATA[Layered navigation block]]></displayName> <displayName><![CDATA[Layered navigation block]]></displayName>
<version><![CDATA[1.4]]></version> <version><![CDATA[1.5]]></version>
<description><![CDATA[Displays a block with layered navigation filters.]]></description> <description><![CDATA[Displays a block with layered navigation filters.]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab> <tab><![CDATA[front_office_features]]></tab>
+1 -1
View File
@@ -64,7 +64,7 @@ class BlockMyAccount extends Module
$this->templateAssign(array( $this->templateAssign(array(
'voucherAllowed' => (int)Configuration::get('PS_VOUCHERS'), 'voucherAllowed' => (int)Configuration::get('PS_VOUCHERS'),
'returnAllowed' => (int)Configuration::get('PS_ORDER_RETURN'), 'returnAllowed' => (int)Configuration::get('PS_ORDER_RETURN'),
'HOOK_BLOCK_MY_ACCOUNT' => Module::hookExec('myAccountBlock'), 'HOOK_BLOCK_MY_ACCOUNT' => Hook::exec('myAccountBlock'),
)); ));
return $this->display(__FILE__, $this->name.'.tpl'); return $this->display(__FILE__, $this->name.'.tpl');
} }
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>cashticket</name> <name>cashticket</name>
<displayName><![CDATA[CashTicket]]></displayName> <displayName><![CDATA[CashTicket]]></displayName>
<version><![CDATA[1.3]]></version> <version><![CDATA[1.4]]></version>
<description><![CDATA[Accepts payments by CashTicket]]></description> <description><![CDATA[Accepts payments by CashTicket]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>dibs</name> <name>dibs</name>
<displayName><![CDATA[DIBS]]></displayName> <displayName><![CDATA[DIBS]]></displayName>
<version><![CDATA[1.1]]></version> <version><![CDATA[1.2]]></version>
<description><![CDATA[DIBS payment API]]></description> <description><![CDATA[DIBS payment API]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>moneybookers</name> <name>moneybookers</name>
<displayName><![CDATA[Moneybookers]]></displayName> <displayName><![CDATA[Moneybookers]]></displayName>
<version><![CDATA[1.6.1]]></version> <version><![CDATA[1.6.2]]></version>
<description><![CDATA[Accepts payments by Moneybookers.]]></description> <description><![CDATA[Accepts payments by Moneybookers.]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>ogone</name> <name>ogone</name>
<displayName><![CDATA[Ogone]]></displayName> <displayName><![CDATA[Ogone]]></displayName>
<version><![CDATA[2.2]]></version> <version><![CDATA[2.3]]></version>
<description><![CDATA[]]></description> <description><![CDATA[]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>paypal</name> <name>paypal</name>
<displayName><![CDATA[PayPal]]></displayName> <displayName><![CDATA[PayPal]]></displayName>
<version><![CDATA[2.8.2]]></version> <version><![CDATA[2.8.3]]></version>
<description><![CDATA[Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.]]></description> <description><![CDATA[Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+2 -2
View File
@@ -189,7 +189,7 @@ function submitAccount()
$context->cookie->logged = 1; $context->cookie->logged = 1;
$customer->logged = 1; $customer->logged = 1;
$context->cookie->email = $customer->email; $context->cookie->email = $customer->email;
Module::hookExec('createAccount', array( Hook::exec('createAccount', array(
'_POST' => $_POST, '_POST' => $_POST,
'newCustomer' => $customer 'newCustomer' => $customer
)); ));
@@ -238,7 +238,7 @@ function submitLogin()
$context->cookie->email = $customer->email; $context->cookie->email = $customer->email;
if (Configuration::get('PS_CART_FOLLOWING') AND (empty($context->cookie->id_cart) OR Cart::getNbProducts($context->cookie->id_cart) == 0)) if (Configuration::get('PS_CART_FOLLOWING') AND (empty($context->cookie->id_cart) OR Cart::getNbProducts($context->cookie->id_cart) == 0))
$context->cookie->id_cart = Cart::lastNoneOrderedCart($customer->id); $context->cookie->id_cart = Cart::lastNoneOrderedCart($customer->id);
Module::hookExec('authentication'); Hook::exec('authentication');
// Next ! // Next !
$payerID = strval(Tools::getValue('payerID')); $payerID = strval(Tools::getValue('payerID'));
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>paysafecard</name> <name>paysafecard</name>
<displayName><![CDATA[PaysafeCard]]></displayName> <displayName><![CDATA[PaysafeCard]]></displayName>
<version><![CDATA[1.3]]></version> <version><![CDATA[1.4]]></version>
<description><![CDATA[Accepts payments by PaysafeCard.]]></description> <description><![CDATA[Accepts payments by PaysafeCard.]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>