问题
I'd like to customize the layout for the result page of CatalogSearch.
I'd like to remove the pagination and all other tools on the page and show a much simpler page since we only have few products. Then I need to change how results are displayed to customize the size of images and add a rollover on images.
How can I do that?
By looking at the source code it calls $this->getProductListHtml()
.
回答1:
The easiest way to determine which template files to edit, is to enable the "Template Path Hints" in your Magento Configuration.
To do this, do the following:
In your Magento Admin, go to System > Configuration > Developer
On the top left under Current Configuration Scope, select Main Website (or the name of the site you are trying to modify.)
Now on the right, set Template Path Hints to Yes and click Save Config
Go back to your frontend. Each section will now display the exact template you need to modify. NOTE: You should always copy the default template files to your own template directory, instead of modifying Magento's core theme.
Alternately, you can target each page in Magento using CSS. Magento assigns a unique class to each page's <body>
tag
In your case, the Catalog Search Results page has a body class of catalogsearch-result-index. If you want to hide the toolbar on that page, you can add the following to your template's style.css file:
.catalogsearch-result-index .toolbar {
display: none;
}
来源:https://stackoverflow.com/questions/12431767/magento-customize-catalogsearch-result-html