Skip to content

Commit

Permalink
#12705: Integrity constraint violation error after reordering product…
Browse files Browse the repository at this point in the history
… with custom options

- Fixed issue by updating options if parent item is same for more than one product
- Fixed issue for reorder in admin while checking the availability of product, which is not available in case of associate product.
  • Loading branch information
vinayshah committed Jan 7, 2018
1 parent 816ec39 commit 843bc62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
public function isAvailable(Item $item)
{
$buyRequest = $item->getBuyRequest();
$superAttribute = $buyRequest->getData()['super_attribute'];
$superAttribute = isset($buyRequest->getData()['super_attribute']) ? $buyRequest->getData()['super_attribute'] : [];
$connection = $this->getConnection();
$select = $connection->select();
$orderItemParentId = $item->getParentItem()->getProductId();
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Quote/Model/Quote/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,9 @@ public function saveItemOptions()
unset($this->_options[$index]);
unset($this->_optionsByCode[$option->getCode()]);
} else {
if (!$option->getItem() || !$option->getItem()->getId()) {
$option->setItem($this);
}
$option->save();
}
}
Expand Down

0 comments on commit 843bc62

Please sign in to comment.