6 declare(strict_types=1);
17 $installer = Bootstrap::getObjectManager()->create(\
Magento\Catalog\Setup\CategorySetup::class);
22 $attribute = Bootstrap::getObjectManager()->create(
27 $attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class);
31 'attribute_code' =>
'test_configurable',
32 'entity_type_id' =>
$installer->getEntityTypeId(
'catalog_product'),
34 'is_user_defined' => 1,
35 'frontend_input' =>
'select',
39 'is_visible_in_advanced_search' => 0,
42 'is_filterable_in_search' => 1,
43 'is_used_for_promo_rules' => 0,
44 'is_html_allowed_on_front' => 1,
45 'is_visible_on_front' => 1,
46 'used_in_product_listing' => 1,
47 'used_for_sort_by' => 1,
48 'frontend_label' => [
'Test Configurable'],
49 'backend_type' =>
'int',
51 'value' => [
'option_0' => [
'Option 1'],
'option_1' => [
'Option 2']],
52 'order' => [
'option_0' => 1,
'option_1' => 2],
54 'default' => [
'option_0']
74 ->setAttributeSetId(4)
75 ->setName(
'Simple Product1')
77 ->setTaxClassId(
'none')
78 ->setDescription(
'description')
79 ->setShortDescription(
'short description')
80 ->setOptionsContainer(
'container1')
81 ->setMsrpDisplayActualPriceType(\
Magento\Msrp\Model\Product\Attribute\Source\Type::TYPE_IN_CART)
84 ->setMetaTitle(
'meta title')
85 ->setMetaKeyword(
'meta keyword')
86 ->setMetaDescription(
'meta description')
87 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
88 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
91 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
92 ->setSpecialPrice(
'5.99')
99 ->setAttributeSetId(4)
100 ->setName(
'Simple Product2')
102 ->setTaxClassId(
'none')
103 ->setDescription(
'description')
104 ->setShortDescription(
'short description')
105 ->setOptionsContainer(
'container1')
106 ->setMsrpDisplayActualPriceType(\
Magento\Msrp\Model\Product\Attribute\Source\Type::TYPE_ON_GESTURE)
109 ->setMetaTitle(
'meta title')
110 ->setMetaKeyword(
'meta keyword')
111 ->setMetaDescription(
'meta description')
112 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
113 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
116 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 50,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
117 ->setSpecialPrice(
'15.99')
124 ->setAttributeSetId(4)
125 ->setName(
'Simple Product3')
127 ->setTaxClassId(
'none')
128 ->setDescription(
'description')
129 ->setShortDescription(
'short description')
132 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
133 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED)
136 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 140,
'is_qty_decimal' => 0,
'is_in_stock' => 1])
137 ->setSpecialPrice(
'25.99')
145 '2014-06-23 09:50:07' 154 )->setAvailableSortBy(
162 )->setPostedProducts(
163 [10 => 10, 11 => 11, 12 => 12]
static getObjectManager()