  |
132 | 132 | | } |
| |
133 | 133 | | |
| |
134 | 134 | | function &execute() { |
  |
135 | | - | global $osC_Database, $osC_Customer, $osC_Currencies; |
| |
| 135 | + | global $osC_Database, $osC_Customer, $osC_Currencies, $osC_Language; |
|
136 | 136 | | |
| |
137 | 137 | | $Qlisting = $osC_Database->query('select SQL_CALC_FOUND_ROWS distinct p.*, pd.*, m.*, if(s.status, s.specials_new_products_price, null) as specials_new_products_price, if(s.status, s.specials_new_products_price, p.products_price) as final_price'); |
| |
138 | 138 | | |
| |
|
|
 |
… |
|
167 | 167 | | $Qlisting->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); |
| |
168 | 168 | | |
| |
169 | 169 | | $Qlisting->appendQuery('where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id'); |
  |
170 | | - | $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 170 | + | $Qlisting->bindInt(':language_id', $osC_Language->getID()); |
|
171 | 171 | | |
| |
172 | 172 | | if ($this->hasCategory()) { |
| |
173 | 173 | | if ($this->isRecursive()) { |
| |
|
|
 |
… |
|
185 | 185 | | $Qlisting->appendQuery(')'); |
| |
186 | 186 | | } else { |
| |
187 | 187 | | $Qlisting->appendQuery('and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = :language_id and p2c.categories_id = :categories_id'); |
  |
188 | | - | $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 188 | + | $Qlisting->bindInt(':language_id', $osC_Language->getID()); |
  |
189 | 189 | | $Qlisting->bindInt(':categories_id', $this->_category); |
| |
190 | 190 | | } |
| |
191 | 191 | | } |