7 require
__DIR__ .
'/multiple_products.php';
17 ->setAttributeSetId(4)
19 ->setName(
'Bundle Product')
20 ->setSku(
'bundle-product')
21 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
22 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
23 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
28 ->setBundleOptionsData(
32 'title' =>
'Option 1',
33 'default_title' =>
'Option 1',
40 'title' =>
'Option 2',
41 'default_title' =>
'Option 2',
48 'title' =>
'Option 3',
49 'default_title' =>
'Option 3',
56 'title' =>
'Option 4',
57 'default_title' =>
'Option 4',
64 'title' =>
'Option 5',
65 'default_title' =>
'Option 5',
71 )->setBundleSelectionsData(
76 'selection_qty' => 10,
77 'selection_can_change_qty' => 0,
83 'selection_qty' => 10,
84 'selection_can_change_qty' => 0,
90 'selection_qty' => 10,
91 'selection_can_change_qty' => 0,
99 'selection_qty' => 10,
100 'selection_can_change_qty' => 0,
106 'selection_qty' => 10,
107 'selection_can_change_qty' => 0,
113 'selection_qty' => 10,
114 'selection_can_change_qty' => 0,
122 'selection_qty' => 10,
128 'selection_qty' => 10,
134 'selection_qty' => 10,
135 'selection_can_change_qty' => 0,
143 'selection_qty' => 10,
149 'selection_qty' => 10,
155 'selection_qty' => 10,
156 'selection_can_change_qty' => 0,
164 'selection_qty' => 10,
170 'selection_qty' => 10,
178 if (
$product->getBundleOptionsData()) {
188 $bundleLinks =
$product->getBundleSelectionsData();
189 if (!empty($bundleLinks[$key])) {
190 foreach ($bundleLinks[$key] as
$linkData) {
195 $link->setSku($linkProduct->getSku());
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static getObjectManager()