6 declare(strict_types=1);
13 require
__DIR__ .
'/../../../Magento/Catalog/_files/simple_products_not_visible_individually.php';
25 ->setAttributeSetId(4)
28 ->setName(
'Bundle Product')
29 ->setSku(
'bundle-product-1')
30 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
31 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
32 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
39 ->setBundleOptionsData(
42 'title' =>
'Bundle Product Items',
43 'default_title' =>
'Bundle Product Items',
44 'type' =>
'select',
'required' => 1,
49 ->setBundleSelectionsData(
54 'selection_price_value' => 2.75,
56 'selection_can_change_qty' => 1,
64 if (
$product->getBundleOptionsData()) {
74 $bundleLinks =
$product->getBundleSelectionsData();
75 if (!empty($bundleLinks[$key])) {
76 foreach ($bundleLinks[$key] as
$linkData) {
82 $link->setSku($linkProduct->getSku());
85 if (isset(
$linkData[
'selection_can_change_qty'])) {
86 $link->setCanChangeQuantity(
$linkData[
'selection_can_change_qty']);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static getObjectManager()