<?php
//@*--


include_once('Mage/Catalog/controllers/CategoryController.php');

class Theme_Ajax_Catalog_CategoryController extends Mage_Catalog_CategoryController
{
    public function viewAction() {
        parent::viewAction();

        $params = $this->getRequest()->getParams();

        if (array_key_exists('ajax', $params) && $params['ajax']) {
            $layout = $this->getLayout();
            $list = $layout->getBlock('product_list')->toHtml();
            $this->getResponse()->setBody($list);
        }
    }
}

//--*@