Friday, December 3, 2010

categories view and product listin after particular cat level with quickview product details







$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
$cat = Mage::getModel('catalog/category')->load($_category->getId());
$subcats = $cat->getChildren();
$subcat= explode(',',$subcats);
$_columnCount=3;
$_collectionSize = count($subcat);

$catlevel=$_category->getLevel();
// $_category->setDisplayMode('PAGE');


if($subcats!="" && $catlevel<4){>




{
$_subcategory = Mage::getModel('catalog/category')->load($subCatid);
if($_subcategory->getIsActive())
{
$caturl = $_subcategory->getURL();
$this_current_category = Mage::registry('current_category');
$parentCategory = Mage::getModel('catalog/category')->load($_category->getParentId());
$products = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($_subcategory)->addAttributeToSelect('*');
?>










}
}
?>

elf Cosmetics

getImageUrl()):?>
" title="getName(); ?>">getImageUrl()?>" width="193" height="129">

" title="getName(); ?>">/skin/frontend/base/default/images/catalog/product/placeholder/small_image.jpg">



$subcats1 = $_subcategory->getChildren();
$subcat1= explode(',',$subcats1);
if($subcats1!=""){
foreach($subcat1 as $subCatid1) {
$_subcategory1 = Mage::getModel('catalog/category')->load($subCatid1);
?>
getURL()?>">getName()?>





}
else
{ //product display

$cat = Mage::getModel('catalog/category')->load($_category->getId());
$subcats = $cat->getChildren();
$subcat= explode(',',$subcats);
foreach($subcat as $subCatid){
$_subcategory = Mage::getModel('catalog/category')->load($subCatid);
if($_subcategory->getIsActive())
{
//Mage::register('current_category', $_subcategory);
echo '
'. $_subcategory->getName().'
';
$collection = $_subcategory->getProductCollection();

$products = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($_subcategory)->addAttributeToFilter('visibility', 4)->addAttributeToSelect('*');
$products->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit(3);
$products->load();
$_product = null;

////////////////////////////////////////////////
?>
count()): ?>

__('There are no products matching the selection.') ?>






count() ?>












elf Cosmetics
getId()?>);" onmouseover="show_sp_button(getId()?>);" class="depttitle dept_box">







$script='



////////////////////////////////////////////////
}
}

?>

$script.="";
echo $script;
?>

}
?>



No comments:

Post a Comment