bugor66 Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Добрый день! Прошу вас подсказать в какую сторону копать Версия Opencart 2.0 шаблон не родной. После установки\удаления модуля перестали отображаться категории(выдает 500 ошибку). Логи грешат на файл public_html\system\modification\catalog\controller\product\category.php. После того как этот файл заменить на файл с бекапа все начинает работать в штатном режиме, пока не обновить кэш модификаторов(т.е файл перезаписывается на не рабочую версию). Восстанавливал бекапы где все работало, проблема остается. Спасибо за внимание. Надіслати Поділитися на інших сайтах More sharing options...
halfhope Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Поочередно отключайте модификаторы, обновляйте кэш, заходите на страницу, проверяйте работоспособность. Когда вычислите какой модификатор не работает, обращайтесь к автору модификатора. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Поочередно отключайте модификаторы, обновляйте кэш, заходите на страницу, проверяйте работоспособность. Когда вычислите какой модификатор не работает, обращайтесь к автору модификатора. Спасибо за ответ. способ не помог выявить виновника Надіслати Поділитися на інших сайтах More sharing options... druzhkov Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Спасибо за ответ. способ не помог выявить виновника Приведите полный текст ошибки из лога, если рассчитываете на помощь. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Приведите полный текст ошибки из лога, если рассчитываете на помощь. Проблема в том, что при обновлении модификаторов перезаписывается файл, который раньше не изменялся. Как можно найти то , что изменяет его. Ведь перезаписывается он с ошибкой. PHP Parse error: syntax error, unexpected 'if' (T_IF), expecting ')' in /home/c/cl86716/mi100re.ru/public_html/system/modification/catalog/controller/product/category.php on line 322 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). спасибо за ответ может быть такое, что модификатор который портит мне жизнь не отображаться в списке модификаторов? Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Файл модифицированый хотя бы покажите(под спойлер) Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 (змінено) Файл модифицированый хотя бы покажите(под спойлер) Спасибо за внимание <?php class ControllerProductCategory extends Controller { private function _removeMfpFromUrl( $url ) { if( false !== ( $mfpPos = mb_strpos( $url, '?mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, '&mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, 'mfp,', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '?', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $pos, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '/', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $mfpPos, $pos, 'utf8' ); } $url = $before . $after; } return $url; } public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } if( ! empty( $this->_request->get['mfp_org_path'] ) ) { $this->_request->get['path'] = $this->_request->get['mfp_org_path']; } if( ! empty( $this->request->get['mfp_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_path'] ); $category_id = end( $category_id ); } $category_info = $this->model_catalog_category->getCategory($category_id); if( ! empty( $this->request->get['mfp_org_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_org_path'] ); $category_id = end( $category_id ); } if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical'); $data['heading_title'] = $category_info['name']; $data['text_refine'] = $this->language->get('text_refine'); $data['text_empty'] = $this->language->get('text_empty'); $data['text_quantity'] = $this->language->get('text_quantity'); $data['text_manufacturer'] = $this->language->get('text_manufacturer'); $data['text_model'] = $this->language->get('text_model'); $data['text_price'] = $this->language->get('text_price'); $data['text_tax'] = $this->language->get('text_tax'); $data['text_points'] = $this->language->get('text_points'); $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $data['text_sort'] = $this->language->get('text_sort'); $data['text_limit'] = $this->language->get('text_limit'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_list'] = $this->language->get('button_list'); $data['button_grid'] = $this->language->get('button_grid'); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); } else { $data['thumb'] = ''; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $mfSt = mb_strpos( $url, '&', $mfpPos+1, 'utf-8'); $url = $mfSt === false ? '' : mb_substr($url, $mfSt, mb_strlen( $url, 'utf-8' ), 'utf-8'); } else if( empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $url = preg_replace( '/,?path\[[0-9_]+\]/', '', $url ); } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ,'thumb' => $image ); } if( isset( $mfUrlBeforeChange ) ) { $url = $mfUrlBeforeChange; unset( $mfUrlBeforeChange ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['show_products_from_subcategories'] ) ) { if( ! empty( $fmSettings['level_products_from_subcategories'] ) ) { $fmLevel = (int) $fmSettings['level_products_from_subcategories']; $fmPath = explode( '_', empty( $this->request->get['path'] ) ? '' : $this->request->get['path'] ); if( $fmPath && count( $fmPath ) >= $fmLevel ) { $filter_data['filter_sub_category'] = '1'; } } else { $filter_data['filter_sub_category'] = '1'; } } if( ! empty( $this->request->get['manufacturer_id'] ) ) { $filter_data['filter_manufacturer_id'] = (int) $this->request->get['manufacturer_id']; } $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['heading_title'] = $this->language->get('text_error'); $data['text_error'] = $this->language->get('text_error'); $data['button_continue'] = $this->language->get('button_continue'); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); } } } } Змінено 20 листопада 2016 користувачем bugor66 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 0 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Opencart 2.x Opencart 2.x: Пісочниця Изменяется код файла Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення PRICE MASTER - Модуль імпорту/експорту товарів, парсинг, переклад, генерація текстів, редактор каталогу та багато іншого Автор: ScriptBrains 1.0 Синхронізація Замовлень Rozetka.ua та Opencart Автор: sinco Product Manipulator Автор: Hiperlynx007 Видалення дублікатів товарів для OpenCart Автор: Hatshypsut Вибір категорій і виробників для "Знайшли дешевше" шаблону Upstore Автор: Flint2000 × Уже зареєстровані? Ввійти Реєстрація Ваші замовлення Назад Придбані модулі та шаблони Ваші рахунки Лист очікувань Альтернативні контакти Форум Новини ocStore Назад Офіційний сайт Демо ocStore 3.0.3.2 Демо ocStore 2.3.0.2.4 Завантажити ocStore Документація Історія версій ocStore Блоги Модулі Шаблони Назад Безкоштовні шаблони Платні шаблони Де купувати модулі? Послуги FAQ OpenCart.Pro Назад Демо Купити Порівняння × Створити... Important Information На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність. Я даю згоду
bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Поочередно отключайте модификаторы, обновляйте кэш, заходите на страницу, проверяйте работоспособность. Когда вычислите какой модификатор не работает, обращайтесь к автору модификатора. Спасибо за ответ. способ не помог выявить виновника Надіслати Поділитися на інших сайтах More sharing options...
druzhkov Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Спасибо за ответ. способ не помог выявить виновника Приведите полный текст ошибки из лога, если рассчитываете на помощь. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Приведите полный текст ошибки из лога, если рассчитываете на помощь. Проблема в том, что при обновлении модификаторов перезаписывается файл, который раньше не изменялся. Как можно найти то , что изменяет его. Ведь перезаписывается он с ошибкой. PHP Parse error: syntax error, unexpected 'if' (T_IF), expecting ')' in /home/c/cl86716/mi100re.ru/public_html/system/modification/catalog/controller/product/category.php on line 322 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). спасибо за ответ может быть такое, что модификатор который портит мне жизнь не отображаться в списке модификаторов? Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Файл модифицированый хотя бы покажите(под спойлер) Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 (змінено) Файл модифицированый хотя бы покажите(под спойлер) Спасибо за внимание <?php class ControllerProductCategory extends Controller { private function _removeMfpFromUrl( $url ) { if( false !== ( $mfpPos = mb_strpos( $url, '?mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, '&mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, 'mfp,', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '?', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $pos, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '/', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $mfpPos, $pos, 'utf8' ); } $url = $before . $after; } return $url; } public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } if( ! empty( $this->_request->get['mfp_org_path'] ) ) { $this->_request->get['path'] = $this->_request->get['mfp_org_path']; } if( ! empty( $this->request->get['mfp_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_path'] ); $category_id = end( $category_id ); } $category_info = $this->model_catalog_category->getCategory($category_id); if( ! empty( $this->request->get['mfp_org_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_org_path'] ); $category_id = end( $category_id ); } if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical'); $data['heading_title'] = $category_info['name']; $data['text_refine'] = $this->language->get('text_refine'); $data['text_empty'] = $this->language->get('text_empty'); $data['text_quantity'] = $this->language->get('text_quantity'); $data['text_manufacturer'] = $this->language->get('text_manufacturer'); $data['text_model'] = $this->language->get('text_model'); $data['text_price'] = $this->language->get('text_price'); $data['text_tax'] = $this->language->get('text_tax'); $data['text_points'] = $this->language->get('text_points'); $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $data['text_sort'] = $this->language->get('text_sort'); $data['text_limit'] = $this->language->get('text_limit'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_list'] = $this->language->get('button_list'); $data['button_grid'] = $this->language->get('button_grid'); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); } else { $data['thumb'] = ''; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $mfSt = mb_strpos( $url, '&', $mfpPos+1, 'utf-8'); $url = $mfSt === false ? '' : mb_substr($url, $mfSt, mb_strlen( $url, 'utf-8' ), 'utf-8'); } else if( empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $url = preg_replace( '/,?path\[[0-9_]+\]/', '', $url ); } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ,'thumb' => $image ); } if( isset( $mfUrlBeforeChange ) ) { $url = $mfUrlBeforeChange; unset( $mfUrlBeforeChange ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['show_products_from_subcategories'] ) ) { if( ! empty( $fmSettings['level_products_from_subcategories'] ) ) { $fmLevel = (int) $fmSettings['level_products_from_subcategories']; $fmPath = explode( '_', empty( $this->request->get['path'] ) ? '' : $this->request->get['path'] ); if( $fmPath && count( $fmPath ) >= $fmLevel ) { $filter_data['filter_sub_category'] = '1'; } } else { $filter_data['filter_sub_category'] = '1'; } } if( ! empty( $this->request->get['manufacturer_id'] ) ) { $filter_data['filter_manufacturer_id'] = (int) $this->request->get['manufacturer_id']; } $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['heading_title'] = $this->language->get('text_error'); $data['text_error'] = $this->language->get('text_error'); $data['button_continue'] = $this->language->get('button_continue'); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); } } } } Змінено 20 листопада 2016 користувачем bugor66 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 0 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Opencart 2.x Opencart 2.x: Пісочниця Изменяется код файла Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення PRICE MASTER - Модуль імпорту/експорту товарів, парсинг, переклад, генерація текстів, редактор каталогу та багато іншого Автор: ScriptBrains 1.0 Синхронізація Замовлень Rozetka.ua та Opencart Автор: sinco Product Manipulator Автор: Hiperlynx007 Видалення дублікатів товарів для OpenCart Автор: Hatshypsut Вибір категорій і виробників для "Знайшли дешевше" шаблону Upstore Автор: Flint2000
bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Приведите полный текст ошибки из лога, если рассчитываете на помощь. Проблема в том, что при обновлении модификаторов перезаписывается файл, который раньше не изменялся. Как можно найти то , что изменяет его. Ведь перезаписывается он с ошибкой. PHP Parse error: syntax error, unexpected 'if' (T_IF), expecting ')' in /home/c/cl86716/mi100re.ru/public_html/system/modification/catalog/controller/product/category.php on line 322 Надіслати Поділитися на інших сайтах More sharing options...
Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). спасибо за ответ может быть такое, что модификатор который портит мне жизнь не отображаться в списке модификаторов? Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Файл модифицированый хотя бы покажите(под спойлер) Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 (змінено) Файл модифицированый хотя бы покажите(под спойлер) Спасибо за внимание <?php class ControllerProductCategory extends Controller { private function _removeMfpFromUrl( $url ) { if( false !== ( $mfpPos = mb_strpos( $url, '?mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, '&mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, 'mfp,', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '?', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $pos, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '/', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $mfpPos, $pos, 'utf8' ); } $url = $before . $after; } return $url; } public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } if( ! empty( $this->_request->get['mfp_org_path'] ) ) { $this->_request->get['path'] = $this->_request->get['mfp_org_path']; } if( ! empty( $this->request->get['mfp_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_path'] ); $category_id = end( $category_id ); } $category_info = $this->model_catalog_category->getCategory($category_id); if( ! empty( $this->request->get['mfp_org_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_org_path'] ); $category_id = end( $category_id ); } if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical'); $data['heading_title'] = $category_info['name']; $data['text_refine'] = $this->language->get('text_refine'); $data['text_empty'] = $this->language->get('text_empty'); $data['text_quantity'] = $this->language->get('text_quantity'); $data['text_manufacturer'] = $this->language->get('text_manufacturer'); $data['text_model'] = $this->language->get('text_model'); $data['text_price'] = $this->language->get('text_price'); $data['text_tax'] = $this->language->get('text_tax'); $data['text_points'] = $this->language->get('text_points'); $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $data['text_sort'] = $this->language->get('text_sort'); $data['text_limit'] = $this->language->get('text_limit'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_list'] = $this->language->get('button_list'); $data['button_grid'] = $this->language->get('button_grid'); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); } else { $data['thumb'] = ''; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $mfSt = mb_strpos( $url, '&', $mfpPos+1, 'utf-8'); $url = $mfSt === false ? '' : mb_substr($url, $mfSt, mb_strlen( $url, 'utf-8' ), 'utf-8'); } else if( empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $url = preg_replace( '/,?path\[[0-9_]+\]/', '', $url ); } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ,'thumb' => $image ); } if( isset( $mfUrlBeforeChange ) ) { $url = $mfUrlBeforeChange; unset( $mfUrlBeforeChange ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['show_products_from_subcategories'] ) ) { if( ! empty( $fmSettings['level_products_from_subcategories'] ) ) { $fmLevel = (int) $fmSettings['level_products_from_subcategories']; $fmPath = explode( '_', empty( $this->request->get['path'] ) ? '' : $this->request->get['path'] ); if( $fmPath && count( $fmPath ) >= $fmLevel ) { $filter_data['filter_sub_category'] = '1'; } } else { $filter_data['filter_sub_category'] = '1'; } } if( ! empty( $this->request->get['manufacturer_id'] ) ) { $filter_data['filter_manufacturer_id'] = (int) $this->request->get['manufacturer_id']; } $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['heading_title'] = $this->language->get('text_error'); $data['text_error'] = $this->language->get('text_error'); $data['button_continue'] = $this->language->get('button_continue'); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); } } } } Змінено 20 листопада 2016 користувачем bugor66 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 0 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку Последние темы Последние дополнения Последние новости Вся активність Головна Opencart 2.x Opencart 2.x: Пісочниця Изменяется код файла
bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 У вас ошибка из папки с модификаторами,ответ дан уже в этом же топике.Если не помогло,значит не так и не то делал.Ещё раз более внимательно отключить все модификаторы и обновить кеш (модификаторов). спасибо за ответ может быть такое, что модификатор который портит мне жизнь не отображаться в списке модификаторов? Надіслати Поділитися на інших сайтах More sharing options...
Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Файл модифицированый хотя бы покажите(под спойлер) Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 (змінено) Файл модифицированый хотя бы покажите(под спойлер) Спасибо за внимание <?php class ControllerProductCategory extends Controller { private function _removeMfpFromUrl( $url ) { if( false !== ( $mfpPos = mb_strpos( $url, '?mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, '&mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, 'mfp,', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '?', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $pos, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '/', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $mfpPos, $pos, 'utf8' ); } $url = $before . $after; } return $url; } public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } if( ! empty( $this->_request->get['mfp_org_path'] ) ) { $this->_request->get['path'] = $this->_request->get['mfp_org_path']; } if( ! empty( $this->request->get['mfp_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_path'] ); $category_id = end( $category_id ); } $category_info = $this->model_catalog_category->getCategory($category_id); if( ! empty( $this->request->get['mfp_org_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_org_path'] ); $category_id = end( $category_id ); } if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical'); $data['heading_title'] = $category_info['name']; $data['text_refine'] = $this->language->get('text_refine'); $data['text_empty'] = $this->language->get('text_empty'); $data['text_quantity'] = $this->language->get('text_quantity'); $data['text_manufacturer'] = $this->language->get('text_manufacturer'); $data['text_model'] = $this->language->get('text_model'); $data['text_price'] = $this->language->get('text_price'); $data['text_tax'] = $this->language->get('text_tax'); $data['text_points'] = $this->language->get('text_points'); $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $data['text_sort'] = $this->language->get('text_sort'); $data['text_limit'] = $this->language->get('text_limit'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_list'] = $this->language->get('button_list'); $data['button_grid'] = $this->language->get('button_grid'); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); } else { $data['thumb'] = ''; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $mfSt = mb_strpos( $url, '&', $mfpPos+1, 'utf-8'); $url = $mfSt === false ? '' : mb_substr($url, $mfSt, mb_strlen( $url, 'utf-8' ), 'utf-8'); } else if( empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $url = preg_replace( '/,?path\[[0-9_]+\]/', '', $url ); } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ,'thumb' => $image ); } if( isset( $mfUrlBeforeChange ) ) { $url = $mfUrlBeforeChange; unset( $mfUrlBeforeChange ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['show_products_from_subcategories'] ) ) { if( ! empty( $fmSettings['level_products_from_subcategories'] ) ) { $fmLevel = (int) $fmSettings['level_products_from_subcategories']; $fmPath = explode( '_', empty( $this->request->get['path'] ) ? '' : $this->request->get['path'] ); if( $fmPath && count( $fmPath ) >= $fmLevel ) { $filter_data['filter_sub_category'] = '1'; } } else { $filter_data['filter_sub_category'] = '1'; } } if( ! empty( $this->request->get['manufacturer_id'] ) ) { $filter_data['filter_manufacturer_id'] = (int) $this->request->get['manufacturer_id']; } $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['heading_title'] = $this->language->get('text_error'); $data['text_error'] = $this->language->get('text_error'); $data['button_continue'] = $this->language->get('button_continue'); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); } } } } Змінено 20 листопада 2016 користувачем bugor66 Надіслати Поділитися на інших сайтах More sharing options... Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 0 Перейти до списку тем Зараз на сторінці 0 користувачів Ні користувачів, які переглядиють цю сторінку
bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 (змінено) Файл модифицированый хотя бы покажите(под спойлер) Спасибо за внимание <?php class ControllerProductCategory extends Controller { private function _removeMfpFromUrl( $url ) { if( false !== ( $mfpPos = mb_strpos( $url, '?mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, '&mfp=', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } $url = $before . $after; } else if( false !== ( $mfpPos = mb_strpos( $url, 'mfp,', 0, 'utf8' ) ) ) { $before = $mfpPos ? mb_substr( $url, 0, $mfpPos, 'utf8' ) : ''; $after = ''; if( false !== ( $pos = mb_strpos( $url, '?', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $pos, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '&', $mfpPos+1, 'utf8' ) ) ) { $after = '?' . mb_substr( $url, $pos+1, NULL, 'utf8' ); } else if( false !== ( $pos = mb_strpos( $url, '/', $mfpPos+1, 'utf8' ) ) ) { $after = mb_substr( $url, $mfpPos, $pos, 'utf8' ); } $url = $before . $after; } return $url; } public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = $this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } if( ! empty( $this->_request->get['mfp_org_path'] ) ) { $this->_request->get['path'] = $this->_request->get['mfp_org_path']; } if( ! empty( $this->request->get['mfp_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_path'] ); $category_id = end( $category_id ); } $category_info = $this->model_catalog_category->getCategory($category_id); if( ! empty( $this->request->get['mfp_org_path'] ) ) { $category_id = explode( '_', $this->request->get['mfp_org_path'] ); $category_id = end( $category_id ); } if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical'); $data['heading_title'] = $category_info['name']; $data['text_refine'] = $this->language->get('text_refine'); $data['text_empty'] = $this->language->get('text_empty'); $data['text_quantity'] = $this->language->get('text_quantity'); $data['text_manufacturer'] = $this->language->get('text_manufacturer'); $data['text_model'] = $this->language->get('text_model'); $data['text_price'] = $this->language->get('text_price'); $data['text_tax'] = $this->language->get('text_tax'); $data['text_points'] = $this->language->get('text_points'); $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $data['text_sort'] = $this->language->get('text_sort'); $data['text_limit'] = $this->language->get('text_limit'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_list'] = $this->language->get('button_list'); $data['button_grid'] = $this->language->get('button_grid'); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); } else { $data['thumb'] = ''; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $mfSt = mb_strpos( $url, '&', $mfpPos+1, 'utf-8'); $url = $mfSt === false ? '' : mb_substr($url, $mfSt, mb_strlen( $url, 'utf-8' ), 'utf-8'); } else if( empty( $fmSettings['not_remember_filter_for_subcategories'] ) && false !== ( $mfpPos = strpos( $url, '&mfp=' ) ) ) { $mfUrlBeforeChange = $url; $url = preg_replace( '/,?path\[[0-9_]+\]/', '', $url ); } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ,'thumb' => $image ); } if( isset( $mfUrlBeforeChange ) ) { $url = $mfUrlBeforeChange; unset( $mfUrlBeforeChange ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $fmSettings = $this->config->get('mega_filter_settings'); if( ! empty( $fmSettings['show_products_from_subcategories'] ) ) { if( ! empty( $fmSettings['level_products_from_subcategories'] ) ) { $fmLevel = (int) $fmSettings['level_products_from_subcategories']; $fmPath = explode( '_', empty( $this->request->get['path'] ) ? '' : $this->request->get['path'] ); if( $fmPath && count( $fmPath ) >= $fmLevel ) { $filter_data['filter_sub_category'] = '1'; } } else { $filter_data['filter_sub_category'] = '1'; } } if( ! empty( $this->request->get['manufacturer_id'] ) ) { $filter_data['filter_manufacturer_id'] = (int) $this->request->get['manufacturer_id']; } $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); if( ! empty( $this->request->get['mfp'] ) ) { $url .= '&mfp=' . $this->request->get['mfp']; } $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { if( isset( $this->request->get['mfilterAjax'] ) ) { $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->load->model( 'module/mega_filter' ); if( class_exists( 'MegaFilterCore' ) ) { $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $calculate_number_of_products = false; $settings = $this->config->get('mega_filter_module'); $settings = isset( $settings[$this->request->get['mfilterIdx']] ) && isset( $this->request->get['mfilterIdx'] ) ? $settings[$this->request->get['mfilterIdx']] : array(); if( ! empty( $settings['configuration'] ) ) { $calculate_number_of_products = ! empty( $settings['configuration']['calculate_number_of_products'] ); } else { $settings = $this->config->get('mega_filter_settings'); $calculate_number_of_products = ! empty( $settings['calculate_number_of_products'] ); } $seo_settings = $this->config->get('mega_filter_seo'); $baseTypes = array( 'stock_status', 'manufacturers', 'rating', 'attributes', 'price', 'options', 'filters' ); if( isset( $this->request->get['mfilterBTypes'] ) ) { $baseTypes = explode( ',', $this->request->get['mfilterBTypes'] ); } if( ! empty( $seo_settings['enabled'] ) || $calculate_number_of_products || in_array( 'categories:tree', $baseTypes ) ) { if( ! $calculate_number_of_products ) { $baseTypes = array( 'categories:tree' ); } $this->load->model( 'module/mega_filter' ); $idx = 0; if( isset( $this->request->get['mfilterIdx'] ) ) $idx = (int) $this->request->get['mfilterIdx']; $data['mfilter_json'] = json_encode( MegaFilterCore::newInstance( $this, NULL )->getJsonData($baseTypes, $idx) ); } $data['header'] = $data['column_left'] = $data['column_right'] = $data['content_top'] = $data['content_bottom'] = $data['footer'] = ''; } } if( ! empty( $data['breadcrumbs'] ) && ! empty( $this->request->get['mfp'] ) ) { foreach( $data['breadcrumbs'] as $mfK => $mfBreadcrumb ) { $data['breadcrumbs'][$mfK]['href'] = $this->_removeMfpFromUrl( $data['breadcrumbs'][$mfK]['href'] ); } } $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data)); } } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['heading_title'] = $this->language->get('text_error'); $data['text_error'] = $this->language->get('text_error'); $data['button_continue'] = $this->language->get('button_continue'); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); } } } } Змінено 20 листопада 2016 користувачем bugor66 Надіслати Поділитися на інших сайтах More sharing options...
Tom Опубліковано: 20 листопада 2016 Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. Надіслати Поділитися на інших сайтах More sharing options... bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options... Створіть аккаунт або увійдіть для коментування Ви повинні бути користувачем, щоб залишити коментар Створити обліковий запис Зареєструйтеся для отримання облікового запису. Це просто! Зареєструвати аккаунт Вхід Уже зареєстровані? Увійдіть тут. Вхід зараз Share More sharing options... Передплатники 0
bugor66 Опубліковано: 20 листопада 2016 Автор Share Опубліковано: 20 листопада 2016 Как минимум писать автору Mega Filter Pro. спасибо за помощь :-) Удалил все файлы относящиеся к mega filter и все заработало Надіслати Поділитися на інших сайтах More sharing options...
Recommended Posts