0

We did have a big problem with magento product description update/save for a while now. Was looking around for some solution with no success. Today i noticed that the problem was in the table “catalog_product_entity_text”. I did try to delete some rows that looked wierd with no luck there, and i have tried to remove all rows in that table with no success there.

I came up with a solution to solve the description issue, but i comes with another problem.

I truncated the whole “catalog_product_entity_text” table and woops it works to update/create the description for all my products again. But the new issue is that i have about 2000 products with description on almost all, and when i truncate the table all is gone. Does anyone have a great solution for this? I dont want to create all 2000 descriptions by hand.

2 Answers2

0

Do you have any unique key of product to update it through query like (sku,id), if you have sku and description in excel sheet than bellow code will work

require_once 'app/Mage.php';
Mage::app('admin');
require_once 'lib/php-excel-reader/excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("content.xls");

for($i = 2,$j=1; $i <= $data->sheets[0]['numRows']; $i++,$j++) {
if(!empty($data->sheets[0]['cells'][$i][2]))
{

    $product = Mage::getModel('catalog/product')->loadByAttribute('sku',        trim($data->sheets[0]['cells'][$i][2]));
    if($product){
        $product->setDescription($data->sheets[0]['cells'][$i][3]);
        $product->save();
    }

}

}
Dasarathi Swain
  • 861
  • 1
  • 7
  • 16
  • @Mattias Pedersen clear me one thing on which basic are you going to update product description, suppose you have 2000 product's description in a excel sheet (ya in a doc file), to update this you need another unique key like (entity_id or sku ) do you have this unique key to update description according to the unique key – Dasarathi Swain Aug 28 '13 at 07:40
0

The table looks like this;

value_id | entity_type_id | attribute_id | store_id | entity_id | value

1 | 10 | 506 | 0 | 9712 | test

2 | 10 | 97 | 0 | 9712 | test

The attribute_id 506 and 97 are for the long description and short description. entity_id is the product id. Don't have any sku in this table.