43 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
| 
 | |
| <?php
 | |
| require_once '../app/bootstrap.php';
 | |
| 
 | |
| use Magento\Framework\App\Bootstrap;
 | |
| 
 | |
| //require 'app/bootstrap.php';
 | |
| $bootstrap = Bootstrap::create(BP, $_SERVER);
 | |
| $objectManager = $bootstrap->getObjectManager();
 | |
| $state = $objectManager->get('\Magento\Framework\App\State');
 | |
| $state->setAreaCode('frontend');
 | |
| 
 | |
| 
 | |
| $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
 | |
| $storeId = $storeManager->getStore()->getId();
 | |
| 
 | |
| $websiteId = $storeManager->getStore($storeId)->getWebsiteId();
 | |
| 
 | |
| $objectManager->get('Magento\Framework\Registry')->register('isSecureArea', true);
 | |
| 
 | |
| $_eavSetupFactory = $objectManager->create('\Magento\Eav\Setup\EavSetupFactory');
 | |
| $_attributeFactory = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Eav\Attribute');
 | |
| 
 | |
| 
 | |
| $attribute_arr = array("3Com", "ADTRAN/BlueSocket", "Aerohive", "Airoha", "aiScaler", "Alaxala Networks", "Alcatel-Lucent Enterprise", "Allied Telesis", "Alvarion", "ApplianSys", "Arcadyan", "Arista Networks", "Arris International", "Aruba Networks", "ASIX", "Askey Computer Corp", "Asus", "Atheros", "Avago", "Avaya", "AVM", "Barracuda Networks", "Belkin", "Billion Electric", "Broadcom", "Brocade", "Buffalo Technology", "Calix", "Cambium Networks", "Cavium", "Ceragon", "Chelsio", "Ciena", "Cisco", "CommScope", "Cortina Systems", "Cradlepoint", "Datto", "Dell", "Digi International", "D-Link", "DrayTek", "ECI Telecom", "Emulex", "EnGenius", "Enterasys", "Ericsson", "Exinda", "Expand", "Extreme Networks", "F5", "FiberHome", "Force10", "Fortinet", "Foundry Networks", "Geode", "H3C", "HiSilicon", "HPE", "Huawei", "Infoblox", "Intel", "JMicron", "Juniper", "Lanner Inc", "Lantiq", "Linksys", "Lotus Foundations", "Marvell", "Mediatek", "Mellanox", "Meraki", "Meru", "MikroTik", "Mitsubishi", "Motorola", "NEC", "Netgear", "Nokia", "Nortel", "NVIDIA", "Open Mesh", "Oracle Corporation", "ProCurve", "Proxim", "PSSC Labs", "QLogic", "Qualcomm", "RAD Data Communications", "Radware", "Ralink", "Realtek", "Redback", "Ribbon Communications", "Riverbed Technology", "Ruckus Networks", "Sagemcom", "Samsung", "Siae Microelettronica", "Sierra Wireless", "Silver Peak", "SnapAV", "StormSemi/StorLink", "Symantec", "Technicolor", "Telco Systems", "Teledata Networks", "Teltonika Networks", "TippingPoint", "TP-Link", "TrendChip", "TRENDnet", "Ubiquiti", "USRobotics", "Vyatta", "WatchGuard", "Xirrus", "Yamaha", "ZTE", "ZyXEL", "China 3rd", "Other");
 | |
| //$attribute_arr = ['Yellow','White','Black'];
 | |
| 
 | |
| $attributeInfo=$_attributeFactory->getCollection()
 | |
|                ->addFieldToFilter('attribute_code',['eq'=>"brands"])
 | |
|                ->getFirstItem();
 | |
| $attribute_id = $attributeInfo->getAttributeId();
 | |
| 
 | |
| $option=array();
 | |
| $option['attribute_id'] = $attributeInfo->getAttributeId();
 | |
| foreach($attribute_arr as $key=>$value){
 | |
|     $option['value'][$value][0]=$value;
 | |
|     $option['value'][$value][$storeId]=$value;
 | |
| 
 | |
| }
 | |
| 
 | |
| $eavSetup = $_eavSetupFactory->create();
 | |
| $eavSetup->addAttributeOption($option);
 |