[*] 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:
@@ -517,7 +517,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'messages' => $messages,
|
||||
|
||||
// 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,
|
||||
|
||||
@@ -554,7 +554,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
$tpl_vars['last_orders'] =$this->getLastOrders();
|
||||
$tpl_vars['tips_optimization'] = $this->_displayOptimizationTips();
|
||||
|
||||
$HOOK_BACKOFFICEHOME = Module::hookExec('backOfficeHome');
|
||||
$HOOK_BACKOFFICEHOME = Hook::exec('backOfficeHome');
|
||||
$tpl_vars['HOOK_BACKOFFICEHOME'] = $HOOK_BACKOFFICEHOME;
|
||||
$smarty->assign($tpl_vars);
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ class AdminMetaControllerCore extends AdminController
|
||||
else
|
||||
$_POST['url_rewrite_'.$lang['id_lang']] = Tools::getValue('url_rewrite_1');
|
||||
}
|
||||
Module::hookExec('afterSaveAdminMeta');
|
||||
Hook::exec('afterSaveAdminMeta');
|
||||
}
|
||||
|
||||
return parent::postProcess();
|
||||
|
||||
@@ -364,14 +364,14 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$updProduct['stock_quantity'] = (int)($newProductQty);
|
||||
$product['stock_quantity'] = $updProduct['stock_quantity'];
|
||||
}
|
||||
Hook::updateQuantity($product, $order);
|
||||
Hook::exec('updateQuantity', array('product' => $product, 'order' => $order));
|
||||
}
|
||||
}
|
||||
|
||||
// Delete product
|
||||
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>';
|
||||
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)
|
||||
foreach ($customizationList AS $id_customization => $id_order_detail)
|
||||
@@ -397,7 +397,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->_errors[] = Tools::displayError('Cannot generate credit slip');
|
||||
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),
|
||||
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
|
||||
_PS_MAIL_DIR_, true);
|
||||
@@ -547,8 +547,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
// Assign Hook
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_INVOICE' => Module::hookExec('invoice', array('id_order' => $order->id)),
|
||||
'HOOK_ADMIN_ORDER' => Module::hookExec('adminOrder', array('id_order' => $order->id))
|
||||
'HOOK_INVOICE' => Hook::exec('invoice', array('id_order' => $order->id)),
|
||||
'HOOK_ADMIN_ORDER' => Hook::exec('adminOrder', array('id_order' => $order->id))
|
||||
));
|
||||
}
|
||||
public function ajaxProcessSearchCustomers()
|
||||
|
||||
@@ -328,7 +328,7 @@ class AdminProductsController extends AdminController
|
||||
$this->_errors[] = Tools::displayError('An error occurred while copying images.');
|
||||
else
|
||||
{
|
||||
Hook::addProduct($product);
|
||||
Hook::exec('addProduct', array('product' => $product));
|
||||
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));
|
||||
}
|
||||
@@ -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))
|
||||
$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);
|
||||
}
|
||||
else
|
||||
@@ -1081,7 +1081,7 @@ if (false)
|
||||
}
|
||||
|
||||
@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')))
|
||||
{
|
||||
self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image');
|
||||
Hook::updateProduct($object);
|
||||
Hook::exec('updateProduct', array('product' => $object));
|
||||
Search::indexation(false, $object->id);
|
||||
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)));
|
||||
@@ -1253,7 +1253,7 @@ if (false)
|
||||
$this->_errors[] = Tools::displayError('An error occurred while adding tags.');
|
||||
else if ($id_image = $this->addProductImage($object))
|
||||
{
|
||||
Hook::addProduct($object);
|
||||
Hook::exec('addProduct', array('product' => $object));
|
||||
Search::indexation(false, $object->id);
|
||||
|
||||
// Save and preview
|
||||
|
||||
@@ -118,8 +118,8 @@ class AuthControllerCore extends FrontController
|
||||
|
||||
// Call a hook to display more information on form
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'),
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop')
|
||||
'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop')
|
||||
));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
||||
}
|
||||
@@ -235,7 +235,7 @@ class AuthControllerCore extends FrontController
|
||||
*/
|
||||
protected function processSubmitLogin()
|
||||
{
|
||||
Module::hookExec('beforeAuthentication');
|
||||
Hook::exec('beforeAuthentication');
|
||||
$passwd = trim(Tools::getValue('passwd'));
|
||||
$email = trim(Tools::getValue('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_invoice = Address::getFirstCustomerAddressId((int)($customer->id));
|
||||
$this->context->cart->update();
|
||||
Module::hookExec('authentication');
|
||||
Hook::exec('authentication');
|
||||
|
||||
// Login information have changed, so we check if the cart rules still apply
|
||||
CartRule::autoRemoveFromCart();
|
||||
@@ -352,7 +352,7 @@ class AuthControllerCore extends FrontController
|
||||
$this->updateContext($customer);
|
||||
|
||||
$this->context->cart->update();
|
||||
Module::hookExec('createAccount', array(
|
||||
Hook::exec('createAccount', array(
|
||||
'_POST' => $_POST,
|
||||
'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
|
||||
$this->context->cart->update();
|
||||
Module::hookExec('createAccount', array(
|
||||
Hook::exec('createAccount', array(
|
||||
'_POST' => $_POST,
|
||||
'newCustomer' => $customer
|
||||
));
|
||||
@@ -581,4 +581,4 @@ class AuthControllerCore extends FrontController
|
||||
$customer->firstname.' '.$customer->lastname
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@ class CartControllerCore extends FrontController
|
||||
}
|
||||
$result['summary'] = $this->context->cart->getSummaryDetails();
|
||||
$result['customizedDatas'] = Product::getAllCustomizedDatas($this->context->cart->id, null, true);
|
||||
$result['HOOK_SHOPPING_CART'] = Module::hookExec('shoppingCart', $result['summary']);
|
||||
$result['HOOK_SHOPPING_CART_EXTRA'] = Module::hookExec('shoppingCartExtra', $result['summary']);
|
||||
$result['HOOK_SHOPPING_CART'] = Hook::exec('shoppingCart', $result['summary']);
|
||||
$result['HOOK_SHOPPING_CART_EXTRA'] = Hook::exec('shoppingCartExtra', $result['summary']);
|
||||
|
||||
// Display reduced price (or not) without quantity discount
|
||||
if (Tools::getIsset('getproductprice'))
|
||||
|
||||
@@ -162,7 +162,7 @@ class CategoryControllerCore extends FrontController
|
||||
public function assignProductList()
|
||||
{
|
||||
$hookExecuted = false;
|
||||
Module::hookExec('productListAssign', array(
|
||||
Hook::exec('productListAssign', array(
|
||||
'nbProducts' => &$this->nbProducts,
|
||||
'catProducts' => &$this->cat_products,
|
||||
'hookExecuted' => &$hookExecuted,
|
||||
|
||||
@@ -159,7 +159,7 @@ class CompareControllerCore extends FrontController
|
||||
'width' => $width,
|
||||
'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));
|
||||
if ($carrier->url && $order->shipping_number)
|
||||
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Hook::exec('orderDetailDisplayed', array('order' => $order)));
|
||||
Hook::exec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -35,7 +35,7 @@ class IndexControllerCore extends FrontController
|
||||
*/
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class MyAccountControllerCore extends FrontController
|
||||
'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')),
|
||||
'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');
|
||||
}
|
||||
|
||||
@@ -192,8 +192,8 @@ class OrderDetailControllerCore extends FrontController
|
||||
));
|
||||
if ($carrier->url && $order->shipping_number)
|
||||
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Hook::exec('orderDetailDisplayed', array('order' => $order)));
|
||||
Hook::exec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
|
||||
unset($carrier, $addressInvoice, $addressDelivery);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class OrderFollowControllerCore extends FrontController
|
||||
$orderReturn->state = 1;
|
||||
$orderReturn->add();
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
{
|
||||
$return = array(
|
||||
'summary' => $this->context->cart->getSummaryDetails(),
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
|
||||
'HOOK_PAYMENT' => $this->_getPaymentMethods()
|
||||
);
|
||||
die(Tools::jsonEncode($return));
|
||||
@@ -84,7 +84,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
{
|
||||
$this->context->cookie->checkedTOS = (int)(Tools::getValue('checked'));
|
||||
die(Tools::jsonEncode(array(
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
|
||||
'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'),
|
||||
'block_user_info' => (isset($blockUserInfo) ? $blockUserInfo->hookTop(array()) : ''),
|
||||
'carrier_list' => $this->_getCarrierList(),
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
|
||||
'HOOK_PAYMENT' => $this->_getPaymentMethods(),
|
||||
'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))))
|
||||
@@ -190,7 +190,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100)));
|
||||
$result = array_merge($result, array(
|
||||
'summary' => $this->context->cart->getSummaryDetails(),
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
|
||||
'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))))
|
||||
));
|
||||
@@ -256,8 +256,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
));
|
||||
/* Call a hook to display more information on form */
|
||||
self::$smarty->assign(array(
|
||||
'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'),
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop')
|
||||
'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop')
|
||||
));
|
||||
$years = Tools::dateYears();
|
||||
$months = Tools::dateMonths();
|
||||
@@ -333,7 +333,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'carriers' => $carriers,
|
||||
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')),
|
||||
'HOOK_EXTRACARRIER' => NULL,
|
||||
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers))
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers))
|
||||
));
|
||||
}
|
||||
else
|
||||
@@ -343,7 +343,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
protected function _assignPayment()
|
||||
{
|
||||
$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()
|
||||
));
|
||||
}
|
||||
@@ -389,7 +389,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
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 = Module::hookExecPayment();
|
||||
$return = Hook::exec('payment');
|
||||
if (!$return)
|
||||
return '<p class="warning">'.Tools::displayError('No payment method is available').'</p>';
|
||||
return $return;
|
||||
@@ -412,8 +412,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$result = array(
|
||||
'checked' => $this->_setDefaultCarrierSelection($carriers),
|
||||
'carriers' => $carriers,
|
||||
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)),
|
||||
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address_delivery))
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers)),
|
||||
'HOOK_EXTRACARRIER' => Hook::exec('extraCarrier', array('address' => $address_delivery))
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
else if (!$this->context->cart->isVirtualCart() && (int)(Tools::getValue('id_carrier')) == 0)
|
||||
$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())
|
||||
return false;
|
||||
@@ -293,8 +293,8 @@ class ParentOrderControllerCore extends FrontController
|
||||
'currencyFormat' => $this->context->currency->format,
|
||||
'currencyBlank' => $this->context->currency->blank));
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary),
|
||||
'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary)
|
||||
'HOOK_SHOPPING_CART' => Hook::exec('shoppingCart', $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'))
|
||||
));
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)),
|
||||
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers))
|
||||
'HOOK_EXTRACARRIER' => Hook::exec('extraCarrier', array('address' => $address)),
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('beforeCarrier', array('carriers' => $carriers))
|
||||
));
|
||||
}
|
||||
|
||||
@@ -419,8 +419,8 @@ class ParentOrderControllerCore extends FrontController
|
||||
protected function _assignPayment()
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_PAYMENT' => Module::hookExecPayment()
|
||||
'HOOK_TOP_PAYMENT' => Hook::exec('paymentTop'),
|
||||
'HOOK_PAYMENT' => Hook::exec('payment'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -178,12 +178,12 @@ class ProductControllerCore extends FrontController
|
||||
'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),
|
||||
'last_qties' => (int)Configuration::get('PS_LAST_QTIES'),
|
||||
'HOOK_EXTRA_LEFT' => Module::hookExec('extraLeft'),
|
||||
'HOOK_EXTRA_RIGHT' => Module::hookExec('extraRight'),
|
||||
'HOOK_PRODUCT_OOS' => Hook::productOutOfStock($this->product),
|
||||
'HOOK_PRODUCT_ACTIONS' => Module::hookExec('productActions'),
|
||||
'HOOK_PRODUCT_TAB' => Module::hookExec('productTab'),
|
||||
'HOOK_PRODUCT_TAB_CONTENT' => Module::hookExec('productTabContent'),
|
||||
'HOOK_EXTRA_LEFT' => Hook::exec('extraLeft'),
|
||||
'HOOK_EXTRA_RIGHT' => Hook::exec('extraRight'),
|
||||
'HOOK_PRODUCT_OOS' => Hook::exec('productOutOfStock', array('product' => $this->product)),
|
||||
'HOOK_PRODUCT_ACTIONS' => Hook::exec('productActions'),
|
||||
'HOOK_PRODUCT_TAB' => Hook::exec('productTab'),
|
||||
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('productTabContent'),
|
||||
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
|
||||
'display_ht' => !Tax::excludeTaxeOption(),
|
||||
'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('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)
|
||||
|
||||
@@ -64,7 +64,7 @@ class SearchControllerCore extends FrontController
|
||||
$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));
|
||||
$this->p = abs((int)(Tools::getValue('p', 1)));
|
||||
$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'];
|
||||
$this->pagination($nbProducts);
|
||||
$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->p = abs((int)(Tools::getValue('p', 1)));
|
||||
$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'];
|
||||
$this->pagination($nbProducts);
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -96,7 +96,7 @@ class SearchControllerCore extends FrontController
|
||||
$nbProducts = (int)(Search::searchTag($this->context->language->id, $tag, true));
|
||||
$this->pagination($nbProducts);
|
||||
$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(
|
||||
'search_tag' => $tag,
|
||||
'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)
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user