0

サイトに「静的ブロックと製品」のカテゴリ表示モードを使用しています。静的ブロックは問題なく表示されますが、すべての製品ではなく、最後のサブカテゴリの製品のみが表示されます。すべての「アンカー」オプションを再確認し、元のカテゴリ/view.phtml に戻ってみましたが、何かを上書きして無駄になったのではないかと考えました。私はどんな提案にもオープンです...

サードパーティから使用している静的ブロック コードを次に示します。

<div class="category-products">
<ul class="products-grid">
<?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if($_category->getIsActive()):
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0){
$class = "first";
}
elseif ($categorycount == 3){
$class = "last";
}
else{
$class = "";
}
?>
<li class="item <?php echo $class?>">
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
<img src="<?php echo $_category->getImageUrl() ?>" width="100" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />
</a>
<h2>
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
<?php echo $this->htmlEscape($_category->getName()) ?></a></h2>
</li>
<?php
endif;
if($categorycount == 3){
$categorycount = 0;
echo "</ul>\n\n<ul class=\"products-grid\">";
}
else{
$categorycount++;
}
endforeach;
endif;
?>
</ul>
</div>
4

2 に答える 2

0

私はデイブに同意します。私も同じ問題を抱えていました。次の行をコメントアウトするだけです。

$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
于 2015-01-13T06:18:20.943 に答える