Skip to content

Commit

Permalink
Fixed issue #599
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Brookbanks committed Jun 16, 2015
1 parent 85179f0 commit e4ee362
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/catalogue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,8 @@ public function searchCatalogue($search_data = null, $page = 1, $per_page = 10,
$match_val = '0.5';

$query = sprintf("SELECT I.*, %2\$s AS Relevance FROM %1\$sCubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM %1\$sCubeCart_pricing_group $group_id GROUP BY product_id) as G ON G.product_id = I.product_id $joinString WHERE I.product_id IN (SELECT product_id FROM `%1\$sCubeCart_category_index` as CI INNER JOIN %1\$sCubeCart_category as C where CI.cat_id = C.cat_id AND C.status = 1) AND I.status = 1 AND (%2\$s) >= %4\$s %3\$s %5\$s %6\$s", $GLOBALS['config']->get('config', 'dbprefix'), $match, $whereString, $match_val, $order_string, $limit);
if (($search = $GLOBALS['db']->query($query)) !== false) {

if ($search = $GLOBALS['db']->query($query)) {
$q2 = sprintf("SELECT COUNT(I.product_id) as count, %2\$s AS Relevance FROM %1\$sCubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM %1\$sCubeCart_pricing_group $group_id GROUP BY product_id) as G ON G.product_id = I.product_id $joinString WHERE I.product_id IN (SELECT product_id FROM `%1\$sCubeCart_category_index` as CI INNER JOIN %1\$sCubeCart_category as C where CI.cat_id = C.cat_id AND C.status = 1) AND I.status = 1 AND (%2\$s) >= %4\$s %3\$s GROUP BY I.product_id %5\$s", $GLOBALS['config']->get('config', 'dbprefix'), $match, $whereString, $match_val, $order_string);
$count = $GLOBALS['db']->query($q2, false, 0);
$this->_category_count = (int)count($count);
Expand Down

0 comments on commit e4ee362

Please sign in to comment.