In Magento 1

($optionType == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA):

But, in Magento 2, I have to pass responsible class object type in constructor.

How I change this in Magento 2?

1 Answer 1


You can call the constant variable directly:

($optionType == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_AREA)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.