Diff
232
298
298
search.php
  |
19 | 19 | | $_date_to, |
| |
20 | 20 | | $_price_from, |
| |
21 | 21 | | $_price_to, |
  |
22 | | - | $_keywords; |
| |
| 22 | + | $_keywords, |
| |
| 23 | + | $_number_of_results; |
|
23 | 24 | | |
| |
24 | 25 | | /* Class constructor */ |
| |
25 | 26 | | |
| |
|
|
 |
… |
|
64 | 65 | | return $this->_keywords; |
| |
65 | 66 | | } |
| |
66 | 67 | | |
  |
| 68 | + | function getNumberOfResults() { |
| |
| 69 | + | return $this->_number_of_results; |
| |
| 70 | + | } |
| |
| 71 | + | |
|
67 | 72 | | function hasDateSet($flag = null) { |
| |
68 | 73 | | if ($flag == 'from') { |
| |
69 | 74 | | return isset($this->_date_from); |
| |
|
|
 |
… |
|
129 | 134 | | function &execute() { |
| |
130 | 135 | | global $osC_Database, $osC_Customer, $osC_Currencies; |
| |
131 | 136 | | |
  |
132 | | - | $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'); |
| |
| 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'); |
|
133 | 138 | | |
| |
134 | 139 | | if (($this->hasPriceSet('from') || $this->hasPriceSet('to')) && (DISPLAY_PRICE_WITH_TAX == 'true')) { |
| |
135 | 140 | | $Qlisting->appendQuery(', sum(tr.tax_rate) as tax_rate'); |
| |
|
|
 |
… |
|
256 | 261 | | $Qlisting->setBatchLimit((isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1), MAX_DISPLAY_SEARCH_RESULTS); |
| |
257 | 262 | | $Qlisting->execute(); |
| |
258 | 263 | | |
  |
| 264 | + | $this->_number_of_results = $Qlisting->getBatchSize(); |
| |
| 265 | + | |
  |
259 | 266 | | return $Qlisting; |
| |
260 | 267 | | } |
| |
261 | 268 | | } |
|