Jump to content

Not showing $toolbar_btn in admin toolbar


Dmoelia

Recommended Posts

Hi everybody,

 

I'm basicly new to prestashop and advance software developer, we've developed a payment module in prestashop, but I don't know why is not showing toolbar buttons in the "Order View" at the toolbar (green section top right) in the new prestashop 1.6 Everything is working cool in 1.5

 

class AdminOrdersController extends AdminOrdersControllerCore{
....
public function initToolbar()
    {
        if ($this->display == 'view' && $this->_order->module == 'mymodule')
        {
            if ($this->_mymodule->isOrderComplete($this->_order)) {
                $this->toolbar_btn['refund_mymodule'] = array(
                    'short' => $this->l('Text text text'),
                    'href' => self::$currentIndex.'&id_order='.$this->_order->id.'&vieworder&refund_mymodule=1&token='.$this->token,
                    'desc' => $this->l('Refund to mymodule'),
                    'class' => 'process-icon-standardRefund mymodule-refund',
                );
                $this->toolbar_btn['refund_mymodule_partial'] = array(
                    'short' => 'Refund partial payment to customer mymodule account',
                    'href' => '#',
                    'desc' => $this->l('Partial refund to mymodule'),
                    'class' => 'process-icon-partialRefund',
                );
                //everything goes right till here
            }
        }


        parent::initToolbar();


        if ($this->display == 'view' && $this->_order->module == 'mymodule')
            unset($this->toolbar_btn['partial_refund']);
    }
}

Dumping the code shows me that button is loaded by the controller in the code above, but It never get printed in the toolbar.

 

Can anyone help me?
 

Thanks in advance people!

Link to comment
Share on other sites

×
×
  • Create New...