我刚得到一个新的OpenCart商店,我得到了一些PHP错误



www.efekten.comm这是我的商店。我收到两条消息说我有错误。

注意:未定义的索引:第28行/home/efektennc/public_html/controlog/controller/extension/module/beauty_tab.php中的名称

它是现成的模板,所以我开始删除类别,当我删除第一个类别时就会发生这种情况。

但在管理菜单中没有选项,我可以更改它们,如果你能帮助我,我将不胜感激。

我只需要更改这些类别,但无法通过面板,它们像模块一样安装。。。这很不好。

代码为:

class ControllerExtensionModuleShoesTab extends Controller {
public function index($setting) {
$this->load->language('extension/module/shoes_tab');
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$data['categories'] = array();
if (!$setting['limit']) {
$setting['limit'] = 4;
}
if (!empty($setting['category'])) {
//$categories = array_slice($setting['category'], 0, (int)$setting['limit']);
$categories = $setting['category'];
$data['template_name'] = $setting['name'];
foreach ($categories as $category_id) {
$category = $this->model_catalog_category->getCategory($category_id);
$datainfo['category'] = $category['name'];
$filter_data = array(
'filter_category_id'  => $category_id,
'filter_sub_category' => true,
'limit'               => (int)$setting['limit'],
'start'               => 0
);
$category_info = $this->model_catalog_product->getProducts($filter_data);
if ($category_info) {
$datainfo['products'] = array(); // сбрасываем datainfo['products'] чтобы не было дубликата
foreach ($category_info as $key => $value) {
if ($value['image']) {
$image = $this->model_tool_image->resize($value['image'], $setting['width'], $setting['height']);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']);
}
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($value['price'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$price = false;
}
if ((float)$value['special']) {
$special = $this->currency->format($this->tax->calculate($value['special'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$special = false;
}
$datainfo['products'][] = array(
'product_id'  => $value['product_id'],
'thumb'       => $image,
'name'        => $value['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($value['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
'price'       => $price,
'special'     => $special,
'rating'      => $value['rating'],
'href'        => $this->url->link('product/product', 'product_id=' . $value['product_id'])
);
}
}
$data['categories'][] = $datainfo;
}
}
if ($data['categories']) {
return $this->load->view('extension/module/shoes_tab', $data);
}
}
}

下一个:

class ControllerExtensionModuleBeautyTab extends Controller {
public function index($setting) {
$this->load->language('extension/module/beauty_tab');
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$data['categories'] = array();
if (!$setting['limit']) {
$setting['limit'] = 4;
}
if (!empty($setting['category'])) {
//$categories = array_slice($setting['category'], 0, (int)$setting['limit']);
$categories = $setting['category'];
$data['template_name'] = $setting['name'];
foreach ($categories as $category_id) {
$category = $this->model_catalog_category->getCategory($category_id);
$datainfo['category'] = $category['name'];
$filter_data = array(
'filter_category_id'  => $category_id,
'filter_sub_category' => true,
'limit'               => (int)$setting['limit'],
'start'               => 0
);
$category_info = $this->model_catalog_product->getProducts($filter_data);
if ($category_info) {
$datainfo['products'] = array(); // сбрасываем datainfo['products'] чтобы не было дубликата
foreach ($category_info as $key => $value) {
if ($value['image']) {
$image = $this->model_tool_image->resize($value['image'], $setting['width'], $setting['height']);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']);
}
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($value['price'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$price = false;
}
if ((float)$value['special']) {
$special = $this->currency->format($this->tax->calculate($value['special'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$special = false;
}
$datainfo['products'][] = array(
'product_id'  => $value['product_id'],
'thumb'       => $image,
'name'        => $value['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($value['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
'price'       => $price,
'special'     => $special,
'rating'      => $value['rating'],
'href'        => $this->url->link('product/product', 'product_id=' . $value['product_id'])
);
}
}
$data['categories'][] = $datainfo;
}
}
if ($data['categories']) {
return $this->load->view('extension/module/beauty_tab', $data);
}
}
}

我在两个不同的地方得到了这些代码,也许更多。。。

我在管理文件夹和目录文件夹中的两个模块中都有它们。也许它们在某种程度上是相关的,当我删除类别时,模块显然有问题。。。但我如何更改这些类别?

如果有人熟悉编码,我很乐意他向我解释如何找到移动版的代码,因为如果你能通过移动版的www.efekten.com查看网站,你就能看到徽标本身已经接近标签菜单按钮了?这可以修复吗?如何修复?

我可以为MOBILE版本将按钮调大吗?或者以某种方式与徽标分离,因为很难进入菜单。

谢谢你们,伙计们!我爱你!

您可以检查索引是否是这样定义的。。

线路:

$data['template_name'] = $setting['name']; 

替换为:

if (!empty($setting['name'])) {
$data['template_name'] = $setting['name'];
} else {
$data['template_name'] = '';
}

这些不是错误,而是警告。您可以从托管计划(NS1(中停止PHP的错误报告,也可以将error_reporting(0);添加到PHP中。这些通知并不致命。

在放大按钮时,可以使用CSS。

最新更新