skip to Main Content

I try to edit price filter of magento 1.9. when click on first range of filter it give me wrong result bcz its minimum value is 0.00 I want to change this 0.00 to 1 .

enter image description here

2

Answers


  1. You can change the price filter value with this:

    <?php 
    $getLabel = $_item->getLabel();
    if (strpos($getLabel, 'price')!== false) :?>
        <a class="multi-select unselected" href="<?php echo $this->urlEscape($_item->getUrl()) ?>">
    
            <?php 
            $getValue = $_item->getValue();
                $fitlerPrices = str_replace('-', ' - ', $getValue);
    
    
                $file = basename($fitlerPrices); 
    
                $parts = explode("-", $file); 
                $getCurency = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
                $priceBefore = $getCurency . number_format($parts[0], 0);
                $priceAfter = $getCurency . number_format($parts[1], 0); ?>
                <?php
                    if($i == $count){
                        //item terakhir  
                        echo '<span class="price">' . $priceBefore . 'and Above</span>';
                    }elseif($i <= 1){
                        //item pertama  
                        echo '<span class="price">Below ' . $priceAfter . '</span>';
                    }else{
                         echo '<span class="price">' . $priceBefore . ' - ' .$priceAfter . '</span>';
                    }
                ?>
    
            </a>
    <?php else :?>
    
        <a class="multi-select unselected" href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel(); ?></a>
    <?php endif?>
    
    Login or Signup to reply.
  2. For this,

    1. You have to maintain the minimum price is Rs.1 for the products.
    2. First, Check if any product has price 0 in your admin panel. if has, modify. Then sure you will get the solution.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search