Magento 1.9 – How to Set Default Value for Short Description

magento-1.9product-attributeproduct-edit

Currently my store has around 20000+ products. And each product's short description section contains product title at this moment.

I want to replace every product's short description section with following image instead of product title.

enter image description here

How to bulk replace above image code to magento product Short description section?

Best Answer

You could try setting a default value for the short_description attribute, from the admin panel go to Catalog > Attributes > Manage Attributes. However, you would need to remove all the values set for the existing products. I would do this with a tool called magmi mass importer.

Perhaps a better approach would be to remove the short description from the product view page and create a static block with your content and add this to the product view page.

For this method you first need to create a static block with your content, next add it to your layout xml, you need to find out the layout handle for your product view page, probably either PRODUCT_TYPE_configurable or PRODUCT_TYPE_simple or both? Then use the unset_child action method to remove the short description or you may need to just comment it out from your theme's catalog/product/view.phtml template file if it is not added by layout xml. Then make your recently created static block available to your product page with something like.

<block type="cms/block" name="my_identifier"> <action method="setBlockId"><block_id >my_identifier</block_id></action> </block> 

Finally to add your static block to your product pages use the below code snippet in your phtml template file, next to where the short description was being called.

<?php echo $this->getChildHtml('my_identifier') ?>

I think the second method is best as your content is not a short description of the product but rather useful information about your store and as such this data should not be held in the 'short_description' attribute which may be used elsewhere in the system, I.e. shopping cart, transactional emails etc.

Good luck

Related Topic