Skip to content

Commit

Permalink
change super_group to grouped_options
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie committed Nov 12, 2020
1 parent be84eb1 commit c936161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
);
if ($buyRequest->getSuperGroup()) {
$serializedValue = $this->serializer->serialize($buyRequest->getSuperGroup());
$_result[0]->addCustomOption('super_group', $serializedValue);
$_result[0]->addCustomOption('grouped_options', $serializedValue);
}

$products[] = $_result[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public function processOptions(CartItemInterface $cartItem): CartItemInterface
return $cartItem;
}

$superGroup = $cartItem->getOptionByCode(self::SUPER_GROUP_CODE);
$superGroupValues = $superGroup ? $this->jsonSerializer->unserialize($superGroup->getValue()) : null;
if ($superGroupValues) {
$groupedOptions = $cartItem->getOptionByCode('grouped_options');
$groupedOptionsData = $groupedOptions ? $this->jsonSerializer->unserialize($groupedOptions->getValue()) : null;
if ($groupedOptionsData) {
$productOptions = [];
foreach ($superGroupValues as $id => $qty) {
foreach ($groupedOptionsData as $id => $qty) {
$productOptions[] = $this->groupedOptionFactory->create(['id' => $id, 'qty' => $qty]);
}

Expand Down

0 comments on commit c936161

Please sign in to comment.