Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...

Не работают отзывы!


Olegshturman
 Поделиться

Рекомендованные сообщения

Всем доброго времени суток!
Помогите решить проблемку, так как не являюсь программистом, а всего лишь владельцем ИМ OpenCart 2.0
Суть проблемы: клиент оставляет отзыв о товаре на сайте. Мне на мыло приходит уведомление о новом отзыве, но в админке этого нет, для того, чтобы его принять/отклонить.
Самое интересно то, что сам я из админки могу написать отзыв, но из открытой части магазина не могу сделать этого ни я, ни клиент.
Вот сам ИМ : http://ironpower.com.ua/

Ссылка на комментарий
Поделиться на других сайтах


Проблема из-а того, что у вас при отправке отзыва вместо product_id передаётся вот это:

"<b>Notice</b>: Undefined variable: product_id in <b>/var/www/olegshturmanuk/data/www/ironpower.com.ua/catalog/view/theme/pitaha/template/product/review.tpl</b> on line <b>77</b>"

Проверьте файл /catalog/controller/product/product.php. У вас там в функции index должна быть такая строка:

$data['product_id'] = (int)$this->request->get['product_id'];

Если её нет, добавьте её, например, перед

$data['model'] = $product_info['model'];

Если же строка есть, значит дело в модификаторах.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


  • 4 недели спустя...
1 час назад, Olegshturman сказал:

Нашел такую строку:
$data['product_id']    = (int)$this->request->get['product_id'];
Она правильно прописана?

Ну, вы же сами должны видеть, что она 1 в 1 соответствует той, которую я привёл выше.

Смотрите тогда в /system/storage/modification/catalog/controller/product/product.php.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


А там что посмотреть? Если такую же строку, то она там тоже есть.

Изменено пользователем Olegshturman
Ссылка на комментарий
Поделиться на других сайтах


5 часов назад, Olegshturman сказал:

А там что посмотреть? Если такую же строку, то она там тоже есть.

Такую же строку. Этот файл - это копия предыдущего, но из кеша OCMOD (после обработки модификаторами).

Выложите сюда код из /system/storage/modification/catalog/controller/product/product.php и /catalog/view/theme/pitaha/template/product/review.tpl.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


В 06.02.2017 в 01:11, Dotrox сказал:

Такую же строку. Этот файл - это копия предыдущего, но из кеша OCMOD (после обработки модификаторами).

Выложите сюда код из /system/storage/modification/catalog/controller/product/product.php и /catalog/view/theme/pitaha/template/product/review.tpl.

Скрытый текст

 

<?php

class ControllerProductProduct extends Controller {

  private $error = array();

  public function index() {

    $this->load->language('product/product');

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

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

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

        'text' => $this->language->get('text_home'),

        'href' => $this->url->link('common/home'),

    );

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

