Yesterday I run into an issue while creating configurable products with our custom import task. It seems that Magento requires configurable attributes to be user_defined
. So, what happens with attributes created programmatically defined as system attributes to avoid the admin users to edit them?
Is this just a bug or there is a reason behind it?
class Magento\ConfigurableProduct\Model\Product\Type\Configurable
/**
* Check attribute availability for super product creation
*
* @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute
* @return bool
*/
public function canUseAttribute(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
return $attribute->getIsGlobal() == \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL &&
$attribute->getIsVisible() &&
$attribute->usesSource() &&
$attribute->getIsUserDefined();
}
&& $attribute->getIsUserDefined()
in there, but I don't have the reason. Good question. – Marius♦ Oct 5 '16 at 8:12