opencart 1.5在管理设置/存储页面中显示计数存储
我正在Opencart 1.5中使用multistore。我想显示我已创建的门店总数,并在设置/门店页面中显示。有人能帮忙吗?函数opencart 1.5在管理设置/存储页面中显示计数存储,opencart,Opencart,我正在Opencart 1.5中使用multistore。我想显示我已创建的门店总数,并在设置/门店页面中显示。有人能帮忙吗?函数$this->model\u setting\u store->getTotalStores()将返回不包括默认存储的存储数量。 因此,门店总数: 在控制器中添加以下行: $this->data['total_stores'] = $this->model_setting_store->getTotalStores()+1; 在模板文件中,按如下方
$this->model\u setting\u store->getTotalStores()
将返回不包括默认存储的存储数量。
因此,门店总数:
在控制器中添加以下行:
$this->data['total_stores'] = $this->model_setting_store->getTotalStores()+1;
在模板文件中,按如下方式使用它:
<?php
echo $total_stores;
?>
但是,要使其在控制器文件中工作并避免任何错误,首先需要加载模型:
$this->load->model('setting/store');
我知道在controller/setting/store.php中有$store\u total=$this->model\u setting\u store->getTotalStores();所以我试着去做,但不工作