0

we are trishlaemart.com we do have some products for example

existing product JulietBra = price is 10o$ associate products is 120$

need to change price now for all product as 120$ in single shot how to do it ? any easy way is there or i need to do each and every product. manually

same wise one product is 10$ i need to change all price to 20$ includes associate products.

2
  • You can import the product CSV to update the product price. Commented Feb 26, 2018 at 11:54
  • As @DineshYadav suggested you can use default Magento's import option. Please let us know if you need any help in doing that. Commented Feb 26, 2018 at 14:41

2 Answers 2

1

Export the csv and use magmi tool to update price in bulk. Below should be the format of csv:

store, sku, price

abc, 1001, 5.00

bab, 1001, 7.00

then run re-indexing.

0

You run below script into magento root directory

Note:Firstly take backup of DB then execute this query

For All products

$storeId=Mage::app()->getStore()->getStoreId(); // Your store id

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

// For all products
$products = Mage::getModel('catalog/product')->getCollection();
$products->addStoreFilter();
$products->addAttributeToSelect('*');

foreach($products as $product)
{
    $price=$product->setPrice(120);
    Mage::app()->setCurrentStore($storeId);
    $product->save(); 
}
?>

For specific products:

<?php
require_once 'app/Mage.php';
Mage::app('default');

$storeId=Mage::app()->getStore()->getStoreId(); // Your store id

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$productIds = array(1,2,3,4,5); // pass products id

$products = Mage::getModel('catalog/product')->getCollection();
$products->addStoreFilter();
$products->addAttributeToSelect('*');
$products->addAttributeToFilter('entity_id', array('in' => $productIds));
foreach($products as $product)
{
    $price=$product->setPrice(120);
    Mage::app()->setCurrentStore($storeId);
    $product->save(); 
}
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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