I am running Magento version 18.104.22.168 with PHP 5.6.40 for my store and it has around 5000 products. So I need to increase the product price by Rs.1000 for all products. I just added below custom code in updateprice.php file in my Root and executed it by mysite.com/updateprice.php but unfortunately its not working.
Here is my code :
<?php require_once('../app/Mage.php'); Mage::app('default'); $priceToAdd = 1000; $write = Mage::getSingleton('core/resource')->getConnection('core_write'); $write->query(" UPDATE catalog_product_entity_decimal val SET val.value = (val.value + $priceToAdd) WHERE val.attribute_id = ( SELECT attribute_id FROM eav_attribute eav WHERE eav.entity_type_id = 4 AND eav.attribute_code = 'price' ) ");
Can anyone know how to fix this?
Note : Then Price change should applicable for both Price & Special price. For example If the products have both price & special price then the price 1000 should increased to both. If the products only have the price then it should updated that price alone.