I am working on to create a simple product programmatically.
I have created 2 custom Attribute
- Select(select_testing)
- MultiSelect(multiselect_testing)
select_testing attribute value ==> 1, 2, ,3, 4. multiselect_testing attribute value --> 1, 2, 3, 4.
So, I try to add Product using following code.
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
$simple_product = $_objectManager->create('\Magento\Catalog\Model\Product');
$simple_product->setSku('test-sku');
$simple_product->setName('SimpleProduct');
$simple_product->setRkTesting('Rk Testing');
$simple_product->setSelectTesting('1');
$simple_product->setMultiselectTesting(array("1","2"));
$simple_product->setYesTesting(1);
$simple_product->save();
But, Select and Multiselect attribute value not save.
Suggest me, how to add Select and multiselect Attribute value.