Skip to main content
deleted 7 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

I have the product name with html tags so written simple script to updated the product name below code i have used for update.

Mage::app();
$product_collection = Mage::getModel("catalog/product")->getCollection();
$product_collection->addAttributeToSelect('*');

foreach ($product_collection as $product) {
   $sku = $product->getSku();
   
   $simple_product = '';
   $simple_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
   if($simple_product != ''){

      $name = $simple_product->getName();
      if($name != strip_tags($name)) {
          $simple_product->setName(strip_tags($name));
          $simple_product->save();
      }      
   }
}

after that i did the reindex by shall command and cleared the cache.

Now my product names are clear without html tag in frond end like (product list , product view ,search ) all pages looks good. But when i go to admin panel

catalog->Manage Products

I have a product name with html tag so i am bit confusing here so please kindly clarify what's going on here. Also let me know wh

Thanks,

I have the product name with html tags so written simple script to updated the product name below code i have used for update.

Mage::app();
$product_collection = Mage::getModel("catalog/product")->getCollection();
$product_collection->addAttributeToSelect('*');

foreach ($product_collection as $product) {
   $sku = $product->getSku();
   
   $simple_product = '';
   $simple_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
   if($simple_product != ''){

      $name = $simple_product->getName();
      if($name != strip_tags($name)) {
          $simple_product->setName(strip_tags($name));
          $simple_product->save();
      }      
   }
}

after that i did the reindex by shall command and cleared the cache.

Now my product names are clear without html tag in frond end like (product list , product view ,search ) all pages looks good. But when i go to admin panel

catalog->Manage Products

I have a product name with html tag so i am bit confusing here so please kindly clarify what's going on here. Also let me know wh

Thanks,

I have the product name with html tags so written simple script to updated the product name below code i have used for update.

Mage::app();
$product_collection = Mage::getModel("catalog/product")->getCollection();
$product_collection->addAttributeToSelect('*');

foreach ($product_collection as $product) {
   $sku = $product->getSku();
   
   $simple_product = '';
   $simple_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
   if($simple_product != ''){

      $name = $simple_product->getName();
      if($name != strip_tags($name)) {
          $simple_product->setName(strip_tags($name));
          $simple_product->save();
      }      
   }
}

after that i did the reindex by shall command and cleared the cache.

Now my product names are clear without html tag in frond end like (product list , product view ,search ) all pages looks good. But when i go to admin panel

catalog->Manage Products

I have a product name with html tag so i am bit confusing here so please kindly clarify what's going on here. Also let me know wh

Source Link
Srihari
  • 422
  • 4
  • 12

Product names looks different from frondend and backend

I have the product name with html tags so written simple script to updated the product name below code i have used for update.

Mage::app();
$product_collection = Mage::getModel("catalog/product")->getCollection();
$product_collection->addAttributeToSelect('*');

foreach ($product_collection as $product) {
   $sku = $product->getSku();
   
   $simple_product = '';
   $simple_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
   if($simple_product != ''){

      $name = $simple_product->getName();
      if($name != strip_tags($name)) {
          $simple_product->setName(strip_tags($name));
          $simple_product->save();
      }      
   }
}

after that i did the reindex by shall command and cleared the cache.

Now my product names are clear without html tag in frond end like (product list , product view ,search ) all pages looks good. But when i go to admin panel

catalog->Manage Products

I have a product name with html tag so i am bit confusing here so please kindly clarify what's going on here. Also let me know wh

Thanks,