I have a custom product attribute named
additional_cost. Now I want to delete this
additional_cost attribute or I want to update it. In order to do this both I need to first check if this attribute already exist.
I want to check the attribute in
UpgradeData.php script. So how can I solve this problem
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $eavSetup->removeAttribute( \Magento\Catalog\Model\Product::ENTITY, 'additional_cost' );
The removing code is ready. What will be the if statement?