Skip to content
Snippets Groups Projects
Commit d8bd657c authored by nmalevanec's avatar nmalevanec
Browse files

magento/magento2#13126: 2.2.2 - Duplicating Bundle Product Removes Bundle...

magento/magento2#13126: 2.2.2 - Duplicating Bundle Product Removes Bundle Options From Original Product
parent b57eb03b
Branches
No related merge requests found
......@@ -32,7 +32,8 @@ class Bundle implements \Magento\Catalog\Model\Product\CopyConstructorInterface
* Set option and selection ids to 'null' in order to create new option(selection) for duplicated product,
* but not modifying existing one, which led to lost of option(selection) in original product.
*/
foreach ($duplicatedBundleOption->getProductLinks() as $productLink) {
$productLinks = $duplicatedBundleOption->getProductLinks() ?: [];
foreach ($productLinks as $productLink) {
$productLink->setSelectionId(null);
}
$duplicatedBundleOption->setOptionId(null);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment