• Best Magento

    Marketplace Extension

  • Most Reliable

    & Dedicated Support

  • Most Reasonable

    & Flexible Price

Update approval attribute of product to approved in bulk

If your website have much number of products you can not update for all of your products using Update Attribute function of magento.
This article will explain for you how to update the approval attribute of product to approved in bulk from ssh.

First create this file: PATH_TO_MAGENTO_ROOT_FOLDER/shell/process_products.php

  1. <?php
  2. require_once '../app/Mage.php';
  3. Mage::app();
  4. $products = Mage::getModel('catalog/product')->getCollection();;
  5. $count = 1;
  6. $size = count($products);
  7. foreach($products as $product){
  8. echo "$count/$size - Product ".$product->getSku()." is Updating ...\n";
  9. $product->setData('approval', 2)->getResource()->saveAttribute($product, 'approval');
  10. $count++;
  11. }

Now access to SSH and run this command: php PATH_TO_MAGENTO_ROOT_FOLDER/shell/process_products.php

After the script is run you will see the process.

Update approval attribute of product to approved in bulk