Magento pagination is not displaying on Catalog page - magento

In my magento website it is not displying page numbers on the bottom....In this website I have around 6-7 categories and every category has around 50 products
Changes I have made to the Magento admin panels are:
under admin -> Catalog -> Catalog -> Frontend
And under admin -> General -> Design-> Pagination
I'hv only made changes in these
Still page number on the product page not showing on here
Any Ideas why its happening?
EDIT:
This is my frontend\mgstheme\luxury\template\catalog/category/view.phtml page
<?php
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
$_imgHtml = '';
if ($_imgUrl = $_category->getImageUrl()) {
$_imgHtml = '<p class="category-image"><img class="img-responsive" src="' . $_imgUrl . '" alt="' . $this->escapeHtml($_category->getName()) . '" title="' . $this->escapeHtml($_category->getName()) . '" /></p>';
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}
$settingDescPosition = 1;
$setting = Mage::getModel('mpanel/setting')->load($_category->getId());
if($setting){
if($setting->getRatio()!=''){
$settingDescPosition = $setting->getDescPosition();
}
}
?>
<div class="page-title category-title">
<?php if ($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
<?php echo $this->__('Subscribe to RSS Feed') ?>
<?php endif; ?>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $helper = $this->helper('mpanel'); ?>
<div class="custom">
<div class="container">
<span><i class="fa fa-home"></i> / <span>Products</span> / <span><strong><?php echo $this->getCurrentCategory()->getName(); ?></strong></span></span>
</div>
</div>
<?php if ($this->isContentMode()): ?>
<?php echo $this->getCmsBlockHtml() ?>
<?php elseif ($this->isMixedMode()): ?>
<?php echo $this->getCmsBlockHtml() ?>
<div id="product-list-container">
<?php echo $this->getProductListHtml() ?>
</div>
<?php else: ?>
<div id="product-list-container">
<?php echo $this->getProductListHtml() ?>
</div>
<?php endif; ?>
<?php if ($helper->acceptToUsePanel()): ?>
<?php // description position below product list ?>
<?php if($settingDescPosition==2): ?>
<div class="builder-container inline-builder">
<?php if ($_description = $this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php echo $helper->getEditCategoryDescription($_category->getId()) ?>
<?php else: ?>
<div class="category-description std">
<span class="placeholder">Add description for this category</span>
</div>
<?php echo $helper->getEditCategoryDescription($_category->getId()) ?>
<?php endif; ?>
</div>
<?php endif ?>
<?php else: ?>
<?php // description position below product list ?>
<?php if($settingDescPosition==2): ?>
<?php if ($_description = $this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>
<?php endif ?>
<?php endif; ?>

Solved
Added this code to the view.phtml
<?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/bottom_toolbar.phtml')->toHtml(); ?>

Check in the catalog.xml whether you have called xml for pagination. The xml should be as below
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
As per your screenshot, you are using custom theme so please recheck all phtml files are in there folder related with pagination.
If still you are facing the same issue, so please see the below link that will help you :
https://support.webcto.eu/index.php/Knowledgebase/Article/View/43/8/paginating-not-shown-in-magento

Related

I want to display an option list for configurable attributes on product list page in magento

I want to display an option list for configurable attributes on product list page in magento, just like it appears on product view page for configurable products.I tried everything but nothing is working, looked for some similar topics but they are useless.Please help me resolve this issue.
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
$sidebar=Mage::getStoreConfig('buyshoplayout/product_listing/sidebar');
$i=0;
$count=0;
$span=3;
$p_in_row=4;
$type=Mage::getStoreConfig('buyshoplayout/product_listing/product_listing_image_size');
if($type=='small')
{
$span=2;
$p_in_row=6;
}
?>
<?php if(!$_productCollection->count()): ?>
<div class="category-products aligncenter">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('buyshop_no_products')->toHtml() ?>
</div>
<?php else: ?>
<div class="category-products">
<?php echo $this->getToolbarHtml() ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php foreach ($_productCollection as $_product): ?>
<?php
$widthBig=258;
$heightBig=245;
$widthSmall=71;
$heightSmall=65;
$count++;
?>
<!--PRODUCT-->
<div class="row product-listing">
<?php echo Mage::helper('buyshopconfig')->getProductHtml($_product,$this,$widthBig,$heightBig,$span,false,true,true,false,$this->getPriceHtml($_product, true))?>
<div class="span6 product-detailes">
<h3 class="product-name bottom-line"><?php echo $this->stripTags($_product->getName(), null, true)?></h3>
<div class="bottom-line">
<?php echo $this->getPriceHtml($_product, true) ?>
<div class="product-review">
<?php echo Mage::helper('buyshopconfig')->getStars($_product)?>
</div>
</div>
<div class="bottom-line"><?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?></div>
<div class="product-buttons">
<?php echo Mage::helper('buyshopconfig')->addToCartLink($_product,$this,true)?>
<div class="add-to-links">
<ul>
<?php echo Mage::helper('buyshopconfig')->addWishCompLink($_product,$this,true)?>
</ul>
</div>
</div>
</div>
</div>
<!--PRODUCT EOF-->
<?php endforeach; ?>
<?php else: ?>
<?php // Grid Mode ?>
<?php if(!empty(Mage::registry('current_category')->name)):?>
<h2><?php echo Mage::registry('current_category')->name ?></h2>
<?php endif; ?>
<?php if($sidebar):?><div class="row big_with_description"><?php endif; ?>
<?php foreach ($_productCollection as $_product): ?>
<?php if(!$_product->isSaleable() && !Mage::getStoreConfig('cataloginventory/options/show_out_of_stock'))continue; ?>
<?php
$widthBig=258;
$heightBig=245;
$widthSmall=71;
$heightSmall=65;
$count++;
?>
<?php
if(!$sidebar)
{
$i++;
if($i==1)echo '<div class="row big_with_description">';
}
$price=$this->getPriceHtml($_product, true);
?>
<!--PRODUCT-->
<?php echo Mage::helper('buyshopconfig')->getProductHtml($_product,$this,$widthBig,$heightBig,$span,false,true,false,true,$price)?>
<?php echo Mage::helper('buyshopconfig')->getProductHover($_product,$this,$widthBig,$heightBig,$widthSmall,$heightSmall,$type,true,true,$price)?>
<!--PRODUCT EOF-->
<?php
if(!$sidebar)
{
if($i==$p_in_row || $count==count($_productCollection))
{
echo '</div>';
$i=0;
}
}
?>
<?php endforeach; ?>
<?php if($sidebar):?></div><?php endif; ?>
<?php endif; ?>
<?php echo $this->getToolbarHtml() ?>
</div>
<?php endif; ?>

Show categories on left and not on top navigation

I tried implemented a code in my Navigation/left.phtml
The code is as follows
<!-- subcategory code -->
<?php
$category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
if(!$category->getChildren()){
//$parentcat_id = $category->getParentCategory()->getId();
//$category = Mage::getSingleton('catalog/category')->load($parentcat_id);
$category = $category->getParentCategory();
}
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren());
?>
<div class="block">
<div class="block-title">
<span><?php echo $category->getName() ?></span>
</div>
<div class="block-content clearfix">
<ul class="subcategories">
<?php foreach ($categories as $category): ?>
<li>
<a href="<?php echo $category->getUrl() ?>"><!--<img src="<?php echo Mage::getBaseUrl('media') . 'catalog' . DS . 'category' . DS . $category->getThumbnail() ?>" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />-->
<span><?php echo $category->getName() ?>
<?php $collection = Mage::getModel('catalog/product')->getCollection()->addCategoryFilter($category);
echo "(".count($collection).")"; ?></span>
</a>
</li>
<?php endforeach; ?>
</ul></div>
</div>
<!-- subcategory code -->
<!-- List all categories and their second level subcategories -->
<div class="block block-list block-categories">
<div id="block-categories" class="block-title active">
<strong><span>Categories </span></strong>
</div>
<div id="leftnav" class="block-content" style="display:block">
<?php $helper = $this->helper('catalog/category') ?>
<?php $categories = $this->getStoreCategories() ?>
<?php if (count($categories) > 0): ?>
<ul id="leftnav-tree" class="level0">
<?php foreach($categories as $category): ?>
<li class="level0<?php if ($this->isCategoryActive($category)): ?> active<?php endif; ?>">
<?php //if ($this->isCategoryActive($category)): ?>
<?php $subcategories = $category->getChildren() ?>
<?php if (count($subcategories) > 0): ?>
<ul id="leftnav-tree-<?php echo $category->getId() ?>" class="level1">
<?php foreach($subcategories as $subcategory): ?>
<li class="level1<?php if ($this->isCategoryActive($subcategory)): ?> active<?php endif; ?>">
<?php echo $this->escapeHtml(trim($subcategory->getName(), '- ')) ?>
<?php $secondLevelSubcategories = $subcategory->getChildren() ?>
<?php if (count($secondLevelSubcategories ) > 0): ?>
<ul id="leftnav-tree-<?php echo $subcategory->getId() ?>" class="level2">
<?php foreach($secondLevelSubcategories as $secondLevelSubcategory ): ?>
<li class="level2<?php if ($this->isCategoryActive($secondLevelSubcategory )): ?> active<?php endif; ?>">
<?php echo $this->escapeHtml(trim($secondLevelSubcategory ->getName(), '- ')) ?>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script>
<?php endif; ?>
<?php //endif; ?>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList('leftnav-tree', 'recursive')</script>
<?php endif; ?>
</div>
</div>
But when i set Include in Navigation Menu to No it also disappears from here.
Is there any way I can hide from top menu and show in my side menu?
Demo link is http://infigic.com/ds4u/
If you don't have local.xml file just create one in the layout folder of your theme and populate it with this content:
<?xml version="1.0"?>
<layout>
<default>
<reference name="header">
<action method="unsetChild"><name>top.menu</name></action>
</reference>
<reference name="left">
<action method="insert"><child>top.menu</child></action>
</reference>
</default>
</layout>
Changing your collection request to this should work :
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addAttributeToFilter('include_in_menu', 1) // there is the 'magic'
->addIdFilter($category->getChildren());
Although, I do not recommend you to do it like this.
Because:
You are breaking the MVC pattern of Magento when requesting a model from a view
You are doing over complicated things that you may probably achieve easier by doing a block which extends Mage_Catalog_Block_Navigation, where the category may already be filtered the right way, but not rendered as you would like.
Please have a look at base Magento template (well not only the one in /app/design/frontend/base, but the one coming with a fresh install of Magento) and you'll see that never ever are there going to be a direct call in a view to a model instance.
For Magento good practice, please refer to the perfect blog of Alan Storm (who also is a SO member) here and maybe more specifically to this chart showing how templates (view) should interact with blocks to render models.

Magento home page popular products

Hi All I want to show 4 popular products on the home page of my magento 1.7.1 install. (The I can select by putting them into a category).
I've set this up by creating a hidden category called popularhome and added 4 products into it.
I've included this in a static block into my home page template by using:
{{block type="catalog/product_list" column_count="4" category_id="17" template="catalog/product/listhome.phtml"}}
My listhome.phtml template looks like this:
<div class="row popularproducts">
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<div class="alert fade in">
<a class="close" data-dismiss="alert">×</a>
<?php echo $this->__('There are no products matching the selection.') ?>
</div>
<?php else: ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = $this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php if ($i++%$_columnCount==0): ?>
<?php endif ?>
<div class="c3">
<?php if(($i-1)%$_columnCount==0): ?><?php elseif($i%$_columnCount==0): ?><?php endif; ?>
<div class="thumbnail">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(225); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
<div class="caption">
<h2 class="product-name"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h2>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
<?php endif; ?>
<?php echo $this->getPriceHtml($_product, true) ?>
</div>
</div>
</div>
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
<?php endif ?>
<?php endforeach ?>
<?php endif; ?>
<?php endif; ?>
</div>
However this is only showing 2 of the 4 products yet I cannot figure out why? Does anyone see anything I am missing?
Thanks!
First you need to check ,the products that you want to be appear in category page,
Is they really belong to that categories.
After that make sure Backend > Manage Categories > Edit categories > Display settings >
is Anchor = yes Then re-index your catalog.
To verify you need to cross check catalog_category_product and catalog_category_product_index.
If the category id and product id is mapped properly in these tables you should be good to go.
hope this will sure help you!

How to display all categories in Magento not top level category?

I tried this link and displaying all the categories in home page but it is displaying only the top level categories. I want to display all the categories.
<div class=”block block-verticalmenu”>
<div class=”block-title”>
<strong><span><?php echo $this->__(‘Categories’) ?></span></strong>
</div><!–End block block-cart–>
<div class=”block-content”>
<ul id=”ma-accordion” class=”accordion”>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?> </ul>
</div><!–End Of vertical-nav–>
<?php echo $this->getChildHtml(‘topLeftLinks’) ?>
</div><!–End Of vertical-nav-container box base-mini–>
You could try replacing the function call
echo $this->drawItem($_category)
by
echo $this->drawOpenCategoryItem($_category)
<?php $_helper = Mage::helper('catalog/category') ?>
<?php $_categories = $_helper->getStoreCategories() ?>
<?php $currentCategory = Mage::registry('current_category') ?>
<?php if (count($_categories) > 0): ?>
<ul>
<?php foreach($_categories as $_category): ?>
<li>
<a href="<?php echo $_helper->getCategoryUrl($_category) ?>">
<?php echo $_category->getName() ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

How to display all categories in magento project

am new to magento 1.7 and am using celebrity theme now what i want is to add all the categories to be displayed in left side bar , i have browsed through n tried many but none of them are working (May be due to Celebrity theme). So can any one help me on this ASAP. PLEASE
you can add like this
go to your layout.xml and add like this
/app/design/frontend/default/default/layout/catalog.xml
Open this Xml file and paste this code.
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/left_nav.phtml" />
</reference>
open this file ..
/app/design/frontend/default/default/template/catalog/navigation/left_nav.phtml
paste this code:
<?php
$obj = new Mage_Catalog_Block_Navigation();
$store_cats = $obj->getStoreCategories();
$current_cat = $obj->getCurrentCategory();
$current_cat = (is_object($current_cat) ? $current_cat->getName() : '');
foreach ($store_cats as $cat) {
if ($cat->getName() == $current_cat) {
echo '<li class="current">'.$cat->getName()."\n<ul>\n";
foreach ($obj->getCurrentChildCategories() as $subcat) {
echo '<li>'.$subcat->getName()."</li>\n";
}
echo "</ul>\n</li>\n";
} else {
echo '<li>'.$cat->getName()."</li>\n";
}
}
?>
EDIT
LIST ALL CATEGORIES
$_helper = Mage::helper('catalog/category') ?>
<?php $_categories = $_helper->getStoreCategories() ?>
<?php $currentCategory = Mage::registry('current_category') ?>
<?php if (count($_categories) > 0): ?>
<ul>
<?php foreach($_categories as $_category): ?>
<li>
<a href="<?php echo $_helper->getCategoryUrl($_category) ?>">
<?php echo $_category->getName() ?>
</a>
<?php //if ($currentCategory && $currentCategory->getId() == $_category->getId()): ?>
<?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>
<?php $_subcategories = $_category->getChildrenCategories() ?>
<?php if (count($_subcategories) > 0): ?>
<ul>
<?php foreach($_subcategories as $_subcategory): ?>
<li>
<a href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>">
<?php echo $_subcategory->getName() ?>
</a>
<?php $_category1 = Mage::getModel('catalog/category')->load($_subcategory->getId()) ?>
<?php $_subcategories1 = $_category1->getChildrenCategories() ?>
<?php if (count($_subcategories1) > 0): ?>
<ul>
<?php foreach($_subcategories1 as $_subcategory1): ?>
<li>
<a href="<?php echo $_helper->getCategoryUrl($_subcategory1) ?>">
<?php echo $_subcategory1->getName() ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php // endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif;?>

Resources