6 declare(strict_types=1);
27 $installer = Bootstrap::getObjectManager()->create(CategorySetup::class);
30 $website = Bootstrap::getObjectManager()->create(Website::class);
31 $website->load(
'us_website',
'code');
35 $eavConfig = Bootstrap::getObjectManager()->create(Config::class);
53 $product = Bootstrap::getObjectManager()->create(Product::class);
55 $product->setTypeId(Type::TYPE_SIMPLE)
59 ->setName(
'Configurable Option' .
$option->getLabel())
62 ->setTestConfigurable(
$option->getValue())
63 ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE)
64 ->setStatus(Status::STATUS_ENABLED)
65 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1]);
70 $stockItem = Bootstrap::getObjectManager()->create(\
Magento\CatalogInventory\Model\Stock\Item::class);
85 'value_index' =>
$option->getValue(),
91 $product = Bootstrap::getObjectManager()->create(Product::class);
94 $optionsFactory = Bootstrap::getObjectManager()->create(Factory::class);
116 $registry = Bootstrap::getObjectManager()->get(\
Magento\Framework\Registry::class);
118 $registry->register(
'isSecureArea',
true);
127 'product_id = ' . $productToDelete->getId()
133 $registry->register(
'isSecureArea',
false);
135 $product->setTypeId(Configurable::TYPE_CODE)
136 ->setId($configurableId)
139 ->setName(
'Configurable Product ' . $configurableId)
140 ->setSku(
'configurable_' . $configurableId)
141 ->setVisibility(Visibility::VISIBILITY_BOTH)
142 ->setStatus(Status::STATUS_ENABLED)
143 ->setStockData([
'use_config_manage_stock' => 1,
'is_in_stock' => 1]);
149 ->create(\
Magento\Catalog\Api\CategoryLinkManagementInterface::class);
$configurableAttributesData
$extensionConfigurableAttributes
static getObjectManager()