Hi all. How can I get the value of an eav attribute of a product programmatically?
I added attribute programmatically in this way:
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'rewrite_url_with_parent',
[
'group' => 'Search Engine Optimization',
'type' => 'int',
'label' => 'rewrite_url_with_parent',
'input' => 'select',
'source' => 'ModuleVendor\ModuleName\Model\Product\Attribute\Source\Product',
'required' => false,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_in_advanced_search' => true,
'apply_to' => Type::TYPE_VIRTUAL,
'is_used_in_grid' => true,
'is_visible_in_grid' => false,
'is_filterable_in_grid' => true,
]
);
$setup->endSetup();