    if (isset($this->request->get['path'])) {

      $path = '';

      $parts = explode('_', (string)$this->request->get['path']);

      $category_id = (int)array_pop($parts);

      foreach ($parts as $path_id) {

        if (!$path) {

          $path = $path_id;

        } else {

          $path .= '_' . $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),

          );

        }

      }

      // Set the last category breadcrumb

      $category_info = $this->model_catalog_category->getCategory($category_id);

      if ($category_info) {

        $url = '';

        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' => $category_info['name'],

            'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url),

        );

      }

    }

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

    if (isset($this->request->get['manufacturer_id'])) {

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

          'text' => $this->language->get('text_brand'),

          'href' => $this->url->link('product/manufacturer'),

      );

      $url = '';

      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'];

      }

      $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);

      if ($manufacturer_info) {

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

            'text' => $manufacturer_info['name'],

            'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url),

        );

      }

    }

    if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {

      $url = '';

      if (isset($this->request->get['search'])) {

        $url .= '&search=' . $this->request->get['search'];

      }

      if (isset($this->request->get['tag'])) {

        $url .= '&tag=' . $this->request->get['tag'];

      }

      if (isset($this->request->get['description'])) {

        $url .= '&description=' . $this->request->get['description'];

      }

      if (isset($this->request->get['category_id'])) {

        $url .= '&category_id=' . $this->request->get['category_id'];

      }

      if (isset($this->request->get['sub_category'])) {

        $url .= '&sub_category=' . $this->request->get['sub_category'];

      }

      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_search'),

          'href' => $this->url->link('product/search', $url),

      );

    }

    if (isset($this->request->get['product_id'])) {

      $product_id = (int)$this->request->get['product_id'];

    } else {

      $product_id = 0;

    }

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

    $product_info = $this->model_catalog_product->getProduct($product_id);

    if ($product_info) {

      $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['manufacturer_id'])) {

        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];

      }

      if (isset($this->request->get['search'])) {

        $url .= '&search=' . $this->request->get['search'];

      }

      if (isset($this->request->get['tag'])) {

        $url .= '&tag=' . $this->request->get['tag'];

      }

      if (isset($this->request->get['description'])) {

        $url .= '&description=' . $this->request->get['description'];

      }

      if (isset($this->request->get['category_id'])) {

        $url .= '&category_id=' . $this->request->get['category_id'];

      }

      if (isset($this->request->get['sub_category'])) {

        $url .= '&sub_category=' . $this->request->get['sub_category'];

      }

      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' => $product_info['name'],

          'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']),

      );

      $this->document->setTitle($product_info['meta_title']);

      $this->document->setDescription($product_info['meta_description']);

      $this->document->setKeywords($product_info['meta_keyword']);

      $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');

      $this->document->addScript('catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js');

      $this->document->addStyle('catalog/view/javascript/jquery/magnific/magnific-popup.css');

      $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment.js');

      $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js');

      $this->document->addStyle('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css');

      $data['heading_title'] = $product_info['name'];

                $data['NotifyWhenAvailable']  = $this->config->get('notifywhenavailable');
                $this->language->load('module/notifywhenavailable');
                $data['NotifyWhenAvailable_Button'] = $this->language->get('NotifyWhenAvailable_Button');
                        

      $data['text_select']       = $this->language->get('text_select');

      $data['text_manufacturer'] = $this->language->get('text_manufacturer');

      $data['text_model']        = $this->language->get('text_model');

      $data['text_reward']       = $this->language->get('text_reward');

      $data['text_points']       = $this->language->get('text_points');

      $data['text_stock']        = $this->language->get('text_stock');

      $data['text_discount']     = $this->language->get('text_discount');

      $data['text_tax']          = $this->language->get('text_tax');

      $data['text_option']       = $this->language->get('text_option');

      $data['text_minimum']      = sprintf($this->language->get('text_minimum'), $product_info['minimum']);

      $data['text_write']        = $this->language->get('text_write');

      $data['text_write_qaa']    = $this->language->get('text_write_qaa');

      $data['text_login']        = sprintf($this->language->get('text_login'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));

      $data['text_note']         = $this->language->get('text_note');

      $data['text_tags']         = $this->language->get('text_tags');

      $data['text_related']      = $this->language->get('text_related');

      $data['text_loading']      = $this->language->get('text_loading');

      $data['entry_qty']    = $this->language->get('entry_qty');

      $data['entry_name']   = $this->language->get('entry_name');

      $data['entry_review'] = $this->language->get('entry_review');

      $data['entry_qaa']    = $this->language->get('entry_qaa');

      $data['entry_rating'] = $this->language->get('entry_rating');

      $data['entry_good']   = $this->language->get('entry_good');

      $data['entry_bad']    = $this->language->get('entry_bad');

      $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_upload']   = $this->language->get('button_upload');

      $data['button_continue'] = $this->language->get('button_continue');

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

      $data['tab_description'] = $this->language->get('tab_description');

      $data['tab_attribute']   = $this->language->get('tab_attribute');

      $data['tab_review']      = sprintf($this->language->get('tab_review'), $product_info['reviews']);

      $data['tab_qaa']         = sprintf($this->language->get('tab_qaa'), $product_info['qaas']);

      $data['product_id']    = (int)$this->request->get['product_id'];

      $data['manufacturer']  = $product_info['manufacturer'];

      $data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']);

      $data['model']         = $product_info['model'];

      $data['reward']        = $product_info['reward'];

      $data['points']        = $product_info['points'];

      $data['quick_buy_visible'] = TRUE;

      if ($product_info['quantity'] <= 0) {

        $data['stock'] = $product_info['stock_status'];

        $data['quick_buy_visible']   = FALSE;

      } elseif ($this->config->get('config_stock_display')) {

        $data['stock'] = $product_info['quantity'];

        

      } else {

        $data['stock'] = $this->language->get('text_instock');        

      }

      $data['stock_status_outstock'] = $product_info['stock_status'];
      $data['stock_status_instock'] = $this->language->get('text_instock'); 

        if ($product_info['quantity'] == 0) {

         $data['stock'] = $this->language->get('text_outstock');

        } 

      $this->load->model('tool/image');

      if ($product_info['image']) {

        $data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));

      } else {

        $data['popup'] = '';

      }

      if ($product_info['image']) {

        $data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));

      } else {

        $data['thumb'] = '';

      }

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

      $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);

      foreach ($results as $result) {

        $data['images'][] = array(

            'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),

            'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height')),

        );

      }

      if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {

        $data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));

      } else {

        $data['price'] = false;

      }

      if ((float)$product_info['special']) {

        $data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));

      } else {

        $data['special'] = false;

      }

      if ($this->config->get('config_tax')) {

        $data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']);

      } else {

        $data['tax'] = false;

      }

      $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);

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

      foreach ($discounts as $discount) {

        $data['discounts'][] = array(

            'quantity' => $discount['quantity'],

            'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))),

        );

      }


          $data['raw_price'] = $data['price'];
          $data['raw_special'] = $data['special'];
        
          if ($data['price']) {
              $data['price'] = '<span class=\'autocalc-product-price\'>' . $data['price'] . '</span>';
          }
          if ($data['special']) {
              $data['special'] = '<span class=\'autocalc-product-special\'>' . $data['special'] . '</span>';
          }
          if ($data['points']) {
              $data['points'] = '<span class=\'autocalc-product-points\'>' . $data['points'] . '</span>';
          }
          
          $data['price_value'] = $product_info['price'];
          $data['special_value'] = $product_info['special'];
          $data['tax_value'] = (float)$product_info['special'] ? $product_info['special'] : $product_info['price'];
          $data['points_value'] = $product_info['points'];
          
          $var_currency = array();
          $currency_code = !empty($this->session->data['currency']) ? $this->session->data['currency'] : $this->config->get('config_currency');
          $var_currency['value'] = $this->currency->getValue($currency_code);
          $var_currency['symbol_left'] = $this->currency->getSymbolLeft($currency_code);
          $var_currency['symbol_right'] = $this->currency->getSymbolRight($currency_code);
          $var_currency['decimals'] = $this->currency->getDecimalPlace($currency_code);
          $var_currency['decimal_point'] = $this->language->get('decimal_point');
          $var_currency['thousand_point'] = $this->language->get('thousand_point');
          $data['autocalc_currency'] = $var_currency;

          $currency2_code = $this->config->get('config_currency2');
          if ($this->currency->has($currency2_code) && $currency2_code != $currency_code) {
              $var_currency = array();
              $currency_code = $currency2_code;
              $var_currency['value'] = $this->currency->getValue($currency_code);
              $var_currency['symbol_left'] = $this->currency->getSymbolLeft($currency_code);
              $var_currency['symbol_right'] = $this->currency->getSymbolRight($currency_code);
              $var_currency['decimals'] = $this->currency->getDecimalPlace($currency_code);
              $var_currency['decimal_point'] = $this->language->get('decimal_point');
              $var_currency['thousand_point'] = $this->language->get('thousand_point');
              $data['autocalc_currency2'] = $var_currency;
          }
          
          $data['dicounts_unf'] = $discounts;

          $data['tax_class_id'] = $product_info['tax_class_id'];
          $data['tax_rates'] = $this->tax->getRates(0, $product_info['tax_class_id']);
        
          $data['autocalc_option_special'] = $this->config->get('config_autocalc_option_special');
          $data['autocalc_not_mul_qty'] = $this->config->get('config_autocalc_not_mul_qty');
      
      $data['options'] = array();

      foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) {

        $product_option_value_data = array();

        foreach ($option['product_option_value'] as $option_value) {

          if (!$option_value['subtract'] || ($option_value['quantity'] > 0) || (!empty($data['NotifyWhenAvailable']['Enabled']) && $data['NotifyWhenAvailable']['Enabled']=='yes')) {

            if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {

              $price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false));

            } else {

              $price = false;

            }

            $product_option_value_data[] = array(

          'price_value'                   => $option_value['price'],
          'points_value'                  => intval($option_value['points_prefix'].$option_value['points']),
      

                'product_option_value_id' => $option_value['product_option_value_id'],

                'option_value_id'         => $option_value['option_value_id'],

                'name'                    => $option_value['name'],

                'image'                   => $this->model_tool_image->resize($option_value['image'], 50, 50),

                'price'                   => $price,

                'price_prefix'            => $option_value['price_prefix'],
                            'quantity'                  => $option_value['quantity'],

            );

          }

        }

        $data['options'][] = array(

            'product_option_id'    => $option['product_option_id'],

            'product_option_value' => $product_option_value_data,

            'option_id'            => $option['option_id'],

            'name'                 => $option['name'],

            'type'                 => $option['type'],

            'value'                => $option['value'],

            'required'             => $option['required'],

        );

      }

      if ($product_info['minimum']) {

        $data['minimum'] = $product_info['minimum'];

      } else {

        $data['minimum'] = 1;

      }

      $data['review_status'] = $this->config->get('config_review_status');

      $data['qaa_status'] = $this->config->get('config_qaa_status');

      if ($this->customer->isLogged()) {

        $data['customer_name'] = $this->customer->getFirstName() . '&nbsp;' . $this->customer->getLastName();

      } else {

        $data['customer_name'] = '';

      }

      $data['reviews']          = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']);

      $data['rating']           = (int)$product_info['rating'];

      $data['description']      = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');

      $data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);

      $data['attribute_main_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id'],true);

     

     

      $data['text_main_attribute'] = $this->language->get('text_main_attribute');

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

      $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);

      foreach ($results as $result) {

        if ($result['image']) {

          $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));

        } else {

          $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('config_image_related_width'), $this->config->get('config_image_related_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['stickers'] = false;

        $sticker_new      = false;

        $sticker_special  = false;

        $sticker_rating   = false;

        $sticker_vip      = false;

        if ($this->config->get('stickers_status')) {

          $data['stickers'] = true;

          if ($this->config->get('stickers_new_status')) {

            $date_added = strtotime($result['date_added']);

            $date_now   = strtotime(date("Y-m-d H:i:s"));

            $days       = (int)date('d', $date_now - $date_added);

            if ($days < (int)$this->config->get('stickers_new_days')) {

              $sticker_new = array(

                  'status'  => true,

                  'z_index' => $this->config->get('stickers_new_sort_order'),

              );

            } else {

              $sticker_new = false;

            }

          }

          if ($this->config->get('stickers_special_status')) {

            if ($special) {

              $sticker_special = array(

                  'status'  => true,

                  'z_index' => $this->config->get('stickers_special_sort_order'),

              );

              true;

            } else {

              $sticker_special = false;

            }

          }

          if ($this->config->get('stickers_rating_status')) {

            switch ($this->config->get('stickers_rating_criteria')) {

              case 'view':

                if ($result['viewed'] >= (int)$this->config->get('stickers_rating_value')) {

                  $sticker_rating = array(

                      'status'  => true,

                      'z_index' => $this->config->get('stickers_rating_sort_order'),

                  );

                } else {

                  $sticker_rating = false;

                }

                break;

              case 'rating':

                if ($result['reviews'] >= (int)$this->config->get('stickers_rating_value')) {

                  $sticker_rating = array(

                      'status'  => true,

                      'z_index' => $this->config->get('stickers_rating_sort_order'),

                  );

                } else {

                  $sticker_rating = false;

                }

                break;

              case 'purchase':

                if ((int)$this->model_catalog_product->getNumberOfSales($result['product_id']) >= (int)$this->config->get('stickers_rating_value')) {

                  $sticker_rating = array(

                      'status'  => true,

                      'z_index' => $this->config->get('stickers_rating_sort_order'),

                  );

                } else {

                  $sticker_rating = false;

                }

                break;

            }

          }

          if ($this->config->get('stickers_vip_status')) {

            if (in_array($result['product_id'], $this->config->get('stickers_vip_products'))) {

              $sticker_vip = array(

                  'status'  => true,

                  'z_index' => $this->config->get('stickers_vip_sort_order'),

              );

            } else {

              $sticker_vip = 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('config_product_description_length')) . '..',

            'price'           => $price,

            'special'         => $special,

            'tax'             => $tax,

            'minimum'         => $result['minimum'] > 0 ? $result['minimum'] : 1,

            'rating'          => $rating,

            'reviews_count'   => sprintf($this->language->get('reviews_count'), $result['reviews']),

            'href'            => $this->url->link('product/product', 'product_id=' . $result['product_id']),

            'sticker_rating'  => $sticker_rating,

            'sticker_special' => $sticker_special,

            'sticker_new'     => $sticker_new,

            'sticker_vip'     => $sticker_vip,

        );

      }

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

      if ($product_info['tag']) {

        $tags = explode(',', $product_info['tag']);

        foreach ($tags as $tag) {

          $data['tags'][] = array(

              'tag'  => trim($tag),

              'href' => $this->url->link('product/search', 'tag=' . trim($tag)),

          );

        }

      }

      $data['text_payment_recurring'] = $this->language->get('text_payment_recurring');

      $data['recurrings']             = $this->model_catalog_product->getProfiles($this->request->get['product_id']);

      $this->model_catalog_product->updateViewed($this->request->get['product_id']);

      if ($this->config->get('config_google_captcha_status')) {

        $this->document->addScript('https://www.google.com/recaptcha/api.js');

        $data['site_key'] = $this->config->get('config_google_captcha_public');

      } else {

        $data['site_key'] = '';

      }

      $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');

      $data['trust']         = $this->load->controller('module/trust');

      if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {

        $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/product.tpl', $data));

      } else {

        $this->response->setOutput($this->load->view('default/template/product/product.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['manufacturer_id'])) {

        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];

      }

      if (isset($this->request->get['search'])) {

        $url .= '&search=' . $this->request->get['search'];

      }

      if (isset($this->request->get['tag'])) {

        $url .= '&tag=' . $this->request->get['tag'];

      }

      if (isset($this->request->get['description'])) {

        $url .= '&description=' . $this->request->get['description'];

      }

      if (isset($this->request->get['category_id'])) {

        $url .= '&category_id=' . $this->request->get['category_id'];

      }

      if (isset($this->request->get['sub_category'])) {

        $url .= '&sub_category=' . $this->request->get['sub_category'];

      }

      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/product', $url . '&product_id=' . $product_id),

      );

      $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));

      }

    }

  }

  public function review() {

    $this->load->language('product/product');

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

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

    $data['text_no_reviews'] = $this->language->get('text_no_reviews');

    $data['text_write']   = $this->language->get('text_write');

    $data['text_note']   = $this->language->get('text_note');

    $data['text_loading']   = $this->language->get('text_loading');

    $data['text_login']   = $this->language->get('text_login');

    $data['entry_name']   = $this->language->get('entry_name');

    $data['entry_review']   = $this->language->get('entry_review');

    $data['entry_rating']   = $this->language->get('entry_rating');

    $data['entry_bad']   = $this->language->get('entry_bad');

    $data['entry_good']   = $this->language->get('entry_good');

    $data['button_continue']   = $this->language->get('button_continue');

    if (isset($this->request->get['page'])) {

      $page = $this->request->get['page'];

    } else {

      $page = 1;

    }

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

    $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);

    $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);

    foreach ($results as $result) {

      $data['reviews'][] = array(

          'author'     => $result['author'],

          'text'       => nl2br($result['text']),

          'rating'     => (int)$result['rating'],

          'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),

      );

    }

    $pagination        = new Pagination();

    $pagination->total = $review_total;

    $pagination->page  = $page;

    $pagination->limit = 5;

    $pagination->url   = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');

    $data['pagination'] = $pagination->render();

    $data['results'] = sprintf($this->language->get('text_pagination'), ($review_total) ? (($page - 1) * 5) + 1 : 0, ((($page - 1) * 5) > ($review_total - 5)) ? $review_total : ((($page - 1) * 5) + 5), $review_total, ceil($review_total / 5));

    if ($this->config->get('config_review_guest') || $this->customer->isLogged()) {

      $data['review_guest'] = true;

    } else {

      $data['review_guest'] = false;

    }

    if ($this->config->get('config_google_captcha_status')) {

      $this->document->addScript('https://www.google.com/recaptcha/api.js');

      $data['site_key'] = $this->config->get('config_google_captcha_public');

    } else {

      $data['site_key'] = '';

    }

    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {

      $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/review.tpl', $data));

    } else {

      $this->response->setOutput($this->load->view('default/template/product/review.tpl', $data));

    }

  }

  public function write() {

    $this->load->language('product/product');

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

    $json = array();

    if ($this->request->server['REQUEST_METHOD'] == 'POST') {

      if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {

        $json['error'] = $this->language->get('error_name');

      }

      if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {

        $json['error'] = $this->language->get('error_text');

      }

      if (empty($this->request->post['rating']) || $this->request->post['rating'] < 0 || $this->request->post['rating'] > 5) {

        $json['error'] = $this->language->get('error_rating');

      }

      if ($this->config->get('config_google_captcha_status') && empty($json['error'])) {

        if (isset($this->request->post['g-recaptcha-response'])) {

          $recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('config_google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);

          $recaptcha = json_decode($recaptcha, true);

          if (!$recaptcha['success']) {

            $json['error'] = $this->language->get('error_captcha');

          }

        } else {

          $json['error'] = $this->language->get('error_captcha');

        }

      }

      if (!isset($json['error'])) {

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

        $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);

        $json['success'] = $this->language->get('text_success');

      }

    }

    $this->response->addHeader('Content-Type: application/json');

    $this->response->setOutput(json_encode($json));

  }

  public function qaa() {

    $this->load->language('product/product');

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

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

    $data['text_answer']  = $this->language->get('text_answer');

    $data['text_no_qaas'] = $this->language->get('text_no_qaas');

    $data['text_write_qaa'] = $this->language->get('text_write_qaa');

    $data['text_note'] = $this->language->get('text_note');

    $data['text_loading'] = $this->language->get('text_loading');

    $data['text_login'] = $this->language->get('text_login');

    $data['entry_name'] = $this->language->get('entry_name');

    $data['entry_qaa'] = $this->language->get('entry_qaa');

    $data['button_continue'] = $this->language->get('button_continue');

    $data['button_qaa'] = $this->language->get('button_qaa');

    if (isset($this->request->get['page'])) {

      $page = $this->request->get['page'];

    } else {

      $page = 1;

    }

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

    $qaa_total = $this->model_catalog_qaa->getTotalQaasByProductId($this->request->get['product_id']);

    $results = $this->model_catalog_qaa->getQaasByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);

    foreach ($results as $result) {

      $data['qaas'][] = array(

          'author'     => $result['author'],

          'text'       => nl2br($result['text']),

          'answer'     => $result['answer'],

          'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),

      );

    }

    $pagination        = new Pagination();

    $pagination->total = $qaa_total;

    $pagination->page  = $page;

    $pagination->limit = 5;

    $pagination->url   = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');

    $data['pagination'] = $pagination->render();

    $data['results'] = sprintf($this->language->get('text_pagination'), ($qaa_total) ? (($page - 1) * 5) + 1 : 0, ((($page - 1) * 5) > ($qaa_total - 5)) ? $qaa_total : ((($page - 1) * 5) + 5), $qaa_total, ceil($qaa_total / 5));

    if ($this->config->get('config_qaa_guest') || $this->customer->isLogged()) {

      $data['qaa_guest'] = true;

    } else {

      $data['qaa_guest'] = false;

    }

    if ($this->config->get('config_google_captcha_status')) {

      $this->document->addScript('https://www.google.com/recaptcha/api.js');

      $data['site_key'] = $this->config->get('config_google_captcha_public');

    } else {

      $data['site_key'] = '';

    }

    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/qaa.tpl')) {

      $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/qaa.tpl', $data));

    } else {

      $this->response->setOutput($this->load->view('default/template/product/qaa.tpl', $data));

    }

  }

  public function writeQaa() {

    $this->load->language('product/product');

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

    $json = array();

    if ($this->request->server['REQUEST_METHOD'] == 'POST') {

      if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {

        $json['error'] = $this->language->get('error_name');

      }

      if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {

        $json['error'] = $this->language->get('error_text');

      }

      if ($this->config->get('config_google_captcha_status') && empty($json['error'])) {

        if (isset($this->request->post['g-recaptcha-response'])) {

          $recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('config_google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);

          $recaptcha = json_decode($recaptcha, true);

          if (!$recaptcha['success']) {

            $json['error'] = $this->language->get('error_captcha');

          }

        } else {

          $json['error'] = $this->language->get('error_captcha');

        }

      }

      if (!isset($json['error'])) {

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

        $this->model_catalog_qaa->addQaa($this->request->get['product_id'], $this->request->post);

        $json['success'] = $this->language->get('text_success');

      }

    }

    $this->response->addHeader('Content-Type: application/json');

    $this->response->setOutput(json_encode($json));

  }

  public function getRecurringDescription() {

    $this->language->load('product/product');

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

    if (isset($this->request->post['product_id'])) {

      $product_id = $this->request->post['product_id'];

    } else {

      $product_id = 0;

    }

    if (isset($this->request->post['recurring_id'])) {

      $recurring_id = $this->request->post['recurring_id'];

    } else {

      $recurring_id = 0;

    }

    if (isset($this->request->post['quantity'])) {

      $quantity = $this->request->post['quantity'];

    } else {

      $quantity = 1;

    }

    $product_info   = $this->model_catalog_product->getProduct($product_id);

    $recurring_info = $this->model_catalog_product->getProfile($product_id, $recurring_id);

    $json = array();

    if ($product_info && $recurring_info) {

      if (!$json) {

        $frequencies = array(

            'day'        => $this->language->get('text_day'),

            'week'       => $this->language->get('text_week'),

            'semi_month' => $this->language->get('text_semi_month'),

            'month'      => $this->language->get('text_month'),

            'year'       => $this->language->get('text_year'),

        );

        if ($recurring_info['trial_status'] == 1) {

          $price      = $this->currency->format($this->tax->calculate($recurring_info['trial_price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax')));

          $trial_text = sprintf($this->language->get('text_trial_description'), $price, $recurring_info['trial_cycle'], $frequencies[$recurring_info['trial_frequency']], $recurring_info['trial_duration']) . ' ';

        } else {

          $trial_text = '';

        }

        $price = $this->currency->format($this->tax->calculate($recurring_info['price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax')));

        if ($recurring_info['duration']) {

          $text = $trial_text . sprintf($this->language->get('text_payment_description'), $price, $recurring_info['cycle'], $frequencies[$recurring_info['frequency']], $recurring_info['duration']);

        } else {

          $text = $trial_text . sprintf($this->language->get('text_payment_cancel'), $price, $recurring_info['cycle'], $frequencies[$recurring_info['frequency']], $recurring_info['duration']);

        }

        $json['success'] = $text;

      }

    }

    $this->response->addHeader('Content-Type: application/json');

    $this->response->setOutput(json_encode($json));

  }

}

 

