2

I am trying to develop a module in opencart 3.0.2.0. I have created a new basic file in controller\extension\module\sellerlist.php.

    class ControllerExtensionModuleSellerlist extends Controller {
    public function index() {
return $this->load->view('extension/module/sellerlist');
    }
}

Then I created a view file in catalog\view\theme\default\template\extension\module\sellerlist.twig

I have created admin file with class ControllerExtensionModuleSellerlist in admin\controller\extension\module\sellerlist.php And created a view file in admin\view\template\extension\module\sellerlist.twig

When I checked in admin panel --> extension --> module, I couldn't find my new module in that list.

What could be the reason for that? Thanks for any help.

hakkim
  • 666
  • 15
  • 36
  • 2
    Did you create files in admin side too? – Radhika Apr 23 '18 at 12:35
  • no.. should i create the same files there too??? – hakkim Apr 23 '18 at 13:04
  • I have created a new file with 'class ControllerExtensionModuleSellerlist' in admin\controller\extension\module\sellerlist.php And created a view file in 'admin\view\template\extension\module\sellerlist.twig' – hakkim Apr 23 '18 at 13:11
  • May I have a look of your controller code? – Radhika Apr 24 '18 at 04:44
  • I have managed to make it work.. I have created the admin files and did some tweaks in file structure... Thanks for your support.. (Y) – hakkim Apr 25 '18 at 04:40

2 Answers2

2

Did you forget to create the admin language file for it?

There is material on the web to show you all the files needed for it. This blog is a popular one: https://webkul.com/blog/create-first-basic-module-opencart/

You need all three of these files: language, controller and view files in the admin side .

If you don't have the language file, then there is no way you will even see the module listed to select it.

admin/language/extension/module/sellerlist.php

<?php

// Heading
$_['heading_title']    = 'Seller List';

$_['text_module']      = 'Modules';
$_['text_success']     = 'Success: You have modified "Seller List" module!';
$_['text_edit']        = 'Edit "Seller List" Module';

// Entry
$_['entry_status']     = 'Status';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify "Seller List" module!';
Nancy
  • 522
  • 4
  • 15
0

FYI if someone needs custom module to appear in layout assignment area, create new entry in oc_modules (oc, or whatever your prefix is for DB tables).

temo
  • 612
  • 1
  • 9
  • 25