我想在类别页面上显示当前类别的可配置产品的数量。为此,我已经写了下面的代码...仅显示当前类别的可配置产品的数量
<?php $cate = Mage::registry('current_category')->getName();
$total=0;
$category = Mage::registry('current_category');
$products = $category->getProductCollection();
foreach ($products as $_product)
if ($_product->isConfigurable())
{
$total++;
}
echo $cate."(".$total.")"; ?>
我的问题是代码表明所有子类配置的产品的总数...谁能帮助我?
是有问题的类别锚类别? – clockworkgeek 2011-02-25 22:46:47
是的,这是一个锚类别.. – hs19 2011-03-04 04:34:41