и вот  review.tpl :
 

<form class="form-horizontal" id="form-review">
  <div id="review">
    <?php if ($reviews) { ?>
      <?php foreach ($reviews as $review) { ?>
        <table class="table table-striped table-bordered">
          <tr>
            <td style="width: 50%;"><strong><?php echo $review['author']; ?></strong></td>
            <td class="text-right"><?php echo $review['date_added']; ?></td>
          </tr>
          <tr>
            <td colspan="2"><p><?php echo $review['text']; ?></p>
              <?php for ($i = 1; $i <= 5; $i++) { ?>
                <?php if ($review['rating'] < $i) { ?>
                  <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                <?php } else { ?>
                  <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
                <?php } ?>
              <?php } ?></td>
          </tr>
        </table>
      <?php } ?>
      <div class="text-right"><?php echo $pagination; ?></div>
    <?php } else { ?>
      <p><?php echo $text_no_reviews; ?></p>
    <?php } ?>
  </div>
  <h2><?php echo $text_write; ?></h2>
  <?php if ($review_guest) { ?>
    <div class="form-group required">
      <div class="col-sm-12">
        <label class="control-label" for="input-name"><?php echo $entry_name; ?></label>
        <input type="text" name="name" value="" id="input-name" class="form-control" />
      </div>
    </div>
    <div class="form-group required">
      <div class="col-sm-12">
        <label class="control-label" for="input-review"><?php echo $entry_review; ?></label>
        <textarea name="text" rows="5" id="input-review" class="form-control"></textarea>

        <div class="help-block"><?php echo $text_note; ?></div>
      </div>
    </div>
    <div class="form-group required">
      <div class="col-sm-12">
        <label class="control-label"><?php echo $entry_rating; ?></label>
        &nbsp;&nbsp;&nbsp; <?php echo $entry_bad; ?>&nbsp;
        <input type="radio" name="rating" value="1" />
        &nbsp;
        <input type="radio" name="rating" value="2" />
        &nbsp;
        <input type="radio" name="rating" value="3" />
        &nbsp;
        <input type="radio" name="rating" value="4" />
        &nbsp;
        <input type="radio" name="rating" value="5" />
        &nbsp;<?php echo $entry_good; ?></div>
    </div>
    <?php if ($site_key) { ?>
      <div class="form-group">
        <div class="col-sm-12">
          <div class="g-recaptcha" id="review_recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>
        </div>
      </div>
    <?php } ?>
    <div class="buttons clearfix">
      <div class="pull-right">
        <button type="button" id="button-review" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary"><?php echo $button_continue; ?></button>
      </div>
    </div>
  <?php } else { ?>
    <?php echo $text_login; ?>
  <?php } ?>
