7 require
__DIR__ .
'/../../../Magento/Catalog/_files/multiple_products.php';
31 ->setAttributeSetId(4)
33 ->setName(
'Bundle Product')
34 ->setSku(
'bundle-product')
35 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
36 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
37 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
42 ->setBundleOptionsData(
46 'title' =>
'Option 1',
47 'default_title' =>
'Option 1',
55 'title' =>
'Option 2',
56 'default_title' =>
'Option 2',
64 'title' =>
'Option 3',
65 'default_title' =>
'Option 3',
73 'title' =>
'Option 4',
74 'default_title' =>
'Option 4',
82 'title' =>
'Option 5',
83 'default_title' =>
'Option 5',
90 )->setBundleSelectionsData(
96 'selection_can_change_qty' => 1,
102 'selection_qty' => 1,
103 'selection_can_change_qty' => 1,
111 'selection_qty' => 1,
112 'selection_can_change_qty' => 1,
118 'selection_qty' => 1,
119 'selection_can_change_qty' => 1,
127 'selection_qty' => 1,
133 'selection_qty' => 1,
141 'selection_qty' => 1,
147 'selection_qty' => 1,
155 'selection_qty' => 1,
161 'selection_qty' => 1,
170 if (
$product->getBundleOptionsData()) {
180 $bundleLinks =
$product->getBundleSelectionsData();
181 if (!empty($bundleLinks[$key])) {
182 foreach ($bundleLinks[$key] as
$linkData) {
187 $link->setSku($linkProduct->getSku());
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static getObjectManager()