Skip to content

Commit 843bc62

Browse files
committed
#12705: Integrity constraint violation error after reordering product 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.
1 parent 816ec39 commit 843bc62

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/ConfigurableProductSales/Model/Order/Reorder/OrderedProductAvailabilityChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
public function isAvailable(Item $item)
4646
{
4747
$buyRequest = $item->getBuyRequest();
48-
$superAttribute = $buyRequest->getData()['super_attribute'];
48+
$superAttribute = isset($buyRequest->getData()['super_attribute']) ? $buyRequest->getData()['super_attribute'] : [];
4949
$connection = $this->getConnection();
5050
$select = $connection->select();
5151
$orderItemParentId = $item->getParentItem()->getProductId();

app/code/Magento/Quote/Model/Quote/Item.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,9 @@ public function saveItemOptions()
745745
unset($this->_options[$index]);
746746
unset($this->_optionsByCode[$option->getCode()]);
747747
} else {
748+
if (!$option->getItem() || !$option->getItem()->getId()) {
749+
$option->setItem($this);
750+
}
748751
$option->save();
749752
}
750753
}

0 commit comments

Comments
 (0)