I’m trying to update a product using productRepository ( migrating from a flow using product factory with load ).
Problem is tha when updating the name it is updating in store 1 ( default store ) but not in store 0 ( admin store view )
Bellow there is a sample code
$objectManager = MagentoFrameworkAppObjectManager::getInstance(); $productRepository = $objectManager->get('MagentoCatalogApiProductRepositoryInterface'); $product = $productRepository->getById('product id here', true, 0); $product->setName('ts'); $productRepository->save($product);
Newly created products have only one name in admin view , using the code above a new entry is added in
catalog_product_entity_varchar table for store view 1 leaving store view 0 unchanged.
The only way to update the title seems using $product->save(). Is there any other way without using $product->save() ?
Is seems very strange to me, i’m running this code from a console command and i’ve already set the state to
I’m running Magento 2.3.4