1

How to programmatically changes the product from default store view into all store view.

Thanks.

  • Do you mean you need to assign same product to other store programetically? – Dhiren Vasoya May 2 at 10:32
  • Yes ............ – Mano M May 2 at 11:00
  • I post answer kindly check. – Dhiren Vasoya May 2 at 11:46
0

you can use this code.

/** @var  \Magento\Catalog\Model\ProductFactory */
 protected $productFactory;

 $storeId = 2;
 $product = $this->productFactory->create()->load('YOURPRODUCTID');
 $productStoreView->setStoreId($storeId);
 $productStoreView->save();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.