public function __construct(protected bool
$clearanceSale = false
) { parent::
__construct();
} /**
* @throws CartException
*/
public function match(RuleScope
$scope): bool
{ if ($scope instanceof LineItemScope
) { return $this->
matchesClearanceSaleCondition($scope->
getLineItem());
} if (!
$scope instanceof CartRuleScope
) { return false;
} foreach ($scope->
getCart()->
getLineItems()->
filterGoodsFlat() as $lineItem) { if ($this->
matchesClearanceSaleCondition($lineItem)) { return true;
} }