Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Daily Archives: 04/02/2011

CMS MS – iframe POST method

Magento – Search Results Page 3 column layout display


Magento – Search Results Page 3 column layout display:

Change this file:
/public_html/app/design/frontend/base/default/layout/catalogsearch.xml
change: <action method="setTemplate"><template>page/2columns-right.phtml</template></action> by
<action method="setTemplate"><template>page/3columns.phtml</template></action>

Magento – Display 3 records per row in advance search result page


File Path: /public_html/app/design/frontend/default/f001/template/catalog/product/list.phtml
Change:

$_columnCount = 3;//$this->getColumnCount();

Magento – Search Results Grid Different From Product Grid Listing


From what I can see, it doesn’t look like the Result.php block loads the short description in the _getProductCollection function. The getShortDescription will work, but you just need to tell the block to load that info so that you can call it. Open up app->core->Mage->CatalogSearch->Block->Result.php. You should see the following function:

protected function _getProductCollection()
    {
        if (is_null($this->_productCollection)) {
            $this->_productCollection = $this->_getQuery()->getResultCollection()
                ->addAttributeToSelect('url_key')
                ->addAttributeToSelect('name')
                ->addAttributeToSelect('price')
                ->addAttributeToSelect('special_price')
                ->addAttributeToSelect('special_from_date')
                ->addAttributeToSelect('special_to_date')
                ->addAttributeToSelect('description')
                ->addAttributeToSelect('image')
                ->addAttributeToSelect('small_image')
                ->addAttributeToSelect('tax_class_id');

            Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this->_productCollection);
            Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($this->_productCollection);
        }

        return $this->_productCollection;
    } 
    

As you can see, the short_description is not part of the select query. You can change ->addAttributeToSelect(’description’) to ->addAttributeToSelect(’short_description’), or you can add ->addAttributeTo Select(’short_description’) entirely. Of course, proper conventions would say that you should ammend the function via the local code pool as to preserve the integrity of your changes across future upgrades, but this’ll give you an idea as to how to get the short_description to show up.