I have created 1 custom attribute (current_user_id) and saving value when product is saved.
I have usecatalog_product_save_before event that save value for my custom attribute(current_user_id). code is
public function execute(\Magento\Framework\Event\Observer $observer)
{
$_product = $observer->getProduct(); // you will get product object
$current_users=$this->authSession->getUser();
$current_admin_id=$current_users->getData('user_id');
$_product->setCurrentUserId($current_admin_id) ;
}
It work perfect for add single product.
But now I want to add bulk products How this possible for import bulk product ?
I think we make custom attribute column in csv file and use which event that fire when import after check data. and foreach for setting value in custom attribute ?
Please Guide me I want to save custom attribute value in bulk products
Thanks