Skip to content

Commit 63756ee

Browse files
author
Klymenko, Volodymyr(vklymenko)
committed
Merge pull request magento#24 from magento-nord/develop
[NORD] Bug fixes
2 parents 7f196de + dcac1f6 commit 63756ee

File tree

26 files changed

+37
-0
lines changed

26 files changed

+37
-0
lines changed

app/code/Magento/GroupedProductSampleData/Model/Product.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\GroupedProductSampleData\Model;
77

88
use Magento\Framework\Setup\SampleData\Context as SampleDataContext;
9+
use Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks;
10+
use Magento\Framework\App\ObjectManager;
911

1012
/**
1113
* Setup grouped product
@@ -17,6 +19,11 @@ class Product extends \Magento\CatalogSampleData\Model\Product
1719
*/
1820
protected $productType = \Magento\GroupedProduct\Model\Product\Type\Grouped::TYPE_CODE;
1921

22+
/**
23+
* @var \Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks
24+
*/
25+
private $productLinksHelper;
26+
2027
/**
2128
* Product constructor.
2229
* @param SampleDataContext $sampleDataContext
@@ -48,4 +55,34 @@ public function __construct(
4855
$eavConfig
4956
);
5057
}
58+
59+
/**
60+
* @param \Magento\Catalog\Model\Product $product
61+
* @param array $data
62+
* @return $this
63+
*/
64+
protected function prepareProduct($product, $data)
65+
{
66+
$this->getProductLinksHelper()->initializeLinks($product, $data['grouped_link_data']);
67+
$product->unsetData('grouped_link_data');
68+
return $this;
69+
}
70+
71+
/**
72+
* Get product links helper
73+
*
74+
* @deprecated
75+
* @return \Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks
76+
*/
77+
private function getProductLinksHelper()
78+
{
79+
80+
if (!($this->productLinksHelper)) {
81+
return ObjectManager::getInstance()->get(
82+
'\Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks'
83+
);
84+
} else {
85+
return $this->productLinksHelper;
86+
}
87+
}
5188
}

pub/media/wysiwyg/1.png

-371 KB
Binary file not shown.

pub/media/wysiwyg/10.png

-135 KB
Binary file not shown.

pub/media/wysiwyg/11.png

-103 KB
Binary file not shown.

pub/media/wysiwyg/12.png

-125 KB
Binary file not shown.

pub/media/wysiwyg/13.png

-105 KB
Binary file not shown.

pub/media/wysiwyg/14.png

-113 KB
Binary file not shown.

pub/media/wysiwyg/15.png

-138 KB
Binary file not shown.

pub/media/wysiwyg/16.png

-99.7 KB
Binary file not shown.

pub/media/wysiwyg/17.png

-325 KB
Binary file not shown.

0 commit comments

Comments
 (0)