} $context->
setRuleIds($rules->
getIds());
$context->
setAreaRuleIds($rules->
getIdsByArea());
// save the cart if errors exist, so the errors get persisted
if ($cart->
getErrors()->
count() > 0 ||
$this->
updated($cart,
$timestamps)) { $this->cartPersister->
save($cart,
$context);
} return new RuleLoaderResult($cart,
$rules);
});
} private function loadRules(Context
$context): RuleCollection
{ if ($this->rules !== null
) { return $this->rules;
} return $this->rules =
$this->ruleLoader->
load($context)->
filterForContext();
}