Skip to content

Commit

Permalink
fixup! added parameters to Product frontend API resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik committed Oct 8, 2020
1 parent 468c3a5 commit 3d6d11c
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -48,7 +48,12 @@ public function createMultipleForProduct(Product $product): array

foreach ($productParameterValues as $productParameterValue) {
$parameterId = $productParameterValue->getParameter()->getId();
$valuesByParameterId[$parameterId][] = $productParameterValue->getValue();

if (!array_key_exists($parameterId, $valuesByParameterId)) {
$valuesByParameterId[$parameterId] = [];
}

array_push($valuesByParameterId[$parameterId], $productParameterValue->getValue());
$parameters[$parameterId] = $productParameterValue->getParameter();
}

Expand Down

0 comments on commit 3d6d11c

Please sign in to comment.