Log in
Model

CustomOption

Magento\Catalog\Model\CustomOptions\CustomOption

What it does

This class represents a custom option value for a product in Magento 2, typically used when adding products to cart or orders.

Developers use this to store and retrieve custom option selections (like text, dropdown values, or file uploads) that customers make when purchasing configurable products.

It handles special processing for file-type options through the FileProcessor to manage uploaded file data.

Public Methods

  • getOptionId()
  • setOptionId()
  • getOptionValue()
  • setOptionValue()
  • getExtensionAttributes()
  • setExtensionAttributes()