$result =
new AvailableCombinationResult();
foreach ($combinations as $combination) { try { $options =
json_decode((string) $combination['options'
], true, 512, \JSON_THROW_ON_ERROR
);
} catch (\JsonException
) { continue;
} $available =
(bool) $combination['available'
];
$result->
addCombination($options,
$available);
} return $result;
} public function loadCombinations(string
$productId, SalesChannelContext
$salesChannelContext): AvailableCombinationResult
{ $combinations =
$this->
getCombinations( $productId,
$salesChannelContext->
getContext(),
$salesChannelContext->
getSalesChannel()->
getId() );