Skip to main content

You should replace: the $item->save(); with below code

$item->getResource()->saveAttribute($item, 'visibility');:

$item->getResource()->saveAttribute($item, 'status');

$item->getResource()->saveAttribute($item, 'visibility');

$item->getResource()->saveAttribute($item, 'status');

You should replace: $item->save(); with below code

$item->getResource()->saveAttribute($item, 'visibility');

$item->getResource()->saveAttribute($item, 'status');

You should replace the $item->save(); with below code:

$item->getResource()->saveAttribute($item, 'visibility');

$item->getResource()->saveAttribute($item, 'status');
Source Link

You should replace: $item->save(); with below code

$item->getResource()->saveAttribute($item, 'visibility');

$item->getResource()->saveAttribute($item, 'status');