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 you have read our privacy policy.

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