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])
44 ->setBundleOptionsData(
48 'title' =>
'Option 1',
49 'default_title' =>
'Option 1',
56 )->setBundleSelectionsData(
62 'selection_price_value' => 2.75,
63 'selection_can_change_qty' => 1,
70 'selection_price_value' => 6.75,
71 'selection_can_change_qty' => 1,
81 if (
$product->getBundleOptionsData()) {
91 $bundleLinks =
$product->getBundleSelectionsData();
92 if (!empty($bundleLinks[$key])) {
93 foreach ($bundleLinks[$key] as
$linkData) {
98 $link->setSku($linkProduct->getSku());
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static getObjectManager()