I need to update(increase/decrease)
the price & special price
by certain amount or percentage for all products in all stores.
Here is the my code but its not increase/decrease
the price. I have also refered few links but not match with the needs.
<?php
error_reporting(1);
ini_set('max_execution_time', 0);
use \Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$state = $objectManager->get('\Magento\Framework\App\State');
$state->setAreaCode('frontend');
$updateprice = "100";
$productFactory = $objectManager->get('\Magento\Catalog\Model\ProductFactory');
$product = $productFactory->create()->load();
$product->setPrice($updateprice);
$product->save();
?>
My version is Magento 2.2.4
Can anyone let me know how to increase/decrease
the price for all products?