franklinfs Posted December 16, 2013 Share Posted December 16, 2013 (edited) Hi, I want to add one icon in prestashop administrator. Which hook is used to display a icon from back end in prestashop 1.5.4.1 For example in product details page normally four icons are there. They are like Add product, Back to List, Modules List , Help. I need to add one more icon there. So which hook is used to add a icon. Edited December 23, 2013 by franklinfs (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted December 16, 2013 Share Posted December 16, 2013 It depends on which page you want to add it. Is it a controller or module? Link to comment Share on other sites More sharing options...
franklinfs Posted December 17, 2013 Author Share Posted December 17, 2013 Hai thanks for your reply. Actually i want to show the icon in Order details page in the admin side. I am using one module. When i install the module i want to show the icon in the above page. Also i need to show the icon only this page. Now i am using the hook "DisplayAdminOrder"....... Link to comment Share on other sites More sharing options...
NemoPS Posted December 17, 2013 Share Posted December 17, 2013 I'm not sure it can be done from a module to a controller page. In your case, I think you have to add a new button here, on adminorderscontroller.php, in the inittoolbar method: public function initToolbar() { if ($this->display == 'view') { $order = new Order((int)Tools::getValue('id_order')); if ($order->hasBeenShipped()) $type = $this->l('Return products'); elseif ($order->hasBeenPaid()) $type = $this->l('Standard refund'); else $type = $this->l('Cancel products'); if (!$order->hasBeenShipped() && !$this->lite_display) $this->toolbar_btn['new'] = array( 'short' => 'Create', 'href' => '#', 'desc' => $this->l('Add a product'), 'class' => 'add_product' ); if (Configuration::get('PS_ORDER_RETURN') && !$this->lite_display) $this->toolbar_btn['standard_refund'] = array( 'short' => 'Create', 'href' => '', 'desc' => $type, 'class' => 'process-icon-standardRefund' ); if ($order->hasInvoice() && !$this->lite_display) $this->toolbar_btn['partial_refund'] = array( 'short' => 'Create', 'href' => '', 'desc' => $this->l('Partial refund'), 'class' => 'process-icon-partialRefund' ); } $res = parent::initToolbar(); if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && isset($this->toolbar_btn['new']) && Shop::isFeatureActive()) unset($this->toolbar_btn['new']); return $res; } Link to comment Share on other sites More sharing options...
franklinfs Posted December 17, 2013 Author Share Posted December 17, 2013 Hi, I used this hook and display the button in top portion. !$this->registerHook('displayBackOfficeTop') public function hookDisplayBackOfficeTop($param) { global $smarty; $this->smarty->assign('order_id', $_GET['id_order']); return $this->display(__FILE__, 'abc.tpl'); } Any way thanks for your reply Link to comment Share on other sites More sharing options...
NemoPS Posted December 17, 2013 Share Posted December 17, 2013 hm...that seems like a 1.4 syntax actually But if it works, okay, never tried it! Link to comment Share on other sites More sharing options...
franklinfs Posted December 24, 2013 Author Share Posted December 24, 2013 (edited) How do i add the code in adminorderscontroller.php file . Because i dont want to edit the core files. Edited December 26, 2013 by franklinfs (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts