Jump to content

Which hook is used to display a icon from back end


Recommended Posts

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.

post-641113-0-34457500-1387799890_thumb.png

Edited by franklinfs (see edit history)
Link to comment
Share on other sites

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

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

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

×
×
  • Create New...