Ampliación de la regleta de búsqueda simple catálogo
-
16-10-2019 - |
Pregunta
Necesito extender Mage_CatalogSearch_Block_Result
, pero algo hice mal .. Por favor alguien puede ayudarme?
comunidad / Carpeta / MiNombre / Bloquear / Result.php
<?php
class Folder_MyName_Block_Result extends Mage_CatalogSearch_Block_Result
{ .... }
?>
Creo que el problema está aquí: comunidad / Carpeta / MiNombre / etc / config.xml
<global>
<blocks>
<myname>
<class>Folder_MyName_Block</class>
</myname>
<catalog>
<rewrite>
<catalogsearch>Folder_MyName_Block_Result</catalogsearch>
</rewrite>
</catalog>
</blocks>
</global>
Solución
It might be not obvious but search functionality doesn't live inside of a catalog
module but in catalogsearch
. So here is how your rewrite shall look like:
<catalogsearch>
<rewrite>
<result>Folder_MyName_Block_Result</result>
</rewrite>
</catalogsearch>
And a small side-note. The closing ?>
in your PHP files is redundant. It may look good from a styling point of view, but in some cases it may cause Headers already sent
issue if you have a space after it.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange