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

Go to the source code of this file.

Variables

 $productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class)
 
 $installer = Bootstrap::getObjectManager()->create(CategorySetup::class)
 
 $options = $attribute->getOptions()
 
 $attributeValues = []
 
 $attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default')
 
 $option = reset($options)
 
 $childProduct = Bootstrap::getObjectManager()->create(Product::class)
 
 $attributeValues []
 
 $configurableProduct = Bootstrap::getObjectManager()->create(Product::class)
 
 $optionsFactory = Bootstrap::getObjectManager()->create(Factory::class)
 
 $configurableAttributesData
 
 $configurableOptions = $optionsFactory->create($configurableAttributesData)
 
 $extensionConfigurableAttributes = $configurableProduct->getExtensionAttributes()
 

Variable Documentation

◆ $attributeSetId

$attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default')

Definition at line 35 of file product_configurable_with_single_child.php.

◆ $attributeValues [1/2]

$attributeValues = []

Definition at line 34 of file product_configurable_with_single_child.php.

◆ $attributeValues [2/2]

$attributeValues[]
Initial value:
= [
'label' => 'test',
'attribute_id' => $attribute->getId(),
'value_index' => $option->getValue(),
]

Definition at line 60 of file product_configurable_with_single_child.php.

◆ $childProduct

$childProduct = Bootstrap::getObjectManager()->create(Product::class)

Definition at line 41 of file product_configurable_with_single_child.php.

◆ $configurableAttributesData

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

Definition at line 72 of file product_configurable_with_single_child.php.

◆ $configurableOptions

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

Definition at line 82 of file product_configurable_with_single_child.php.

◆ $configurableProduct

$configurableProduct = Bootstrap::getObjectManager()->create(Product::class)

Definition at line 67 of file product_configurable_with_single_child.php.

◆ $extensionConfigurableAttributes

$extensionConfigurableAttributes = $configurableProduct->getExtensionAttributes()

Definition at line 84 of file product_configurable_with_single_child.php.

◆ $installer

$installer = Bootstrap::getObjectManager()->create(CategorySetup::class)

Definition at line 28 of file product_configurable_with_single_child.php.

◆ $option

$option = reset($options)

Definition at line 38 of file product_configurable_with_single_child.php.

◆ $options

$options = $attribute->getOptions()

Definition at line 32 of file product_configurable_with_single_child.php.

◆ $optionsFactory

$optionsFactory = Bootstrap::getObjectManager()->create(Factory::class)

Definition at line 70 of file product_configurable_with_single_child.php.

◆ $productRepository

$productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class)

Definition at line 25 of file product_configurable_with_single_child.php.