</form>
<script type="text/javascript">
$('#tab-review').delegate('#button-review', 'click', function () {
      $.ajax({
        url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
        type: 'post',
        dataType: 'json',
        data: $("#form-review").serialize(),
        beforeSend: function () {
          loader.start();
          $('#button-review').button('loading');
        },
        complete: function () {
          loader.end();
          $('#button-review').button('reset');
        },
        success: function (json) {
          $('.alert-success, .alert-danger').remove();

          if (json['error']) {
            $('#tab-review input[name=\'rating\']:checked').after('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
          }

          if (json['success']) {
            $('#tab-review input[name=\'rating\']:checked').after('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');

            $('#tab-review input[name=\'name\']').val('');
            $('#tab-review textarea[name=\'text\']').val('');
            $('#tab-review input[name=\'rating\']:checked').prop('checked', false);
          }
        }
      });
    });
</script>

 

 

Ссылка на комментарий
Поделиться на других сайтах


Научитесь пользоваться кнопкой вставки кода!

Непонятно, где переменная теряется, но где-то теряется. Попробуйте и в контроллере и в шаблоне поменять название переменной. Например, $data['product_id_test'] и $product_id_test.

Меняйте в оригинальном контроллере, а не из кеша, а потом обновите кеш модификаторов.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


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

Научитесь пользоваться кнопкой вставки кода!

Непонятно, где переменная теряется, но где-то теряется. Попробуйте и в контроллере и в шаблоне поменять название переменной. Например, $data['product_id_test'] и $product_id_test.

Меняйте в оригинальном контроллере, а не из кеша, а потом обновите кеш модификаторов.

Если не сложно, для особо одаренного, напишите в каких файлах поменять название переменной ))

