首页 > 解决方案 > 如何在管理员 opencart 3 中创建自定义页面

问题描述

我正在尝试在 opencart 管理部分下创建一个自定义管理页面。但是由于任何原因它不起作用,任何人都可以帮忙吗?

我在 admin/controller/catalog/filterproducts.php 下创建了控制器文件,代码是:

<?php
class ControllerCatalogFilterProducts extends Controller {
  public function index() {
    $this->load->language('catalog/filterproducts');

    $data['heading_title'] = $this->language->get('heading_title'); 
    return $this->load->view('catalog/filter_products.tpl', $data);
  }
}

在 admin/view/template/catalog/filter_products.tpl 我有如下代码:

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title"><i class="fa fa-users"></i> <?php echo $heading_title; ?></h3>
  </div>
  <div class="table-responsive">
    <table class="table">
      <thead>
        <tr>
          <td class="text-right">SrNo</td>
          <td>Product Name</td>
          <td>Quantity</td>
          <td>Price</td>
        </tr>
      </thead>
      <tbody>
                <tr>
                  <td class="text-right">1</td>
                  <td>Test Product</td>
                  <td>1</td>
                  <td>$1.00</td>
                </tr>
      </tbody>
    </table>
  </div>
</div>

以及我在 admin/language/en-gb/catalog/filterproducts.php 中的最后一个文件,其中包含代码:

<?php
// Heading
$_['heading_title']          = 'Filter Products';

标签: opencartopencart-3opencart-module

解决方案


推荐阅读