Hi,
I am trying to show the popular product list using ajax in magento on the home page using ajax, I could do that for 5 or "N" no.of products, but what i want is the pagination toolbar to be added with the result set.
This is what i added to show the popular products,
// Magento layout
$magento_block = Mage::getSingleton('core/layout');
$productsHtml = $magento_block->createBlock('catalog/product');
$productsHtml->setTemplate('catalog/product/popular.phtml');
echo $productsHtml ->toHTML();
And under popular.phtml
<?php
$_productCollection = Mage::getModel('catalog/product')->getCollection()
->addPriceData()
->addAttributeToSort('ordered_qty', 'DESC')
->addAttributeToSort('name', 'ASC')
->setPageSize($limit)
->setPage($p, $limit)
->addAttributeToSelect(array('entity_id', 'entity_type_id', 'attribute_set_id', 'type_id', 'sku', 'category_ids', 'created_at', 'updated_at','has_options', 'sync', 'name', 'stock_status', 'wc_review_iwc_rating', 'wc_review_wa_rating', 'wc_review_bh_rating', 'small_image', 'status', 'pre_arrival', 'description', 'short_description', 'price', 'is_salable', 'stock_item', 'gift_message_available', 'featured'));
?>
So this gives me the popular products of specified page and limit, but i could not load the pagination toolbar(by directly adding the toolbar to popular.phtml or through create block layout function), Where am wrong? Could anybody tell me please.
Thanks