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

Ошибки кто вкурсе?


Recommended Posts

Доброе время суток 

помогите пожалуйси чайнику расшифровать ошибки спасипотому что)

 

 

Edited by NikOne
Link to comment
Share on other sites


Ясно же написано. ругается что в функцию getInformation передано null, нужно проверку посивить.

У вас какой то модификатор вносит правки в файл controller/common/menu.php

Нужно найти какой модификатор вносит правки и им посивить проверку на те данные которые передаются в функцию

Edited by Venter
Link to comment
Share on other sites

3 минуты назад, freelancer сказал:

getInformation вызывается у null объеки

вы лучше указанную строчку из указанного файла покажите

в листом опенкарте нет икой строки. им же видно на скрине что это какой то модификатор добавляет

Link to comment
Share on other sites

12 минут назад, freelancer сказал:

@Venter

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

Глупости?

Link to comment
Share on other sites

2 часа назад, freelancer сказал:

getInformation вызывается у null объеки

вы лучше указанную строчку из указанного файла покажите

из какого именно файла простите?

Link to comment
Share on other sites


21 минуту назад, NikOne сказал:

из какого именно файла простите?

/catalog/controller/common/menu.php

У вас в этом файле на 32 строке игдет обраещёние к объекту (скорее всего могдель), которая не загружена. Соответственно гдергается метод не загруженной могдели. Видимо какой-то модуль всил криво (модификатор не нашел нужной строки куда впилиться). 

Link to comment
Share on other sites

12 часов назад, Venter сказал:

Ясно же написано. ругается что в функцию getInformation передано null, нужно проверку посивить.

Ахах, вы всегда ик отвечаете людям, которые в программировании 0?

Link to comment
Share on other sites


1 час назад, warezinspector сказал:

Ахах, вы всегда ик отвечаете людям, которые в программировании 0?

А как я еещё должен отвечать? Срочно думать и решать что им у ТС не ик

Link to comment
Share on other sites

9 минут назад, freelancer сказал:

image.png.f45604f3da3dc95d3c1e9e5d2f7a8ac2.png

 

13 часов назад, OtezVikentiy сказал:
/catalog/controller/common/menu.php

У вас в этом файле на 32 строке игдет обраещёние к объекту (скорее всего могдель), которая не загружена. Соответственно гдергается метод не загруженной могдели. Видимо какой-то модуль всил криво (модификатор не нашел нужной строки куда впилиться). 

 

 

Вот 32 ая строка ребяи подскажите 
        foreach ($this->model_catalog_information->getInformations() as $result) {

 

<?php
class ControllerCommonMenu extends Controller {
    public function index() {
        $this->load->language('common/menu');

        $data['manufacturer'] = $this->url->link('product/manufacturer');
        $data['contact'] = $this->url->link('information/contact');
        $data['special'] = $this->url->link('product/special');
        $data['search'] = $this->load->controller('common/search');
        $data['logged'] = $this->customer->isLogged();
        $data['account'] = $this->url->link('account/account', '', true);
        $data['register'] = $this->url->link('account/register', '', true);
        $data['login'] = $this->url->link('account/login', '', true);
        $data['order'] = $this->url->link('account/order', '', true);
        $data['transaction'] = $this->url->link('account/transaction', '', true);
        $data['download'] = $this->url->link('account/download', '', true);
        $data['logout'] = $this->url->link('account/logout', '', true);
        $data['language'] = $this->load->controller('common/language');
        $data['currency'] = $this->load->controller('common/currency');
        $data['wishlist'] = $this->url->link('account/wishlist', '', true);
        $data['compare'] = $this->url->link('product/compare');
        $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
                if ($this->customer->isLogged()) {
            $this->load->model('account/wishlist');

            $data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), $this->model_account_wishlist->getTotalWishlist());
        } else {
            $data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));
        }        
        $data['informations'] = array();

        foreach ($this->model_catalog_information->getInformations() as $result) {
            if ($result['bottom']) {
                $data['informations'][] = array(
                    'title' => $result['title'],
                    'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
                );
            }
        }
  
                                                   
                                                             
          
                           
   

        // Menu
        $this->load->model('catalog/category');

        $this->load->model('catalog/product');

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

        $categories = $this->model_catalog_category->getCategories(0);

        foreach ($categories as $category) {
            if ($category['top']) {
                // Level 2
                $children_data = array();

                $children = $this->model_catalog_category->getCategories($category['category_id']);

                foreach ($children as $child) {
                    $filter_data = array(
                        'filter_category_id'  => $child['category_id'],
                        'filter_sub_category' => true
                    );

                    $children_data[] = array(
                        'name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
                        'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
                    );
                }

                // Level 1
                $data['categories'][] = array(
                    'name'     => $category['name'],
                    'children' => $children_data,
                    'column'   => $category['column'] ? $category['column'] : 1,
                    'href'     => $this->url->link('product/category', 'path=' . $category['category_id'])
                );
            }
        }

        return $this->load->view('common/menu', $data);
    }
}
 

menu.php

Edited by NikOne
Link to comment
Share on other sites


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

не загружена могдель information

а ггде конкретно она должна быть ? спасипотому что

 

Смотрю в резервной копии файлы игдентичны 

 

catalog/model/catalog/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' 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 (int)$query->row['layout_id'];
        } else {
            return 0;
        }
    }
}

Edited by NikOne
Link to comment
Share on other sites


3 минуты назад, stickpro сказал:

 $this->load->model('catalog/information');
перед форичем

Можно вас попросить всивить  его куда надо ? я ик понимаю << $this->load->model('catalog/information'); >> в information.php ?

знаний просто не хваиет для понимания )

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.