2012-11-01 2 views
2

구문 : http://www.magentocommerce.com/boards/viewthread/65135/P15/#t278667나는이 스레드 알라 마 젠토의 가격 계층 탐색 사용자 정의하기 위해 노력하고있어 오류

을하지만 복사 나 오류로 실행 해요 자신의 코드를 붙여 넣을 때, 아래의 코드를 참조하십시오. 아이디어가 있으십니까?

if ((($collect + $count) >= $minEntries) && (($index <= $lastRangeIndex) || ($lastRangeIndex == 0)) { 

에서

protected function _getItemsData() 
{ 
    $key = $this->_getCacheKey(); 

    $data = $this->getLayer()->getAggregator()->getCacheData($key); 
    if ($data === null) { 
     $range  = 100;// $this->getPriceRange(); 
     $minEntries = 30; 
     $minPercentage = 12; //overrides the previous line if set, sets minEntries to $minPercentage of total items 
     $lastRange = 5000; //collects everything over this value into one range, must be a multiple of $range. Set to 0 for no last range. 
     $lastRangeIndex = $lastRange == 0 ? 0 : intval($lastRange/$range); 

     $dbRanges = $this->getRangeItemCounts($range); 
     if (($minPercentage > 0) && ($minPercentage < 100)) { 
      $itemCount = array_sum($dbRanges); 
      $minEntriesByPercentage = intval($itemCount * ($minPercentage/100)); 
      $minEntries = $minEntriesByPercentage; 
     } 
     $data  = array(); 

     $collect = 0; 
     $collectIndex = 0; 
     $collections = 1; 
     $lastIndex = 0; 
     foreach ($dbRanges as $index=>$count) { 
      if ((($collect + $count) >= $minEntries) && (($index <= $lastRangeIndex) || ($lastRangeIndex == 0)) { 
        $collections = $collectIndex == 0 ? 1 : ($index - $collectIndex) + 1; 
        $data[] = array(
         'label' => $this->_renderItemLabel($range * $collections, $index/$collections), 
         'value' => ($index/$collections) . ',' . $range * $collections, 
         'count' => $count + $collect, 
        ); 
        $collect = 0; 
        $collections = 1; 
        $collectIndex = 0; 
      } else { 
        $collect = $collect + $count; 
        if ($collectIndex == 0) { 
          $collectIndex = $index; 
        } 
        $collections = $collectIndex == $index ? 1 : ($index - $collectIndex) + 1; 

      } 
      $lastIndex = $index; 
     } 
     if ($collect > 0) { 
        $data[] = array(
         'label' => $this->_renderItemLabel($range * $collections, $lastIndex/$collections), 
         'value' => ($lastIndex/$collections) . ',' . $range * $collections, 
         'count' => $collect, 
        ); 
     } 

     $tags = array(
      Mage_Catalog_Model_Product_Type_Price::CACHE_TAG, 
     ); 
     $tags = $this->getLayer()->getStateTags($tags); 
     $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags); 
    } 
    return $data; 
} 
+1

오류가 무엇입니까? – Sara

답변

2

는 경우 구문에 대한 ")을"누락되었습니다

if ((($collect + $count) >= $minEntries) && (($index <= $lastRangeIndex) || ($lastRangeIndex == 0))) { 
+0

완벽한 감사합니다! – Matt