Ссылка на комментарий
Поделиться на других сайтах


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

Если не сложно, для особо одаренного, напишите в каких файлах поменять название переменной ))

Вот в тех двух, которые выложили, в них и поменяйте.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


6 минут назад, Dotrox сказал:

Вот в тех двух, которые выложили, в них и поменяйте.

Так а во втором такого как  $data['product вроде бы как нет.

Ссылка на комментарий
Поделиться на других сайтах


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

Читайте внимательно:

 

Вы меня наверное возненавидите, но я окончательно запутался )
Я думал вы имеете в виду,  $data['product_id_test']  поменять на  $product_id_test
Что поменять в первом, а что во втором файле? )

Ссылка на комментарий
Поделиться на других сайтах


2 минуты назад, Olegshturman сказал:

Я думал вы имеете в виду,  $data['product_id_test']  поменять на  $product_id_test

Нет, это то, на что надо поменять. Первое - для контроллера, второе - для шаблона.

Чтоб было понятней - я просто добавил в конец к существующему названию _test. То есть, и вам надо сделать именно это.

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


6 минут назад, Dotrox сказал:

Нет, это то, на что надо поменять. Первое - для контроллера, второе - для шаблона.

Чтоб было понятней - я просто добавил в конец к существующему названию _test. То есть, и вам надо сделать именно это.

