I have a dropdown product attribute in store view level that i need to update programmatically for specific store:
I tried to update the product attribute programmatically like this:
// \Magento\Catalog\Model\Product\Action $_productAction
$storeId = 3;
$productId = 35;
$this->productAction->updateAttributes(array(
$productId
) , array('test_id'=>30), $storeId);
The product attribute value is updated successfully.
The problem is when i checked the product attribute value to use default value like below:
it will be unchecked if I run those code, even though i set the product attribute value same as the default value
How can i avoid or prevent this and keep value checked, even if i update the value same as the default product attribute value ?