|
|
@@ -455,18 +455,17 @@ class Product extends ActiveRecordCommon |
|
|
|
public function getSpecificPricesFilterByPriorityMatch($specificPrices, $user, $pointSale) |
|
|
|
{ |
|
|
|
$priorityMatchSpecificPrice = ProductPrice::getPriorityMatchOfSpecificPriceArray($specificPrices, $user, $pointSale); |
|
|
|
$specificPricesFilter = []; |
|
|
|
|
|
|
|
if($priorityMatchSpecificPrice) { |
|
|
|
foreach($specificPrices as $keySpecificPrice => $specificPrice) { |
|
|
|
if(!$specificPrice->$priorityMatchSpecificPrice($user, $pointSale)) { |
|
|
|
unset($specificPrices[$keySpecificPrice]); |
|
|
|
} |
|
|
|
} |
|
|
|
foreach($specificPrices as $keySpecificPrice => $specificPrice) { |
|
|
|
if(($priorityMatchSpecificPrice && $specificPrice->$priorityMatchSpecificPrice($user, $pointSale)) |
|
|
|
|| $specificPrice->matchFromQuantityOnly()) { |
|
|
|
|
|
|
|
return $specificPrices; |
|
|
|
$specificPricesFilter[] = $specificPrice; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return []; |
|
|
|
return $specificPricesFilter; |
|
|
|
} |
|
|
|
|
|
|
|
public function getPrice($params = []) |