Для контроллера что поменять на  $data['product_id_test']  и 
в шаблоне что поменять на  $product_id_test
Заранее благодарен!

Ссылка на комментарий
Поделиться на других сайтах


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

Ох. Очевидно же, что $data['product_id'] и $product_id. Я же написал, что просто добавил _test.

А вы бы не могли в этих файлах поменять? ) 

product.php

review.tpl

Ссылка на комментарий
Поделиться на других сайтах


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

А вы бы не могли в этих файлах поменять? )

Нет. Вы либо всё делаете сами и обращаетесь на форум за советами, либо не делаете вообще ничего, а просто платите, и всё сделают за вас.

На самом деле, если возникли такие сложности с переименованием переменных (а это далеко не самое сложное, что может понадобиться), я думаю, что вам лучше всё же воспользоваться вторым вариантом, иначе решение проблемы может растянуться на очень длительный срок

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


8 минут назад, Dotrox сказал:

Нет. Вы либо всё делаете сами и обращаетесь на форум за советами, либо не делаете вообще ничего, а просто платите, и всё сделают за вас.

На самом деле, если возникли такие сложности с переименованием переменных (а это далеко не самое сложное, что может понадобиться), я думаю, что вам лучше всё же воспользоваться вторым вариантом, иначе решение проблемы может растянуться на очень длительный срок

