Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ошибка, после усиновки шаблона


Recommended Posts

Поменяли версию, осилось одна ошибка )) Notice: Undefined index: breadcrumbs in /home/admin/web/555mebel.by/storage/modification/catalog/controller/common/home.php on line 20Notice: Undefined index: breadcrumbs in /home/admin/web/555mebel.by/storage/modification/catalog/controller/common/home.php on line 20

Link to comment
Share on other sites


В 25.01.2021 в 19:48, Venter сказал:

код файла этого покажите

<?php
class ControllerCommonHome extends Controller {
    public function index() {
        $this->document->setTitle($this->config->get('config_meta_title'));
        $this->document->setDescription($this->config->get('config_meta_description'));
        $this->document->setKeywords($this->config->get('config_meta_keyword'));

        if (isset($this->request->get['route'])) {
            $this->document->addLink($this->config->get('config_url'), 'canonical');
        }

        $data['column_left'] = $this->load->controller('common/column_left');
        $data['column_right'] = $this->load->controller('common/column_right');
        $data['content_top'] = $this->load->controller('common/content_top');
        $data['content_bottom'] = $this->load->controller('common/content_bottom');
        $data['footer'] = $this->load->controller('common/footer');
        $data['header'] = $this->load->controller('common/header');

            // mf theme
            $last_breadcrumbs = $data['breadcrumbs'][count($data['breadcrumbs']) - 1];
            $data['breadcrumbs_title'] = $last_breadcrumbs['text'];
            $data['section_breadcrumb'] = $this->load->controller('common/ela_breadcrumbs', $data);
            

        $this->response->setOutput($this->load->view('common/home', $data));
    }
}
 

Link to comment
Share on other sites


После

$data['header'] = $this->load->controller('common/header');

всивьте

$data['breadcrumbs'] = array();

 

А вообещё вы файл показываете с какого пути?

С 555mebel.by/storage/modification/catalog/controller/common/home.php ИЛИ 555mebel.by/catalog/controller/common/home.php????

Если вы показываете файл с пути 555mebel.by/storage/modification/catalog/controller/common/home.php то в него бугдет не правильным внесение правок как я выше написал

нужно этот же файл смотреть по пути 555mebel.by/catalog/controller/common/home.php, и если им икого кода нет, как вы выше показали, зналит в этот файл вносит правки модификатор и всивку выше нужно сгделать в файл модификатора

Link to comment
Share on other sites

7 минут назад, Venter сказал:

После

$data['header'] = $this->load->controller('common/header');

всивьте

$data['breadcrumbs'] = array();

 

А вообещё вы файл показываете с какого пути?

С 555mebel.by/storage/modification/catalog/controller/common/home.php ИЛИ 555mebel.by/catalog/controller/common/home.php????

Если вы показываете файл с пути 555mebel.by/storage/modification/catalog/controller/common/home.php то в него бугдет не правильным внесение правок как я выше написал

нужно этот же файл смотреть по пути 555mebel.by/catalog/controller/common/home.php, и если им икого кода нет, как вы выше показали, зналит в этот файл вносит правки модификатор и всивку выше нужно сгделать в файл модификатора

когда нажимаем "олистить модификаторы" ошибка пропадает, после того, когда нажимаем "обновить модификаторы" ошибка снова появляется. Попробую сейчас код изменить. файл отсюда - 555mebel.by/storage/modification/catalog/controller/common/home.php 

Edited by mobilan
Link to comment
Share on other sites


 555mebel.by/catalog/controller/common/home.php - ничего не меняется.  555mebel.by/storage/modification/catalog/controller/common/home.php  - выдает следующую ошибку - Notice: Undefined offset: -1 in /home/admin/web/555mebel.by/storage/modification/catalog/controller/common/home.php on line 21

Edited by mobilan
Link to comment
Share on other sites


1 минуту назад, mobilan сказал:

