2012-11-05 6 views
0

왼쪽에 선택한 카테고리 이름 및 하위 카테고리를 표시하고 싶습니다.왼쪽 블록에 카테고리 및 하위 카테고리 표시

이 코드 카테고리 목록을 사용하여 left.phtml

<?php if (!Mage::registry('current_category')) return ?> 
<?php $_categories = $this->getCurrentChildCategories() ?> 
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?> 
<?php if($_count): ?> 
<div class="block block-layered-nav"> 
<div class="block-title"> 
    <strong><span><?php echo $this->__('Browse By') ?></span></strong> 
</div> 
<div class="block-content"> 
    <dl id="narrow-by-list2"> 


     <dt><?php echo $this->__('Category') ?> 

     </dt> 
     <dd> 
      <ol> 
      <?php foreach ($_categories as $_category): ?> 
       <?php if($_category->getIsActive()): ?> 
       <li> 
        <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a> (<?php echo $_category->getProductCount() ?>) 
       </li> 
       <?php endif; ?> 
      <?php endforeach ?> 
      </ol> 
     </dd> 
    </dl> 
    <script type="text/javascript">decorateDataList('narrow-by-list2')</script> 
    </div> 
    </div> 
    <?php endif; ?> 

에서

는 볼 대신 카테고리의 수 \ left.phtml

응용 프로그램 \ 디자인 \ 프론트 엔드 \ 기본 \ 기본 \ 템플릿 \ 카탈로그 \ 탐색 'CATEGORY'가 표시됩니다. CATEGORY 대신 현재 카테고리를 볼 수 있습니까? 여기

답변

0

당신은 ('current_category') 현재 카테고리

$ _category = 마법사 : 레지스트리를 얻을 수 있습니다;

관련 문제