当然。我认为最好的方法是制作一个专用的页面模块。我要做的第一件事是备份或进入我的开发环境。
编辑header.tpl
(取决于我不知道 ThingsForCuties 主题)
基本上在他们联系我们之后添加一个链接
/index.php?route=page/calc (您可以稍后使用 .htaccess 进行重写)
OpenCart 是 MVC,因此可以使用模型、控制器视图。
制作以下文件。
/catalog/view/theme/{cuties}/template/calc.tpl
<?php echo $header; ?>
<div class="category_header">
<header>
<h1>Baby Form</h1>
<p>My, JS, HTML5 and a little PHP can go here..</p>
</header>
</div>
<div class="content_stylist">
<?php echo $footer; ?>
/目录/控制器/calc.php
<?php
class ControllerCalc extends Controller{
public function index(){
$this->language->load('information/information');
$this->load->model('catalog/information');
$this->template = 'default/template/calc.tpl';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . 'default/template/calc.tpl')) {
$this->template = $this->config->get('config_template') . 'default/template/calc.tpl';
} else {
$this->template = 'default/template/calc.tpl';
}
$this->children = array(
'common/header',
'common/footer'
);
$this->response->setOutput($this->render());
}
function calc(){
// place functions within the class if need
}
}
function external_sample(){
// you can have external php too outside the OC framework
}
?>
请参阅我在自定义管理页面上的帖子,该帖子相同并且包含权限问题。正如我之前提到的,您现在可以访问 index.php?route=page/calc 并尝试您的代码,并且会看到它很好地嵌入。
这里发布了广泛的教程。
自定义页面
opencart php自定义页面不使用“信息”功能
http://forum.opencart.com/viewtopic.php?t=59542
http://www.kvcodes.com/2013/10/create-custom-admin-page-open-cart/
管理页面 tut
如何在 opencart 中创建自定义管理页面?