For this, you need to download Simple HTML Module first here http://www.opencart.com/index.php?route ... ion_id=396
because this is based on this module.
This is to show that you can easily make your own module as long as it is based on html code. For this example I will make Yahoo Pingbox module and it is easily configured for other like instant messanging status, counter, ads, announcement, etc.
Before we start you also need Yahoo Pingbox code, if you haven't yet you can get it here http://messenger.yahoo.com/pingbox/
Ok lets start.
1. extract simple HTML module and you will get these files
mymodule\admin\controller\module\mymodule.php
mymodule\admin\language\english\module\mymodule.php
mymodule\admin\view\template\module\mymodule.tpl
mymodule\catalog\controller\module\mymodule.php
mymodule\catalog\language\english\module\mymodule.php
mymodule\catalog\view\theme\default\template\module\mymodule.tpl
2. rename all files to your module name. For this I rename mymodule to yahoo_pingbox so the files become
yahoo_pingbox\admin\controller\module\yahoo_pingbox.php
yahoo_pingbox\admin\language\english\module\yahoo_pingbox.php
yahoo_pingbox\admin\view\template\module\yahoo_pingbox.tpl
yahoo_pingbox\catalog\controller\module\yahoo_pingbox.php
yahoo_pingbox\catalog\language\english\module\yahoo_pingbox.php
yahoo_pingbox\catalog\view\theme\default\template\module\yahoo_pingbox.tpl
3. open yahoo_pingbox\admin\controller\module\yahoo_pingbox.php on line 2 rename MyModule to YahooPingbox
before : class ControllerModuleMyModule extends Controller {
after : class ControllerModuleYahooPingbox extends Controller {
search text mymodule and replace it with yahoo_pingbox
4. open yahoo_pingbox\admin\language\english\module\yahoo_pingbox.php
search text My Module and replace it with Yahoo Pingbox
search text HTML Code to Yahoo Pingbox Code
5. open yahoo_pingbox\admin\view\template\module\yahoo_pingbox.tpl
search text mymodule and replace it with yahoo_pingbox
6. open yahoo_pingbox\catalog\controller\module\yahoo_pingbox.php on line 2 rename MyModule to YahooPingbox
before : class ControllerModuleMyModule extends Controller {
after : class ControllerModuleYahooPingbox extends Controller {
7.open yahoo_pingbox\catalog\language\english\module\yahoo_pingbox.php
replace text My HTML Module with Yahoo Pingbox
8. no need to change yahoo_pingbox\catalog\view\theme\default\template\module\yahoo_pingbox.tpl
That's it. Upload to your opencart, install and enable it from admin area. Just paste the code from yahoo pingbox to the yahoo pingbox code area.
Now if you want to make other module, for example module to show ads just follow the above step accordingly.
Note: if your site multilingual, don't forget to make the language file too.
Cheers
Hi, thanks for this module and guide, I love it. But I cannot get the latest version to work (v1.3 02/02/2010).
When I add a title and content in the admin section, it will not show up on the front end - it will only display default values.
The previous version works fine (v1.1 28/01/2010).
When I add a title and content in the admin section, it will not show up on the front end - it will only display default values.
The previous version works fine (v1.1 28/01/2010).
Well that's strange, it seems ok in my caseBen wrote:When I add a title and content in the admin section, it will not show up on the front end - it will only display default values.
The previous version works fine (v1.1 28/01/2010).
Before you judge a book by its cover, you've got to flip through the pages
You need to amend your instructions:
And add:6. open yahoo_pingbox\catalog\controller\module\yahoo_pingbox.php on line 2 rename MyModule to YahooPingbox
before : class ControllerModuleMyModule extends Controller {
after : class ControllerModuleYahooPingbox extends Controller {
so it reads:search text mymodule and replace it with yahoo_pingbox
Otherwise if you have another of your modules installed it will want to use the content from that module.6. open yahoo_pingbox\catalog\controller\module\yahoo_pingbox.php on line 2 rename MyModule to YahooPingbox
before : class ControllerModuleMyModule extends Controller {
after : class ControllerModuleYahooPingbox extends Controller {
search text mymodule and replace it with yahoo_pingbox
Brad G
Granbury, Texas
OC 1.5.6.4
Who is online
Users browsing this forum: No registered users and 57 guests