Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $_description = $this->getProduct()->getDescription(); ?>
- <?php if ($_description): ?>
- <h2><?php echo $this->__('Details') ?></h2>
- <div class="std">
- <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description') ?>
- </div>
- <?php else: //adding short description?>
- <h2><?php echo $this->__('Short Details') ?></h2>
- <div class="std">
- <?php echo $_helper->productAttribute($this->getProduct(), $this->getProduct()->getShortDescription(), 'short_description') ?>
- </div>
- <?php endif; ?>
- $products = Mage::getModel('catalog/product')->getCollection();
- foreach($proudcts as $product){
- if(!$product->getDescription() && $product->getShortDescription()){
- $product->setDescription($product->getShortDescription())->save();
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__($product->getId(). "'s description is saved."));
- }
- }
- <?php
- require_once 'app/Mage.php';
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
- $productCollection = Mage::getModel('catalog/product')->getCollection()
- ->addAttributeToSelect('short_description')
- ->addAttributeToSelect('description')
- ->addAttributeToFilter('description', array('neq' => NULL));
- foreach ($productCollection as $product) {
- $product->setDescription($product->getShortDescription());
- $product->save();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement