cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to load product list through ajax

Best way to load product list through ajax

I have been making a little search box that lets you select an article and then shows you the accessories available for that product. I have been just getting the basic info from the server and building the elements through js, but this doesn't seem to be the best solution. For one thing, I can't seem to get the price straight in a controller, as all the logic is in a template for some reason.

 

Shoud I be building the blocks on the server and sending that to my js callback ? Are there better solutions ?

1 REPLY 1

Re: Best way to load product list through ajax

Its really a bummer that the price logic is in template and layout, you will probably have to build blokcs. You can take a look at Mage_XmlConnect_Block_Catalog_Product_Price::collectProductPrices, maybe it will help you.

You don't want to  set price straight in controller anyway, as a controller in MVC is normally not responsible for generating data.