Jump to content

Remove Add button


Terrans

Recommended Posts

Don't know how, but very curious as to why you want to do that?

 

If it is to stop certain back office users from adding modules, then you can do that with Administration > Permissions

Link to comment
Share on other sites

If you indeed need to remove, you can do it in (at least) two ways:

 

Really take out the button:

You have to edit each admin controller, like:

/controllers/admin/AdminProductsController.php

 

In there you have a function:

public function initPageHeaderToolbar()
 
Here the button is defined.
 
/*     <-- add comment code
if (empty($this->display))
    $this->page_header_toolbar_btn['new_product'] = array(
        'href' => self::$currentIndex.'&addproduct&token='.$this->token,
        'desc' => $this->l('Add new product', null, null, false),
        'icon' => 'process-icon-new'
    );
*/  <-- add comment-out code
 
 
 
Just out-comment the definition and you'll be ok. There are, however, many files to change.
 
 
Maybe easier to just add some css code to "hide" it? Not as safe as removing it really (anyone with some css knowledge may turn it back on) If that's not a main concern, then this is probably the easier way:
 
 
Add to your themes/<your admin folder>/themes/default/css/admin-theme.css the following line:
 
.panel-heading .panel-heading-action a:first-child {

    display: none;

}
 
This 'should' take it out everywhere, but please check :-)
 
Final way could be to add some little javascript to the main admin controller, where after loading you remove the button. (But also here, this is less safe than don't adding it in the first place)
 
My 2 cents,
pascal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...