コード例 #1
0
 /**
  * Get filter value for reset current filter state
  *
  * @param string $filterValue Filter value
  * @return null|string
  */
 public function getResetFilterValue($filterValue)
 {
     $separator = Mage::helper('oggetto_filter/data')->getSeparator();
     if (is_array($filterValue)) {
         $currentFromPrice = $filterValue[0];
     } else {
         $currentFromPrice = explode('-', $filterValue)[0];
     }
     $priorIntervals = $this->getPriorIntervals();
     $value = array();
     if ($priorIntervals) {
         foreach ($priorIntervals as $priorInterval) {
             if ($priorInterval[0] !== $currentFromPrice) {
                 $value[] = implode('-', $priorInterval);
             }
         }
         return !empty($params) ? implode($separator, $value) : null;
     }
     return parent::getResetValue();
 }