Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

211
 
213
 
213
 
product.php
_> 1414     var $_data = array();
  1515 
  1616     function osC_Product($id) {
<> 17 -      global $osC_Database;
   17+      global $osC_Database, $osC_Services;
1818 
  1919       $Qproduct = $osC_Database->query('select pd.products_name as name, pd.products_description as description, p.products_model as model, p.products_quantity as quantity, p.products_image as image, pd.products_url as url, p.products_price as price, p.products_tax_class_id as tax_class_id, p.products_date_added as date_added, p.products_date_available as date_available, p.manufacturers_id from :table_products p, :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id');
  2020       $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
     
 !
5252                                                'price_prefix' => $Qattributes->value('price_prefix'));
  5353         }
  5454       }
<>  55+
   56+      if ($osC_Services->isStarted('reviews')) {
   57+        $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');
   58+        $Qavg->bindTable(':table_reviews', TABLE_REVIEWS);
   59+        $Qavg->bindInt(':products_id', $id);
   60+        $Qavg->bindInt(':languages_id', $_SESSION['languages_id']);
   61+        $Qavg->execute();
   62+
   63+        $this->_data['reviews_average_rating'] = round($Qavg->value('rating'));
   64+      }
5565     }
  5666 
<>  67+    function getData($key) {
   68+      if (isset($this->_data[$key])) {
   69+        return $this->_data[$key];
   70+      }
   71+
   72+      return false;
   73+    }
   74+
<_ 5775     function getID() {
  5876       return $this->_data['id'];
  5977     }