shahil512 Posted June 15, 2013 Share Posted June 15, 2013 We need to create new menu similar to order menu in back office. Please explain in detail or with video how to do it. We already created new menu, but after creating it - it says - " The controller admin not found is missing or in valid " Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 you need to create: 1) module or 2) admin controller here is a thread about admin tabs: http://www.prestasho...-tabs-mvc-work/ and here is an example of working admin tabs module: https://github.com/P...ter/example.php Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Thanks Vekia, i am not able to get View Folder in prestashop. Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 hello what you mean by that? You arent able to log in to the ftp and to browse your prestashop directories? Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Hi, i am working in my local server and i downloaded all files from prestashop site. So i need to know where is view folder. When the module will work in local server, i will upload it to site. Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Can any one help me? Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 sorry but i still don't know what you expect. what you mean by view folder? you're talking about template files of modules? or what? Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Thanks, you have provided me this links: http://www.prestashop.com/forums/topic/157626-how-does-admin-tabs-mvc-work/ Now, where is view folder, - Create views in /views/admin/<tabName>/, in module folder. The default view name is "content" Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 what ps version you use? everything depends on it, because views folder is related to the prestashop 1.5.x Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Hi, i am using latest version. I downloaded it from their site. Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 ... now everyhing is clear for me. You have to create own module, with own files. you need to be familiar in php / smarty all informations related to this case are in the urls that i pasted above Link to comment Share on other sites More sharing options...
shahil512 Posted June 15, 2013 Author Share Posted June 15, 2013 Thanks, actually we build controller and it is showing blank page with message as : " The controller admin not found is missing or in valid " So do you mean we have to do remaining job. Our team knows php and smarty so it is not an issue. Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 let's start from the beginning you created new position in the menu, right? now you have to create controller for this. you need to create controller file and move it to the controllers/admin directory. make sure that controller name (also file) is exactly the same as you defined in the menu Link to comment Share on other sites More sharing options...
hans.m Posted June 17, 2013 Share Posted June 17, 2013 Hi, I'm experiencing the same issue. Could someone please explain? Cheers Link to comment Share on other sites More sharing options...
vekia Posted June 17, 2013 Share Posted June 17, 2013 just follow the guides that i mentioned above.... you'e got there WORKING example of the admin tab. Link to comment Share on other sites More sharing options...
shahil512 Posted June 19, 2013 Author Share Posted June 19, 2013 Thanks Vekia, we did everything as per the details you have provided. We almost completed 95% job. Now we have the following queries: 1) In list view - if we put custom button - and how to apply custom function to it? We need to click on button and there we need to write function which will update database. After database is updated, it should be redirect to list view. Link to comment Share on other sites More sharing options...
vekia Posted June 19, 2013 Share Posted June 19, 2013 so, you've got now module / own controller in this case, you can create button in your .tpl file then in php files (for example in the init function) you can check if the button was send: if (tools::getValue('yourbuttonname')){ YOUR_ACTION_HERE } Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) Thanks, we created admin menu from this link: http://doc.prestashop.com/display/PS14/Creating+a+PrestaShop+module I need to do image for operation on click, how it is possible? In our module, we don't have init method. We also don't have .tpl files. Edited June 20, 2013 by shahil512 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 .... this is tut for 1.4 have you got own tab in back offie? have you got controller for it? (separate php file) Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 Yes to both your questions. Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 so, in your controller file you've got function: public function display(){ } you can put there something like: if (isset($_POST['your_button'])){ $this->dosomething(); } Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 Hi, our prestashop version is 1.5. We are not using 1.4 Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 so in the controler you should have got something like this : public function renderList(){ } you can use if condition in this function. Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 Hi, here i my file. ------------------- <?php include_once( PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminInPost extends AdminTab { public function __construct() { $this->table = 'restapi'; $this->className = 'InPost'; $this->lang = false; //$this->addRowAction('view'); $this->edit = false; $this->delete = false; //$this->addRowAction('delete'); $this->fieldsDisplay = array( 'sr_num' => array( 'title' => $this->l('Serial No'), 'align' => 'center', 'width' => 25), 'parcel_id' => array( 'title' => $this->l('Carrier PID'), 'width' => 200), 'payment_status' => array( 'title' => $this->l('Payment Status'), 'align' => 'center', 'width' => 25), 'dest_city' => array( 'title' => $this->l('Destination'), 'width' => 200), 'machine' => array( 'title' => $this->l('Machine'), 'width' => 200), 'email' => array( 'title' => $this->l('Email'), 'width' => 200), 'mobile' => array( 'title' => $this->l('Mobile'), 'width' => 100), 'parcel_size' => array( 'title' => $this->l('Parcel Size'), 'align' => 'center', 'width' => 100), 'id_img' => array( 'title' => $this->l('Action'), 'prefix' => '<a href="index.php?controller=AdminInPost&token=a85e8ea89d91ff0e2840f02aaaa75c9d&diaplay">', 'suffix' => '<img src="../img/admin/note.png" name="imgclick"></a>', // replace with Constant from config 'align' => 'center', 'width' => 100) ); $this->identifier = 'sr_num'; parent::__construct(); } public function diaplay(){ if (tools::getValue('imgclick')){ echo "rachit"; die('called'); } } public function displayForm() { global $currentIndex; $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(); $obj = $this->loadObject(true); echo ' <script type="text/javascript"> id_language = Number('.$defaultLanguage.'); </script>'; } } ?> Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 just create function that i mentioned. btw. public function diaplay(){ if (tools::getValue('imgclick')){ echo "rachit"; die('called'); } } doesn't work? Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 Hi, we don't have tpl file. We already put function you told but it is not working. Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 there is no render list function Link to comment Share on other sites More sharing options...
shahil512 Posted June 20, 2013 Author Share Posted June 20, 2013 yes, we don't have list function. Link to comment Share on other sites More sharing options...
longip Posted June 30, 2013 Share Posted June 30, 2013 is there any module that does this ? Link to comment Share on other sites More sharing options...
vekia Posted June 30, 2013 Share Posted June 30, 2013 is there any module that does this ? what you mean by "this" ? what you exactly expect? Link to comment Share on other sites More sharing options...
longip Posted July 1, 2013 Share Posted July 1, 2013 a module to create aditional tabs (similar to Orders, Catalog etc), aditional sub-tabs and tabs for product (similar to combinations, associations etc). 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