dambie Posted March 27, 2013 Share Posted March 27, 2013 (edited) How override AdminHomeController.php and add custom quick links ? I put this in override\controllers\admin\AdminHomeController.php but doesn't work class AdminHomeController extends AdminHomeControllerCore { public function getQuickLinks() { //rest code Edited March 27, 2013 by dambie (see edit history) Link to comment Share on other sites More sharing options...
Terragg Posted March 27, 2013 Share Posted March 27, 2013 From just that snippet, you may want to maintain the protected status of the original method until you know what's invoking it. Also, start by invoking the parent::getQuickLinks() then add your links to the $quick_links array that it returns. This is from v1.5.2: protected function getQuickLinks() { $quick_links = array(); [...] If you override, then invoke the parent the first line there will blitz all your work... Posting your entire getQuickLinks() method may help in helping you. HTH, Link to comment Share on other sites More sharing options...
dambie Posted March 28, 2013 Author Share Posted March 28, 2013 My code: override\controllers\admin\AdminHomeController.php but doesn't work. class AdminHomeController extends AdminHomeControllerCore { protected function getQuickLinks() { $quick_links = array(); $profile_access = Profile::getProfileAccesses($this->context->employee->id_profile); if ($profile_access[(int)Tab::getIdFromClassName('AdminStats')]['view']) $quick_links['first'] = array( 'href' => $this->context->link->getAdminLink('AdminStats').'&module=statsbestproducts', 'title' => $this->l('Recently sold products.'), 'description' => $this->l('11Create a new category and organize your catalog.'), ); return $quick_links; } } Link to comment Share on other sites More sharing options...
Terragg Posted March 28, 2013 Share Posted March 28, 2013 Well, I installed your code as is on my shop and it works as expected - the single quick link shows up. If you want to edit the drop down menu, check the thread from late last year: Quick Links in Prestashop back office There's directions to do that as well. HTH, Link to comment Share on other sites More sharing options...
dambie Posted March 29, 2013 Author Share Posted March 29, 2013 (edited) Today, for me it works Edited March 29, 2013 by dambie (see edit history) Link to comment Share on other sites More sharing options...
Terragg Posted March 29, 2013 Share Posted March 29, 2013 Sounds like it was cached. If you're going to be doing any development, make sure to turn off all caching: Advanced Parameters > Performance : Smarty Advanced Parameters > Performance : Cache HTH, Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now