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

Go to the source code of this file.

Variables

 $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class)
 
 $oldOptions
 
 $customOptions = []
 
 $customOptionFactory = $objectManager->create(\Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class)
 
 $optionId = $product->getOptions()[0]->getOptionId()
 
 $requestInfo = new \Magento\Framework\DataObject(['qty' => 1, 'options' => [$optionId => 'test']])
 

Variable Documentation

◆ $customOptionFactory

$customOptionFactory = $objectManager->create(\Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class)

Definition at line 38 of file product_with_custom_option.php.

◆ $customOptions

$customOptions = []

Definition at line 35 of file product_with_custom_option.php.

◆ $oldOptions

$oldOptions
Initial value:
= [
[
'id' => 1,
'option_id' => 0,
'previous_group' => 'text',
'title' => 'Test Field',
'type' => 'field',
'is_require' => 1,
'sort_order' => 0,
'price' => 1,
'price_type' => 'fixed',
'sku' => '1-text',
'max_characters' => 100,
],
]

Definition at line 19 of file product_with_custom_option.php.

◆ $optionId

$optionId = $product->getOptions()[0]->getOptionId()

Definition at line 53 of file product_with_custom_option.php.

◆ $product

$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class)

Definition at line 9 of file product_with_custom_option.php.

◆ $requestInfo

$requestInfo = new \Magento\Framework\DataObject(['qty' => 1, 'options' => [$optionId => 'test']])

Definition at line 55 of file product_with_custom_option.php.