Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

246
 
248
 
248
 
product.php
_> 3333         $Qproduct->bindInt(':language_id', $_SESSION['languages_id']);
  3434         $Qproduct->execute();
  3535 
<> 36 -        $this->_data = $Qproduct->toArray();
   36+        if ($Qproduct->numberOfRows() === 1) {
   37+          $this->_data = $Qproduct->toArray();
3738 
<> 38 -        $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes patrib where products_id = :products_id limit 1');
  39 -        $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
  40 -        $Qcheck->bindInt(':products_id', $this->_data['id']);
  41 -        $Qcheck->execute();
   39+          $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes patrib where products_id = :products_id limit 1');
   40+          $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
   41+          $Qcheck->bindInt(':products_id', $this->_data['id']);
   42+          $Qcheck->execute();
4243 
<> 43 -        if ($Qcheck->numberOfRows() === 1) {
  44 -          $this->_data['attributes'] = array();
   44+          if ($Qcheck->numberOfRows() === 1) {
   45+            $this->_data['attributes'] = array();
4546 
<> 46 -          $Qattributes = $osC_Database->query('select pa.*, po.*, pov.* from :table_products_attributes pa, :table_products_options po, :table_products_options_values pov where pa.products_id = :products_id and pa.options_id = po.products_options_id and po.language_id = :language_id and pa.options_values_id = pov.products_options_values_id and pov.language_id = :language_id order by po.products_options_name, pov.products_options_values_name');
  47 -          $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
  48 -          $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
  49 -          $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
  50 -          $Qattributes->bindInt(':products_id', $this->_data['id']);
  51 -          $Qattributes->bindInt(':language_id', $_SESSION['languages_id']);
  52 -          $Qattributes->bindInt(':language_id', $_SESSION['languages_id']);
  53 -          $Qattributes->execute();
   47+            $Qattributes = $osC_Database->query('select pa.*, po.*, pov.* from :table_products_attributes pa, :table_products_options po, :table_products_options_values pov where pa.products_id = :products_id and pa.options_id = po.products_options_id and po.language_id = :language_id and pa.options_values_id = pov.products_options_values_id and pov.language_id = :language_id order by po.products_options_name, pov.products_options_values_name');
   48+            $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
   49+            $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
   50+            $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
   51+            $Qattributes->bindInt(':products_id', $this->_data['id']);
   52+            $Qattributes->bindInt(':language_id', $_SESSION['languages_id']);
   53+            $Qattributes->bindInt(':language_id', $_SESSION['languages_id']);
   54+            $Qattributes->execute();
5455 
<> 55 -          while ($Qattributes->next()) {
  56 -            $this->_data['attributes'][] = array('options_id' => $Qattributes->valueInt('options_id'),
  57 -                                                 'options_name' => $Qattributes->value('products_options_name'),
  58 -                                                 'options_values_id' => $Qattributes->valueInt('options_values_id'),
  59 -                                                 'options_values_name' => $Qattributes->value('products_options_values_name'),
  60 -                                                 'options_values_price' => $Qattributes->value('options_values_price'),
  61 -                                                 'price_prefix' => $Qattributes->value('price_prefix'));
   56+            while ($Qattributes->next()) {
   57+              $this->_data['attributes'][] = array('options_id' => $Qattributes->valueInt('options_id'),
   58+                                                   'options_name' => $Qattributes->value('products_options_name'),
   59+                                                   'options_values_id' => $Qattributes->valueInt('options_values_id'),
   60+                                                   'options_values_name' => $Qattributes->value('products_options_values_name'),
   61+                                                   'options_values_price' => $Qattributes->value('options_values_price'),
   62+                                                   'price_prefix' => $Qattributes->value('price_prefix'));
   63+            }
6264           }
<> 63 -        }
6465 
<> 65 -        if ($osC_Services->isStarted('reviews')) {
  66 -          $Qavg = $osC_Database->query('select avg(reviews_rating) as rating from :table_reviews where products_id = :products_id and languages_id = :languages_id and reviews_status = 1');
  67 -          $Qavg->bindTable(':table_reviews', TABLE_REVIEWS);
  68 -          $Qavg->bindInt(':products_id', $this->_data['id']);
  69 -          $Qavg->bindInt(':languages_id', $_SESSION['languages_id']);
  70 -          $Qavg->execute();
   66+          if ($osC_Services->isStarted('reviews')) {
   67+            $Qavg = $osC_Database->query('select avg(reviews_rating) as rating from :table_reviews where products_id = :products_id and languages_id = :languages_id and reviews_status = 1');
   68+            $Qavg->bindTable(':table_reviews', TABLE_REVIEWS);
   69+            $Qavg->bindInt(':products_id', $this->_data['id']);
   70+            $Qavg->bindInt(':languages_id', $_SESSION['languages_id']);
   71+            $Qavg->execute();
7172 
<> 72 -          $this->_data['reviews_average_rating'] = round($Qavg->value('rating'));
   73+            $this->_data['reviews_average_rating'] = round($Qavg->value('rating'));
   74+          }
7375         }
  7476       }
  7577     }
     
 !
110112       return $this->_data['model'];
  111113     }
  112114 
<>  115+    function hasKeyword() {
   116+      return (isset($this->_data['keyword']) && !empty($this->_data['keyword']));
   117+    }
   118+
113119     function getKeyword() {
  114120       return $this->_data['keyword'];
  115121     }
  116122 
<>  123+    function hasTags() {
   124+      return (isset($this->_data['tags']) && !empty($this->_data['tags']));
   125+    }
   126+
   127+    function getTags() {
   128+      return $this->_data['tags'];
   129+    }
   130+
<_ 117131     function getPrice() {
  118132     }
  119133