public function resolve(Context
$context): ?CheapestPrice
{ $ruleIds =
$context->
getRuleIds();
$ruleIds[] = 'default';
$prices =
[];
$defaultWasAdded = false;
foreach ($this->value
as $variantId =>
$group) { foreach ($ruleIds as $ruleId) { $price =
$this->
filterByRuleId($group,
$ruleId,
$defaultWasAdded);
if ($price === null
) { continue;
} // overwrite the variantId in case the default price was added
$price['variant_id'
] =
$variantId;
$prices[] =
$price;
break;
} }