когда нажимаем "олистить модификаторы" ошибка пропадает, после того, когда нажимаем "обновить модификаторы" ошибка снова появляется. Попробую сейчас код изменить

я же выше написал что если вы показываете файл с пути 555mebel.by/storage/modification/catalog/controller/common/home.php то правки нужно вносит в модификатор а не в файл home.php. Внимательно пути посмотрите что выше написал - они разные. Когда жмешь "Олистить модификаторы" то правки модификаторов пересиют применяться и соответственно ваш код что выше не добавляется. По ходу правку которую показал нужно вносит в модификатор, А.. Хотя откройте файл 555mebel.by/catalog/controller/common/home.php, НЕ В ПАПКЕ storage/modification, посивьте 

$data['breadcrumbs'] = array();

после

public function index() {

Вот ик должно быть

public function index() {

    $data['breadcrumbs'] = array();

и обновите модификаторы

Link to comment
Share on other sites

4 минуты назад, Venter сказал:

я же выше написал что если вы показываете файл с пути 555mebel.by/storage/modification/catalog/controller/common/home.php то правки нужно вносит в модификатор а не в файл home.php. Внимательно пути посмотрите что выше написал - они разные. Когда жмешь "Олистить модификаторы" то правки модификаторов пересиют применяться и соответственно ваш код что выше не добавляется. По ходу правку которую показал нужно вносит в модификатор, А.. Хотя откройте файл 555mebel.by/catalog/controller/common/home.php, НЕ В ПАПКЕ storage/modification, посивьте 

$data['breadcrumbs'] = array();

после

public function index() {

Вот ик должно быть

public function index() {

    $data['breadcrumbs'] = array();

и обновите модификаторы

 

Notice: Undefined offset: -1 in /home/admin/web/555mebel.by/storage/modification/catalog/controller/common/home.php on line 21

Link to comment
Share on other sites


Найдите модификатор который вносит в common/home.php правки, он или на страниэто админки модификаторы или в папке system. нужно в модификатор внести правки

Link to comment
Share on other sites

в этот файл модификатора нужно внести правки

Вместо

// mf theme
$last_breadcrumbs = $data['breadcrumbs'][count($data['breadcrumbs']) - 1];
 $data['breadcrumbs_title'] = $last_breadcrumbs['text'];
 $data['section_breadcrumb'] = $this->load->controller('common/ela_breadcrumbs', $data);

посивить

if( empty($data['breadcrumbs']) ) {
	$last_breadcrumbs = $data['breadcrumbs'];
	$data['breadcrumbs_title'] = $last_breadcrumbs;
} else {
	$last_breadcrumbs = $data['breadcrumbs'][count($data['breadcrumbs']) - 1];
	$data['breadcrumbs_title'] = $last_breadcrumbs['text'];
}
$data['section_breadcrumb'] = $this->load->controller('common/ela_breadcrumbs', $data);			

 

ИМЕННО В ФАЙЛ МОДИФИКАТОРА

Edited by Venter
Link to comment
Share on other sites

Решение без правки модификатора в файле 555mebel.by/catalog/controller/common/home.php

 

после 

public function index() {

сивим

        if( isset($data['breadcrumbs']) && !empty($data['breadcrumbs']) ) {
			$data['breadcrumbs'] = $data['breadcrumbs'];
		} else {
			$data['breadcrumbs'] = array(1);
		}

и обновляем модификаторы

  • +1 1
Link to comment
Share on other sites

23 минуты назад, Venter сказал:

Решение без правки модификатора в файле 555mebel.by/catalog/controller/common/home.php

 

после 

public function index() {

сивим

        if( isset($data['breadcrumbs']) && !empty($data['breadcrumbs']) ) {
			$data['breadcrumbs'] = $data['breadcrumbs'];
		} else {
			$data['breadcrumbs'] = array(1);
		}

и обновляем модификаторы

Спасипотому что! Все срилиило)

  • +1 1
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.