Jump to content

Edit AdminProductController


PanMS

Recommended Posts

Hi,

I am trying to create new MENU bar at the back office in the catalog folder.

I want to create it based on PRODUCT bar but with reduced functions to permit sellers to edit products with less permissions than it is possible by default.

 

That's why I created a new menu at the back office called FORSELLERS.

I copied the AdminProductController.php and renamed it to AdminFORSELLERSController.php

I created new folder in the admin/themes/default/template/controllers by copying products and renaming it to forsallers (in this folder I can edit tpl files to reduce functions of product menu of admin panel)

 

But it does not work, when loading the forsellers bar from the Admin panel menu an error appears:

 

Fatal error: Class 'AdminFORSELLERSController' not found in ...\www\classes\controller\Controller.php on line 128

The lines 126-129 are:

public static function getController($class_name, $auth = false, $ssl = false)
{
return new $class_name($auth, $ssl);
}

 

So what am I doing wrong?

Link to comment
Share on other sites

In my opinion - it's better to create new module than use core changes.

You can easily define where you want to create new tab in function install() in the module.

 

then create controller for module in separate file:

 

class myfirsttabController extends ModuleAdminController { }

Link to comment
Share on other sites

Hi Vekia, thanks for your answer.

I dont know php, so I've tried to avoid any php editing.

That is why i thought to achieve my aim just by copying php files and editing only tpl files.

I've found this article where a naked module core is developed in module you need. But it seems it works only for front office.

So is it possible to create module just by copying controller file to module folder?

PS I did not really get how to use the code in your previous post.

Edited by PanMS (see edit history)
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...