Created
May 28, 2015 21:40
-
-
Save indrisepos/8e9f4db8b819000700e0 to your computer and use it in GitHub Desktop.
Remove Magento attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| error_reporting(E_ALL | E_STRICT); | |
| require_once './app/Mage.php'; | |
| umask(0); | |
| Mage::app(); | |
| $attr = 'product_type'; //attribute code to remove | |
| $setup = Mage::getResourceModel('catalog/setup', 'core_setup'); | |
| try { | |
| $setup->startSetup(); | |
| $setup->removeAttribute('catalog_product', $attr); | |
| $setup->endSetup(); | |
| echo $attr . " attribute is removed"; | |
| } catch (Mage_Core_Exception $e) { | |
| print_r($e->getMessage()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment