Answer the question
In order to leave comments, you need to log in
How to display the store id in the list of products and categories of the admin panel in opencart?
Worth Octstore 2.3.
In the admin panel, in the list of products and categories, I try to display the id of the store to which it (the element) is assigned opposite each element. In site.ru/admin/view/template/catalog/product_list.tpl I tried to output <?php echo $product['store_id']; ?> But it doesn't work...
In site.ru/admin/model/catalog/product.php there is a mention of $store_id, as I understand it, the request is already being made about the necessary information in the database in the product_to_store field.
However, in the site.ru/ controller admin/controller/catalog/product.php only occurs in one place
$this->load->model('setting/store');
$data['stores'] = $this->model_setting_store->getStores();
if (isset($this->request->post['product_store'])) {
$data['product_store'] = $this->request->post['product_store'];
} elseif (isset($this->request->get['product_id'])) {
$data['product_store'] = $this->model_catalog_product->getProductStores($this->request->get['product_id']);
} else {
$data['product_store'] = array(0);
}
Answer the question
In order to leave comments, you need to log in
Find string
Add to array
$data['products'][] = array(
'store_id' => $this->model_catalog_product->getProductStores($result['product_id']),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question