//// Merge -> revision 8290
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8295 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -138,7 +138,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
AND
|
||||
(`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`)
|
||||
)
|
||||
ORDER BY `score` DESC, `from_quantity` DESC');
|
||||
ORDER BY `from_quantity` DESC, `score` DESC, `from_quantity` DESC');
|
||||
}
|
||||
return self::$_specificPriceCache[$key];
|
||||
}
|
||||
@@ -192,19 +192,20 @@ class SpecificPriceCore extends ObjectModel
|
||||
AND
|
||||
(`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`)
|
||||
)
|
||||
ORDER BY `score` DESC, `from_quantity` DESC
|
||||
ORDER BY `from_quantity` DESC, `score` DESC
|
||||
');
|
||||
|
||||
$targeted_prices = array();
|
||||
$max_score = NULL;
|
||||
$last_quantity = NULL;
|
||||
|
||||
foreach($res as $specific_price)
|
||||
{
|
||||
if (!isset($max_score))
|
||||
$max_score = $specific_price['score'];
|
||||
else if ($max_score != $specific_price['score'])
|
||||
if (!isset($last_quantity))
|
||||
$last_quantity = $specific_price['from_quantity'];
|
||||
else if ($last_quantity == $specific_price['from_quantity'])
|
||||
break;
|
||||
|
||||
$last_quantity = $specific_price['from_quantity'];
|
||||
if ($specific_price['from_quantity'] > 1)
|
||||
$targeted_prices[] = $specific_price;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user