Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Variables
product_configurable_custom.php File Reference

Go to the source code of this file.

Variables

 $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
 
 $installer = $objectManager->create(\Magento\Catalog\Setup\CategorySetup::class)
 
 $eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class)
 
 $attribute = $eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'test_configurable_with_sm')
 
 $options = $attribute->getOptions()
 
 $productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class)
 
 $attributeValues = []
 
 $associatedProductIds = []
 
 $attributeSetId = $installer->getAttributeSetId(\Magento\Catalog\Model\Product::ENTITY, 'Default')
 
foreach($options as $key=> $option) $optionsFactory = $objectManager->create(\Magento\ConfigurableProduct\Helper\Product\Options\Factory::class)
 
 $configurableAttributesData
 
 $configurableOptions = $optionsFactory->create($configurableAttributesData)
 
 $product = $objectManager->create(\Magento\Catalog\Model\Product::class)
 
 $extensionConfigurableAttributes = $product->getExtensionAttributes()
 
 $categoryLinkManagement = $objectManager->create(\Magento\Catalog\Api\CategoryLinkManagementInterface::class)
 

Variable Documentation

◆ $associatedProductIds

$associatedProductIds = []

Definition at line 20 of file product_configurable_custom.php.

◆ $attribute

$attribute = $eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'test_configurable_with_sm')

Definition at line 15 of file product_configurable_custom.php.

◆ $attributeSetId

$attributeSetId = $installer->getAttributeSetId(\Magento\Catalog\Model\Product::ENTITY, 'Default')

Definition at line 21 of file product_configurable_custom.php.

◆ $attributeValues

$attributeValues = []

Definition at line 19 of file product_configurable_custom.php.

◆ $categoryLinkManagement

$categoryLinkManagement = $objectManager->create(\Magento\Catalog\Api\CategoryLinkManagementInterface::class)

Definition at line 88 of file product_configurable_custom.php.

◆ $configurableAttributesData

$configurableAttributesData
Initial value:
= [
[
'attribute_id' => $attribute->getId(),
'code' => $attribute->getAttributeCode(),
'label' => $attribute->getStoreLabel(),
'position' => '0',
'values' => $attributeValues,
],
]

Definition at line 60 of file product_configurable_custom.php.

◆ $configurableOptions

$configurableOptions = $optionsFactory->create($configurableAttributesData)

Definition at line 69 of file product_configurable_custom.php.

◆ $eavConfig

$eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class)

Definition at line 14 of file product_configurable_custom.php.

◆ $extensionConfigurableAttributes

$extensionConfigurableAttributes = $product->getExtensionAttributes()

Definition at line 72 of file product_configurable_custom.php.

◆ $installer

$installer = $objectManager->create(\Magento\Catalog\Setup\CategorySetup::class)

Definition at line 12 of file product_configurable_custom.php.

◆ $objectManager

Definition at line 10 of file product_configurable_custom.php.

◆ $options

$options = $attribute->getOptions()

Definition at line 16 of file product_configurable_custom.php.

◆ $optionsFactory

foreach ( $options as $key=> $option) $optionsFactory = $objectManager->create(\Magento\ConfigurableProduct\Helper\Product\Options\Factory::class)

Definition at line 59 of file product_configurable_custom.php.

◆ $product

$product = $objectManager->create(\Magento\Catalog\Model\Product::class)

Definition at line 71 of file product_configurable_custom.php.

◆ $productRepository

$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class)

Definition at line 18 of file product_configurable_custom.php.