AlexDev Опубликовано: февраля 2, 2017 Жалоба Поделиться Опубликовано: февраля 2, 2017 Поставил имеджмеджик Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) in C:\OpenServer\domains\///\system\storage\modification\catalog\controller\extension\module\latest.php on line 163 аналогично было и в файле special - модули, которые вводятся на главной странице Как починить? или чем заменить этот модуль? При этом модули "рекомендуем" и "популярные товары" - работают Цитата Ссылка на комментарий Поделиться на других сайтах Больше вариантов поделиться...
AlexDev Опубликовано: февраля 2, 2017 Автор Жалоба Поделиться Опубликовано: февраля 2, 2017 (изменено) 44 минуты назад, Yoda сказал: Откройте модифицированный файл и посмотрите где и в чем ошибка! Деактивировал модуль имеджмеджика. Чистил кеш и модификаторы и кеш браузера тоже. - всеравно не работает и выдает такую же ошибку . Вот содержимое файла system\storage\modification\catalog\controller\extension\module\latest.php начал внимательно смотреть закрывающие скобочки и обнаружил, что не стояла закрывающая для class ControllerExtensionModuleLatest extends Controller 163 строка- это последняя пустая строка - я туда попробовал добавить закрывающую скобочку } и все заработало! Вот только при чистке модификаторов - она опять исчезает! Как сделать, чтобы не исчезала фигурная скобка на конце? При чистке модификаторов? Скрытый текст <?php global $aFolder; global $modulesPath; if (!defined('HTTP_ADMIN')) { $root_dir = DIR_APPLICATION.'../'; $folder_contents = scandir($root_dir); if (!(in_array('admin', $folder_contents) && file_exists($root_dir.'admin/config.php'))) { foreach ($folder_contents as $value) { if (is_dir($root_dir.$value) && $value != '.' && $value != '..'){ if (file_exists($root_dir.$value.'/config.php')) { $admin_folder_name = $value; continue; } } } } if (isset($admin_folder_name)) { define('HTTP_ADMIN',$admin_folder_name); } else { define('HTTP_ADMIN','admin'); } } $aFolder = preg_replace('/.*\/([^\/].*)\//is','$1',HTTP_ADMIN); if (version_compare(VERSION,'2.3','>=')) { //newer than 2.2.x $modulesPath = 'extension/module'; } else { $modulesPath = 'module'; } include (preg_match("/components\/com_(ayelshop|aceshop|mijoshop)\/opencart\//ims",__FILE__,$matches)?'components/com_'.$matches[1].'/opencart/':'').$aFolder.'/controller/'.$modulesPath.'/magictoolbox-module.inc'; // * @copyright OPENCART.PRO 2011 - 2016. // * @forum http://forum.opencart.pro // * @source See SOURCE.txt for source and other copyright. // * @license GNU General Public License version 3; see LICENSE.txt class ControllerExtensionModuleLatest extends Controller { public function index($setting) { $this->load->language('extension/module/latest'); $data['heading_title'] = $this->language->get('heading_title'); $data['text_tax'] = $this->language->get('text_tax'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $this->load->model('catalog/product'); $this->load->model('tool/image'); $data['products'] = array(); $cache_data = null; if ($this->config->get('turbo_latest_module') && $this->config->get('turbo_status')) { $cache = 'turbo.latest_module.' . $this->language->get('code') . '.' . (int) $this->config->get('config_store_id') . '.' . $this->session->data['currency'] . '.' . (int)$this->config->get('config_customer_group_id') . '.' . substr(md5(serialize($setting)), 0, 8); $cache_data = $this->cache->get($cache); } if (!empty($cache_data) && is_array($cache_data)) { $results = true; } else { //opencart turbo end $filter_data = array( 'sort' => 'p.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $setting['limit'] ); $results = $this->model_catalog_product->getProducts($filter_data); //opencart turbo start } //opencart turbo end if ($results) { //opencart turbo start if (is_array($results)) { //opencart turbo end foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']).'" id="latest_'.$result['product_id'].'"'; } else { $image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']); } if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); } 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')), $this->session->data['currency']); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = $result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']) ); } $contents = $this->load->view('extension/module/latest', $data); global $aFolder; global $modulesPath; if (isset($GLOBALS['magictoolbox_modules'])) { global $tools; foreach ($tools as $tool) { if (isset($GLOBALS['magictoolbox_modules'][$tool])) { $boxModule = $GLOBALS['magictoolbox_modules'][$tool]; if ($boxModule['status']) { //if module enabled if (!function_exists($tool)) include (preg_match("/components\/com_(ayelshop|aceshop|mijoshop)\/opencart\//ims",__FILE__,$matches)?'components/com_'.$matches[1].'/opencart/':'').$aFolder.'/controller/'.$modulesPath.'/'.$tool.'-opencart-module/module.php'; $boxPath = (preg_match("/components\/com_(ayelshop|aceshop|mijoshop)\/opencart\//ims",__FILE__,$matches)?'components/com_'.$matches[1].'/opencart/':'').$aFolder.'/controller/'.$modulesPath.'/'.$tool.'-opencart-module/boxes.inc'; if (file_exists($boxPath)) { include ($boxPath); } } } } } return $contents; } } } Изменено февраля 2, 2017 пользователем RHCk Простыни кода убирайте под спойлер! Последнее предупреждение! Цитата Ссылка на комментарий Поделиться на других сайтах Больше вариантов поделиться...
Рекомендуемые сообщения
Присоединяйтесь к обсуждению
Вы можете опубликовать сейчас и зарегистрироваться позже. Если у вас есть учётная запись, войдите, чтобы публиковать под своей учётной записью.