17 use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryExtensionFactory;
21 require
__DIR__ .
'/configurable_attribute.php';
25 ->create(ProductRepositoryInterface::class);
28 $installer = Bootstrap::getObjectManager()->create(CategorySetup::class);
42 $product = Bootstrap::getObjectManager()->create(Product::class);
44 $product->setTypeId(Type::TYPE_SIMPLE)
48 ->setName(
'Configurable Option' .
$option->getLabel())
51 ->setTestConfigurable(
$option->getValue())
52 ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE)
53 ->setStatus(Status::STATUS_ENABLED)
54 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1]);
59 $product->setCustomAttribute($eavCategoryAttributeCode, $eavCategoryAttributeValues);
74 \
Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterfaceFactory::class
88 $video->setDisabled(
false);
90 $video->setLabel(
'Video Label');
91 $video->setMediaType(
'external-video');
99 \
Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryExtensionFactory::class
107 \
Magento\Framework\Api\Data\VideoContentInterfaceFactory::class
115 $videoContent->setVideoUrl(
'http://www.youtube.com/v/tH_2PFNmWoga');
124 \
Magento\Catalog\Api\ProductAttributeMediaGalleryManagementInterface::class
129 $stockItem = Bootstrap::getObjectManager()->create(\
Magento\CatalogInventory\Model\Stock\Item::class);
144 'value_index' =>
$option->getValue(),
150 $product = Bootstrap::getObjectManager()->create(Product::class);
177 $registry->register(
'isSecureArea',
true);
186 'product_id = ' . $productToDelete->getId()
192 $registry->register(
'isSecureArea',
false);
194 $product->setTypeId(Configurable::TYPE_CODE)
198 ->setName(
'Configurable Product')
199 ->setSku(
'configurable')
200 ->setVisibility(Visibility::VISIBILITY_BOTH)
202 ->setStatus(Status::STATUS_ENABLED)
203 ->setStockData([
'use_config_manage_stock' => 1,
'is_in_stock' => 1]);
209 ->create(\
Magento\Catalog\Api\CategoryLinkManagementInterface::class);
$configurableAttributesData
defined('TESTS_BP')||define('TESTS_BP' __DIR__
$extensionConfigurableAttributes
static getObjectManager()