12 require
__DIR__ .
'/../../../Magento/Catalog/_files/products.php';
24 ->setAttributeSetId(4)
27 ->setName(
'Bundle Product')
28 ->setSku(
'bundle-product')
29 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
30 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
31 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
38 ->setBundleOptionsData(
41 'title' =>
'Bundle Product Items',
42 'default_title' =>
'Bundle Product Items',
43 'type' =>
'select',
'required' => 1,
48 ->setBundleSelectionsData(
53 'selection_price_value' => 2.75,
55 'selection_can_change_qty' => 1,
63 if (
$product->getBundleOptionsData()) {
73 $bundleLinks =
$product->getBundleSelectionsData();
74 if (!empty($bundleLinks[$key])) {
75 foreach ($bundleLinks[$key] as
$linkData) {
81 $link->setSku($linkProduct->getSku());
84 if (isset(
$linkData[
'selection_can_change_qty'])) {
85 $link->setCanChangeQuantity(
$linkData[
'selection_can_change_qty']);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static getObjectManager()