Парни, подскажите, как исправить проблему? Установил Advanced Product Review, включил и страницы с товаром перестали открываться, на странице лишь ошибка Parse error: syntax error, unexpected T_IF in .../vqmod/vqcache/vq2-catalog_model_catalog_review.php on line 179 Вот что в строке 179 PHP: if ($this->config->get('product_reviews_status')) { Часть кода куда эта строка входит Полное содержимое вкмод файла:
Нет, конфликтов вроде бы нет. В логе ошибок то же нет. Сайт нормально работал, решил установить Advanced Product Review, и такая ерунда вылезла. Ошибка только в карточке. На дефолтном шаблоне проверил, то же самое.
а если заменить Код: <search position="after" offset="1"><![CDATA[public function addReview($product_id, $data) {]]></search> на Код: <search position="after" offset="8"><![CDATA[public function addReview($product_id, $data) {]]></search> ну короче незнаю 8 или какая там у тебя будет строка, но надо чтоб кусок кода PHP: if ($this->config->get('product_reviews_status')) { $review_id = $this->db->getLastId(); foreach ($data['rating'] as $key => $rating) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_rating_review SET review_id = '" . (int)$review_id . "', rating_id = '" . (int)$key . "', rating = '" . (int)$rating . "'"); } if (isset($data['review_pros'])) { foreach ($data['review_pros'] as $pros) { $pros = trim($pros); if (!empty($pros)) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_attribute SET name = '" . $this->db->escape($pros) . "', type = '1', review_id = '" . (int)$review_id . "', status = '1'"); } } } if (isset($data['review_cons'])) { foreach ($data['review_cons'] as $cons) { $cons = trim($cons); if (!empty($cons)) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_attribute SET name = '" . $this->db->escape($cons) . "', type = '0', review_id = '" . (int)$review_id . "', status = '1'"); } } } $avg = round(array_sum($this->request->post['rating']) / count($this->request->post['rating'])); $this->db->query("UPDATE " . DB_PREFIX . "review SET rating = '" . $avg . "', store_id = '" . (int)$this->config->get('config_store_id') . "' WHERE review_id = '" . (int)$review_id . "'"); if (isset($data['review_images'])) { $k = 0; foreach ($data['review_images'] as $image) { if ($k >= (int)$this->config->get('product_reviews_image_limit')) break; $this->db->query("INSERT INTO " . DB_PREFIX . "pr_review_image SET image = '" . $this->db->escape($image) . "', review_id = '" . (int)$review_id . "'"); $k++; } } if ($this->config->get('product_reviews_autoapprove') && $this->customer->isLogged()) { if ($avg >= $this->config->get('product_reviews_autoapprove_rating')) { $this->db->query("UPDATE " . DB_PREFIX . "review SET status = '1' WHERE review_id = '" . (int)$review_id . "'"); } } if ($this->config->get('product_reviews_point_status') && $this->customer->isLogged()) { if ($this->config->get('product_reviews_reward_point')) { $description = $this->config->get('product_reviews_description_point'); if (isset($description[$this->config->get('config_language_id')])) { $description = $description[$this->config->get('config_language_id')]; } else { $description = 'Points for writing a review.'; } $this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$this->customer->getId() . "', order_id = '0', points = '" . (int)$this->config->get('product_reviews_reward_point') . "', description = '" . $this->db->escape($description) . "', date_added = NOW()"); } } if ($this->config->get('product_reviews_notify_status') && $this->config->get('product_reviews_notify_email') && $this->config->get('product_reviews_notification')) { $this->load->model('catalog/product'); $product_info = $this->model_catalog_product->getProduct($product_id); $product = '<a href="' . $this->url->link('product/product', 'product_id=' . $product_id) . '">' . $product_info['name'] . '</a>'; $data['text'] = strip_tags(html_entity_decode($data['text'], ENT_QUOTES, 'UTF-8')); $message = str_replace(array('{product}', '{avg}', '{review}'), array($product, $avg, $data['text']), $this->config->get('product_reviews_notification')); $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('product_reviews_notify_email')); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->config->get('config_name')); $mail->setSubject('New product review'); $mail->setHtml($message); $mail->send(); } } встал в сам конец ф-ции перед ее окончанием } так как щас у тебя вставляется в средину составленого запроса добавления отзыва, то и ошибка синтаксиса есть так как вставляется после конкатынации а не нужного закрытия ;
значит не угадал со строкой, не 8 она, тебе самому надо было посмотреть или превратить ф-цию вручную к виду без вкмода PHP: public function addReview($product_id, $data) { $this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" .$this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', status = 1, date_added = NOW()"); if ($this->config->get('product_reviews_status')) { $review_id = $this->db->getLastId(); foreach ($data['rating'] as $key => $rating) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_rating_review SET review_id = '" . (int)$review_id . "', rating_id = '" . (int)$key . "', rating = '" . (int)$rating . "'"); } if (isset($data['review_pros'])) { foreach ($data['review_pros'] as $pros) { $pros = trim($pros); if (!empty($pros)) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_attribute SET name = '" . $this->db->escape($pros) . "', type = '1', review_id = '" . (int)$review_id . "', status = '1'"); } } } if (isset($data['review_cons'])) { foreach ($data['review_cons'] as $cons) { $cons = trim($cons); if (!empty($cons)) { $this->db->query("INSERT INTO " . DB_PREFIX . "pr_attribute SET name = '" . $this->db->escape($cons) . "', type = '0', review_id = '" . (int)$review_id . "', status = '1'"); } } } $avg = round(array_sum($this->request->post['rating']) / count($this->request->post['rating'])); $this->db->query("UPDATE " . DB_PREFIX . "review SET rating = '" . $avg . "', store_id = '" . (int)$this->config->get('config_store_id') . "' WHERE review_id = '" . (int)$review_id . "'"); if (isset($data['review_images'])) { $k = 0; foreach ($data['review_images'] as $image) { if ($k >= (int)$this->config->get('product_reviews_image_limit')) break; $this->db->query("INSERT INTO " . DB_PREFIX . "pr_review_image SET image = '" . $this->db->escape($image) . "', review_id = '" . (int)$review_id . "'"); $k++; } } if ($this->config->get('product_reviews_autoapprove') && $this->customer->isLogged()) { if ($avg >= $this->config->get('product_reviews_autoapprove_rating')) { $this->db->query("UPDATE " . DB_PREFIX . "review SET status = '1' WHERE review_id = '" . (int)$review_id . "'"); } } if ($this->config->get('product_reviews_point_status') && $this->customer->isLogged()) { if ($this->config->get('product_reviews_reward_point')) { $description = $this->config->get('product_reviews_description_point'); if (isset($description[$this->config->get('config_language_id')])) { $description = $description[$this->config->get('config_language_id')]; } else { $description = 'Points for writing a review.'; } $this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$this->customer->getId() . "', order_id = '0', points = '" . (int)$this->config->get('product_reviews_reward_point') . "', description = '" . $this->db->escape($description) . "', date_added = NOW()"); } } if ($this->config->get('product_reviews_notify_status') && $this->config->get('product_reviews_notify_email') && $this->config->get('product_reviews_notification')) { $this->load->model('catalog/product'); $product_info = $this->model_catalog_product->getProduct($product_id); $product = '<a href="' . $this->url->link('product/product', 'product_id=' . $product_id) . '">' . $product_info['name'] . '</a>'; $data['text'] = strip_tags(html_entity_decode($data['text'], ENT_QUOTES, 'UTF-8')); $message = str_replace(array('{product}', '{avg}', '{review}'), array($product, $avg, $data['text']), $this->config->get('product_reviews_notification')); $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('product_reviews_notify_email')); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->config->get('config_name')); $mail->setSubject('New product review'); $mail->setHtml($message); $mail->send(); } } }
Тебе удалось запустить? --- Добавлено, 28 авг 2016 --- Parse error: syntax error, unexpected T_ELSE in vqmod/vqcache/vq2-admin_model_catalog_review.php on line 14
В лог кидает ошибку MOD DETAILS: /vqmod/xml/z_advanced_product_reviews.xml id : Advanced Product Reviews version : 1.6 vqmver : 2.5.1 author : Adikon VQModObject::parseMods - Could not resolve path for [admin/view/template/common/menu.tpl] (SKIPPED) VQModObject::parseMods - Could not resolve path for [admin/controller/common/menu.php] (SKIPPED)