cancel
Showing results for 
Search instead for 
Did you mean: 

Controller Product Collection to result page

Controller Product Collection to result page

Hello,

 

I've created a custom controller to pull some products or essentially a small custom search form. How would I display my product collection on our search results page?

 

Thank You,

Andy

1 REPLY 1

Re: Controller Product Collection to result page

You should use the default Magento functionality. Thus, you will avoid some tricky moments.

 

- For this purpose I would use the Mage_Catalog_Block_Product_List block.

Create your own block (that will be extended to another one):
https://www.gyazo.com/6dadd2973cef5994da0a6afe6b373ab1


- Inside of it, rewrite all what you need to. As I assume, you need to re-write all the stuff related to the category (if I've understood it correctly, to the one that doesn't exist)

- Next you need to assign this block to our action:
https://www.gyazo.com/b039fd84430dead0f647aa25a8b5c6e4

- Thus, without changing the collection, you will get the category root page:
https://www.gyazo.com/282cf6de7f474a2ff1f8d5a109663365

 

By analogy, you can use the search results page. However, I assume that there you'll have to change a bigger amount of methods.


If such blocks as, for example, toolbar are not important to you, you may simplify the task: just use your own block where you can get the collection and the  'to the one, as' template. 

______________________________________________________________
Innovative, top-performing Magento Extensions (with an array of FREE tools).