Product price update globally in magento using direct sql query

Update product price globally
<?php

$priceToAdd = 10; // custom product price

$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'
    )
");

// where eav.entity_type_id=4 is default attribute id

 

Update all prices from a certain store

This technique is useful when working in a multi-store Magento environment.

<?php

$priceToAdd = 6;
$storeId = 4;

$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'
    )
    AND val.store_id = $storeId
");

 

Update all product prices with a certain attribute set
<?php

$customPriceToAdd = 10;
$attributeSetId = 4;

$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("
  UPDATE catalog_product_entity_decimal val
  SET  val.value = (val.value + $customPriceToAdd)
  WHERE  val.attribute_id = (
     SELECT attribute_id FROM eav_attribute eav
     WHERE eav.entity_type_id = 4 
       AND eav.attribute_code = 'price'
    )
AND entity_id = ( 
   SELECT p.entity_id FROM catalog_product_entity p
   WHERE p.attribute_set_id = $attributeSetId
)
");

 

Update the Special Price
<?php

$custompriceToAdd = 10;

$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("
  UPDATE catalog_product_entity_decimal val
  SET  val.value = (val.value + $custompriceToAdd)
  WHERE  val.attribute_id = (
     SELECT attribute_id FROM eav_attribute eav
     WHERE eav.entity_type_id = 4 
       AND eav.attribute_code = 'special_price'
    )
");

 

LESS in OpenCart with LessEngine

What is LESS?

LESS stands short for Leaner CSS. LESS lets you write CSS in a more cheap football kits dynamic and functional manner, using variables and functions. When you write in LESS the code has to be transformed into CSS by a compiler. LESS is dynamic stylesheet language. You can read more about the LESS project and how to write in LESS here – http://lesscss.org/

What is LessEngine for OpenCart?

It is powered by a PHP compiler for LESS, built into the module to make it easy for developers to write and compile code using their OpenCart installation. When writing your LESS files you only need to put them in a server directory of your choice and the module cheap football shirts will automatically compile the LESS code when you visit the website or when you compile on demand from the module settings. There is no need to compile files locally on your computer and then to upload the already compiled CSS to your server.

Why should I use it?
If you are an extension or theme developer for OpenCart and you cheap football tops write LESS, LessEngine is just the tool for you. It allows you to specify input and output directories for your LESS and CSS files, as well as cache directories and directories with imported files. By default, they point to your default OpenCart theme, however, if you are developing a new theme you can always change that. The module will cache LESS files based on their modified time, so no unnecessary compiles Cheap Barcelona football shirts are made. Also, you have the option to get error reporting, in case you have made a syntax error. If you employ a more complex LESS framework using imported files, these files will also be checked for modifications and the main file will be re-compiled, if changes are found. Neat options is also to minify the Cheap Manchester United football shirts output CSS and remove comments in the code.