Согласен с вами полностью. Просто я так и не понял какую строку на какую поменять.
В контроллере какую строку поменять на  $data['product_id']       ?
В шаблоне какую строку поменять на  $product_id     ?

Ссылка на комментарий
Поделиться на других сайтах


30 минут назад, Dotrox сказал:

Нет. Вы либо всё делаете сами и обращаетесь на форум за советами, либо не делаете вообще ничего, а просто платите, и всё сделают за вас.

На самом деле, если возникли такие сложности с переименованием переменных (а это далеко не самое сложное, что может понадобиться), я думаю, что вам лучше всё же воспользоваться вторым вариантом, иначе решение проблемы может растянуться на очень длительный срок

Без обид. Я вот думал на какой минуте "матча" у вас сдадут нервы (у меня бы раньше сдали :-D)
ТС - вам реально просто надо нанять кого то
Если вы не разбираетесь в двигателях вы же не лезете им кап. ремонт делать. "Нанимаете" специалиста
Может лучше к спецам обратиться в этой области. К примеру к тому же Dotrox

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах

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

Без обид. Я вот думал на какой минуте "матча" у вас сдадут нервы (у меня бы раньше сдали :-D)
ТС - вам реально просто надо нанять кого то
Если вы не разбираетесь в двигателях вы же не лезете им кап. ремонт делать

