  |
79 | 79 | | } |
| |
80 | 80 | | |
| |
81 | 81 | | function &execute() { |
  |
82 | | - | global $osC_Database; |
| |
| 82 | + | global $osC_Database, $osC_Language; |
|
83 | 83 | | |
| |
84 | 84 | | $Qlisting = $osC_Database->query('select 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 from :table_products p left join :table_manufacturers m using(manufacturers_id) left join :table_specials s on (p.products_id = s.products_id), :table_products_description pd, :table_categories c, :table_products_to_categories p2c 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'); |
| |
85 | 85 | | $Qlisting->bindTable(':table_products', TABLE_PRODUCTS); |
| |
|
|
 |
… |
|
88 | 88 | | $Qlisting->bindTable(':table_specials', TABLE_SPECIALS); |
| |
89 | 89 | | $Qlisting->bindTable(':table_categories', TABLE_CATEGORIES); |
| |
90 | 90 | | $Qlisting->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); |
  |
91 | | - | $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 91 | + | $Qlisting->bindInt(':language_id', $osC_Language->getID()); |
|
92 | 92 | | |
| |
93 | 93 | | if ($this->hasCategory()) { |
| |
94 | 94 | | if ($this->isRecursive()) { |
| |
|
|
 |
… |
|
106 | 106 | | $Qlisting->appendQuery(')'); |
| |
107 | 107 | | } else { |
| |
108 | 108 | | $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'); |
  |
109 | | - | $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); |
| |
| 109 | + | $Qlisting->bindInt(':language_id', $osC_Language->getID()); |
  |
110 | 110 | | $Qlisting->bindInt(':categories_id', $this->_category); |
| |
111 | 111 | | } |
| |
112 | 112 | | } |