我正在寻找一种在管理员中为我的信息页面添加字段的方法。我只需要在管理员中使用它,而不是希望在前端显示任何来自该字段的数据。
为了更好地解释我的信息页面的列表页面设置如下:
Information Title | Sort Order | Action
我想添加一个识别信息,它将显示在 admin 中的标题之前,以便一目了然,我可以查看并查看该信息页面分配给哪个商店(我正在运行多商店)。我猜需要将实际字段添加到添加/编辑表单中,然后以某种方式告知在列表页面上显示该字段输入。
我确实安装了 vQmod 并查看了文档,但我无法解决这个问题。
我真的很感激这方面的任何帮助。
这是来自 information.php 的代码。
<?php
class ModelCatalogInformation extends Model {
public function getInformation($information_id) {
$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1'");
//return $query->row;
$r = $query->row;
$r['title'] = preg_replace('/ ## .+/','',$r['title']);
return $r;
}
public function getInformations() {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC");
//return $query->rows;
$result = $query->rows;
foreach ($result as $key => $r){
$result[$key] = preg_replace('/ ## .+/','',$r['title']);
}
return $result;
}
public function getInformationLayoutId($information_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information_to_layout WHERE information_id = '" . (int)$information_id . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "'");
if ($query->num_rows) {
return $query->row['layout_id'];
} else {
return $this->config->get('config_layout_information');
}
}
}
?>
当您提到检查 vQmod 缓存时,我突然意识到我正在使用一个通过使用 -1 排序顺序从菜单中隐藏信息页面的 mod。这是缓存文件夹中的 information.php。
<?php
class ModelCatalogInformation extends Model {
public function getInformation($information_id) {
$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1'");
return $query->row;
}
public function getInformations() {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' AND i.sort_order <> '-1' ORDER BY i.sort_order, LCASE(id.title) ASC");
return $query->rows;
}
public function getInformationLayoutId($information_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information_to_layout WHERE information_id = '" . (int)$information_id . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "'");
if ($query->num_rows) {
return $query->row['layout_id'];
} else {
return $this->config->get('config_layout_information');
}
}
}
?>