Monday 8 June 2015

How to make custom page in opencart

1) Create a new file in admin/controller/custom/helloworld.php

helloworld.php
load->model(‘custom/hello’);
$this->template = ”.$template.”;
$this->children = array(
‘common/header’,
‘common/footer’
);
$this->response->setOutput($this->render());
}
}
?>

2) Create a new file in admin/view/template/custom/hello.tpl

Hello.tpl

HelloWorld

3) Create a new file in admin/model/custom/hello.php

hello.php

db->query($sql);
return $query->row[‘total’];
}
}
?>

4) You then need to enable the plugin to avoid permission denied errors:

Opencart > Admin > Users > User Groups > Admin > Edit

http://www.example.com/opencart/admin/index.php?route=custom/helloworld


No comments:

Post a Comment