Magento 分页有问题。
我的 XML 调用的谨慎列表页面是:
<block type="catalog/product_list" name="categorieen" as="categorieen" translate="label" template="page/html/categorieen.phtml">
<label>Categorieën</label>
</block>
我的产品列表页面的代码是:
<div id="products">
<?php $_productCollection=$this->getLoadedProductCollection();?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = $this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php
$pic = $this->helper('catalog/image')->init($_product, 'thumbnail')->keepFrame(false)->resize(170);
?>
<a href="<?php echo $this->getAddToCartUrl($_product) ?>">
<div class="block_prod">
<div class="block_image_prod"><img src="<?php echo $pic; ?>"></div>
<div class="block_title_prod"><h2><?php echo strtoupper($this->htmlEscape($_product->getName())); ?></h2></div>
</div>
</a>
<?php $i++; endforeach ?>
<?php
/*
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO.'/app/Mage.php';
Mage::app();*/
/* Provide a known category id that has children as a test */
$_cat = new Mage_Catalog_Block_Navigation();
$curent_cat = $_cat->getCurrentCategory();
$curent_cat_id = $curent_cat->getId();
$id = $curent_cat_id;
/* Load category by id*/
$cat = Mage::getModel('catalog/category')->load($id);
/*Returns comma separated ids*/
$subcats = $cat->getChildren();
//Print out categories string
#print_r($subcats);
foreach(explode(',',$subcats) as $subCatid)
{
$_category = Mage::getModel('catalog/category')->load($subCatid);
if($_category->getIsActive() && !$_category->getIncludeInMenu())
{
$caturl = $_category->getURL();
$catname = $_category->getName();
if($_category->getImageUrl())
{
$catimg = $_category->getImageUrl();
}
?>
<a href="<?php echo $caturl; ?>">
<div class="block_prod">
<div class="block_image_prod"><img src="<?php echo $catimg; ?>"></div>
<div class="block_title_prod"><h2><?php echo strtoupper($catname); ?></h2></div>
</div>
</a>
<?php
}
}?>
</div>
<div i="toolbar-bottom">
<?php echo $this->getToolbarHtml(); ?>
</div>
在我的产品页面上,我包含了工具栏
<?php echo $this->getToolbarHtml(); ?>
但我没有像这样的分页
1-2-3-4...12
我只得到:
Show 30 per page
有解决方案吗?非常感谢!