  |
36 | 36 | | if ($Qproduct->numberOfRows() === 1) { |
| |
37 | 37 | | $this->_data = $Qproduct->toArray(); |
| |
38 | 38 | | |
  |
| 39 | + | $Qcategory = $osC_Database->query('select categories_id from :table_products_to_categories where products_id = :products_id limit 1'); |
| |
| 40 | + | $Qcategory->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); |
| |
| 41 | + | $Qcategory->bindInt(':products_id', $this->_data['id']); |
| |
| 42 | + | $Qcategory->execute(); |
| |
| 43 | + | |
| |
| 44 | + | $this->_data['category_id'] = $Qcategory->valueInt('categories_id'); |
| |
| 45 | + | |
|
39 | 46 | | $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes patrib where products_id = :products_id limit 1'); |
| |
40 | 47 | | $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES); |
| |
41 | 48 | | $Qcheck->bindInt(':products_id', $this->_data['id']); |
| |
|
|
 |
… |
|
143 | 150 | | return $price; |
| |
144 | 151 | | } |
| |
145 | 152 | | |
  |
| 153 | + | function getCategoryID() { |
| |
| 154 | + | return $this->_data['category_id']; |
| |
| 155 | + | } |
| |
| 156 | + | |
  |
146 | 157 | | function hasImage() { |
| |
147 | 158 | | return (isset($this->_data['image']) && !empty($this->_data['image'])); |
| |
148 | 159 | | } |