Catalog Search Index refresh running slow or halting/freezing

You no longer need to follow the instructions below, you can use the new tool on Magento Connect instead. Please note. This article applies to Magento 1.4 and greater only. A lot of people are starting to find that with large catalogues that the new indexing manager in Magento 1.4 may be starting to time out when generating Catalog Search Index – Rebuild Catalog product fulltext search index. This usually results in a blank screen when refreshing indexes or a index timeout error This is largely due to a number of factors: the number of products in a catalogue the number of store views the apache/lighttpd timeout setting the php.ini maximum execution time & script input time an already inflated catalogsearch_fulltext MySQL table the lock file is still place from the previous time it ran preventing it running again To remedy this issue, you’ll need to know a few facts. … Continue reading

Magento random block generator / block randomiser

This could be pretty useful if you want to combine XML block control with a random content display (eg. banner ads). Very easily achieved, simply create 1 file in ./base/default/template/page/html/random_block.phtml <?php $children = $this->getSortedChildren(); if(is_array($children)) { shuffle($children); echo $this->getChildHtml($children[0]); } ?> Then in your relevant XML file – control the output by using: <block type="core/template" name="left.callout.random" template="page/html/random_block.phtml" before="-"> <block type="core/template" name="left.callout.random1" template="callouts/left_col.phtml"> <action method="setImgWidth"><width>240</width></action> <action method="setImgSrc"><src>images/image1.png</src></action> <action method="setImgAlt" translate="alt" module="catalog"><alt>some alt text</alt></action> <action method="setLinkUrl"><url>link url</url></action> </block> <block type="core/template" name="left.callout.random2" template="callouts/left_col.phtml"> <action method="setImgWidth"><width>240</width></action> <action method="setImgSrc"><src>images/image2.png</src></action> <action method="setImgAlt" translate="alt" module="catalog"><alt>some alt text</alt></action> <action method="setLinkUrl"><url>link url</url></action> </block> </block> You can add any type of block you want and it will just grab one at random.