forked from magepow/magento-2-programmatically
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremoveAttributeCategory.php
More file actions
24 lines (19 loc) · 873 Bytes
/
removeAttributeCategory.php
File metadata and controls
24 lines (19 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require dirname(__FILE__) . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
class Outslide extends \Magento\Framework\App\Http
implements \Magento\Framework\AppInterface {
public function launch()
{
$setup = $this->_objectManager->create('\Magento\Framework\Setup\ModuleDataSetupInterface');
$categorySetupFactory = $this->_objectManager->create('\Magento\Catalog\Setup\CategorySetupFactory');
$categorySetup = $categorySetupFactory->create(['setup' => $setup]);
$categorySetup->removeAttribute( \Magento\Catalog\Model\Category::ENTITY, 'extrafee');
echo 'Done!';
//the method must end with this line
return $this->_response;
}
}
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Outslide');
$bootstrap->run($app);