How to access Product module output with jquery [solved]
Posted: Fri Oct 14, 2011 10:03 am
I am attempting my first foray in ajax functionality. I have managed to achieve the desired result, but would like to know if there is a better way to achieve this.
I want to reload a product shortlist/wishlist from the Products module. The way I have achieved this initially is to create a blank template and dummy page 'tmp/shortlist.html' that just contains the output of:
{Products summarytemplate="Product_Thumbnails" productlist=$shortlist_ids pagelimit="6"}
Then using jquery I reload the html snippet when necessary with:
While this works just fine. (I was amazed how easy it was!) I suspect there must be a more elegant way to get to the module output from javascript than having to create a dummy page. I am probably missing something pretty obvious, but can't find a solution so far in the forums.
Thanks
Chris
I want to reload a product shortlist/wishlist from the Products module. The way I have achieved this initially is to create a blank template and dummy page 'tmp/shortlist.html' that just contains the output of:
{Products summarytemplate="Product_Thumbnails" productlist=$shortlist_ids pagelimit="6"}
Then using jquery I reload the html snippet when necessary with:
Code: Select all
$('#shortlist_content').load('tmp/shortlist.html');
Thanks
Chris