Нанял бы, были бы на это средства ) А так увы, приходится самому )

Изменено пользователем Olegshturman
Ссылка на комментарий
Поделиться на других сайтах


25 минут назад, Olegshturman сказал:

В контроллере какую строку поменять на  $data['product_id']       ?
В шаблоне какую строку поменять на  $product_id     ?

Эти строки там у вас уже есть. Именно их вам и надо поменять. И замена заключается просто в том, что к ним нужно дописать _test (а что в результате должно получиться я уже написал выше).

 

18 минут назад, markimax сказал:

Я вот думал на какой минуте "матча" у вас сдадут нервы (у меня бы раньше сдали :-D)

Есть на форуме люди, которые заряжают меня терпимостью :)

  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


13 минут назад, Dotrox сказал:

Эти строки там у вас уже есть. Именно их вам и надо поменять. И замена заключается просто в том, что к ним нужно дописать _test (а что в результате должно получиться я уже написал выше).

Наконец-то до меня дошло ) 
Сделал все, как вы сказали. Ничего не произошло (

Ссылка на комментарий
Поделиться на других сайтах


Кажется, я понял в чём проблема. Вероятно, в этом шаблоне отзывы ни у кого не работают (либо у вас не сработал модификатор, который должен был поправить контроллер). Автор шаблона перенёс форму отзывов из шаблона страницы товара в шаблон вывода отзывов, за заполнение которого отвечает другой метод в контроллере.

Вот это

$data['product_id'] = (int)$this->request->get['product_id'];

должно быть в методе review, а не index.

 

Найдите в контроллере строку

public function review() {

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

 

И не забудьте в шаблоне название вернуть обратно.

 

Кстати, для справки: что в контроллере записано так - $data['product_id'], в шаблоне выводиться так - $product_id. А всё, что в контроллере не в таком формате, как я написал, то в шаблон вообще не попадает.

Изменено пользователем Dotrox
  • +1 1
Ссылка на комментарий
Поделиться на других сайтах


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

Кажется, я понял в чём проблема. Вероятно, в этом шаблоне отзывы ни у кого не работают (либо у вас не сработал модификатор, который должен был поправить контроллер). Автор шаблона перенёс форму отзывов из шаблона страницы товара в шаблон вывода отзывов, за заполнение которого отвечает другой метод в контроллере.

Вот это


$data['product_id'] = (int)$this->request->get['product_id'];

должно быть в методе review, а не index.

 

Найдите в контроллере строку


public function review() {

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

 

И не забудьте в шаблоне название вернуть обратно.

 

Кстати, для справки: что в контроллере записано так - $data['product_id'], в шаблоне выводиться так - $product_id. А всё, что в контроллере не в таком формате, как я написал, то в шаблон вообще не попадает.

Горе мне окаянному! )
Прописал код 

$data['product_id'] = (int)$this->request->get['product_id'];

после 

public function review() {

Обновляю модификатор и код стирается (((
Что я не так сделал? )

Ссылка на комментарий
Поделиться на других сайтах


Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас
 Поделиться

×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обработка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфиденциальности.