How to change the Price Range Magento

If you need to change the Price Range in your Magento catalog go to:

app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php

Look for the line:

Change the 10 for a lower / higher number.

Please notice you’re editing a Magento Core file.

You will lose the changes if you ever upgrade. You should create the same folder structure and override the file but within the /app/local folder (is there an other way?).

From the Admin

You can also edit the price range from the Admin:

1. Go to System > Configuration > Catalog (under Catalog) > Layered Navigation

2. Change the Price Navigation Step Calculation dropdown from Automatic to Manual

3. Enter the amount you want it to be (e.g. – 50) into the Default Price Navigation Step input box

4. Save

16 Responses to “How to change the Price Range Magento”

  1. Surya January 6, 2012 at 2:41 pm #

    I want price ranges like this:
    • Dresses under $100
    • Between $100-$200
    • Between $200-$300
    • Between $300-$400
    • Between $400-$500
    • Dresses Over $500

    If you have any solution please send me answer on my mail also

    • Rick January 9, 2012 at 8:19 am #

      Have you tried the code above?

      Change the 10 and check what it prints.

      Regards

  2. DEBO Jurgen February 28, 2012 at 6:08 pm #

    Backend->Menu->Catalog->Manage Categories

    Select Your category Dresses on left pane

    Select TAB, Display settings.

    Layered Navigation Price Step

    Uncheck Use Config Settings

    Set the step You want.

  3. shuja June 11, 2012 at 9:54 am #

    I want to change the price range like this

    Under $2,000
    $2,000 – $10,000
    $10,000 – $30,000
    Over $30,000

    any suggestion

    • Rick June 11, 2012 at 10:09 am #

      Hi Shuja,

      I don’t think it’s posible with the code above.

      Cheers,

    • eduardo June 12, 2012 at 5:34 pm #

      Hi Shuja,

      I have exactly the same isue have you solve it?

      i know that i have to change the price.php at the model/layer/filter but i srugle to make it work.

  4. aurelien July 5, 2012 at 4:44 pm #

    hello
    same issue here too (as Shuja and eduardo)
    did anyone found a solution?
    thx

    • Rick July 5, 2012 at 4:54 pm #

      Hi aurelien,

      Have you tried the following?

      1. Go to Admin > System > Configuration > Catalog (under Catalog) > Layered Navigation.

      2. Change the Price Navigation Step Calculation dropdown from Automatic to Manual.

      3. Enter the amount you want it to be (e.g. – 50) into the Default Price Navigation Step input box .

      4. Save

      Cheers,

      Rick

    • aurelien July 5, 2012 at 4:57 pm #

      hello
      yes, I already saw this option
      but it generates a fix-value ranges (0-50, 50-100, 100-150, …)
      as Shuja mentionned, my need is to have custom price ranges (0-100, 100-500, 500-2000, …)

    • Rick July 5, 2012 at 5:02 pm #

      I’ve found this thread, there’s a lot of code in there. Give it a shot:

      http://www.magentocommerce.com/boards/viewthread/10213

      If you find an easy solution, feel free to come back and post it for the rest 😉

      Good luck!

  5. eduardo July 5, 2012 at 5:17 pm #

    Hi,

    I solve it coping Price.php to Local->Mage->Catalog->Model->Layer->Filter->Price.php

    then I added an if to the products biger than 10000000 (my products with out prise have a big numbers )

    [code]

    /**
    * Get data for build price filter items
    *
    * @return array
    */
    protected function _getItemsData() {
    if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_IMPROVED) {
    return $this->_getCalculatedItemsData();
    } elseif ($this->getInterval()) {
    return array();
    }

    $range = $this->getPriceRange();
    $dbRanges = $this->getRangeItemCounts($range);
    $data = array();

    if (!empty($dbRanges)) {
    $lastIndex = array_keys($dbRanges);
    $lastIndex = $lastIndex[count($lastIndex) – 1];

    foreach ($dbRanges as $index => $count) {
    $fromPrice = ($index == 1) ? ” : (($index – 1) * $range);
    $toPrice = ($index == $lastIndex) ? ” : ($index * $range);

    //EGS if toPrice is more than 20 the 20
    if ($fromPrice >= 1000000.1) {
    $data[] = array(
    ‘label’ => ‘Enquire’,
    ‘value’ => $fromPrice . ‘-‘ . $toPrice,
    ‘count’ => $count,
    );
    } else {
    $data[] = array(
    ‘label’ => $this->_renderRangeLabel($fromPrice, $toPrice),
    ‘value’ => $fromPrice . ‘-‘ . $toPrice,
    ‘count’ => $count,
    );
    }
    }
    }

    return $data;
    }

    [/code]

    Hope this help someone,

    saludos

    • Rick July 5, 2012 at 5:20 pm #

      Awesome, thanks for sharing.

      One thing, though… Where are the price ranges?

      It looks like it gets them from the DataBase, right?

      [code]
      $range = $this->getPriceRange();
      [/code]

  6. eduardo July 5, 2012 at 5:37 pm #

    Hi,

    the code i added it is just to group the products that are more than a fix value thats all.

    The ranges come from the admin. Magento (at least 1.7) gives you the posibility to add fix ranges or avarages ragens or even category ranges from the admin.

    My problem was that what my customer wanted was not to show prices of more than 20000.

  7. aurelien November 9, 2012 at 1:15 pm #

    hello
    I made my own solution months ago, just after posting here
    just posted it on GitHub: https://github.com/DiaFR/MagentoCustomizePriceFilter

  8. nikhil July 8, 2014 at 1:07 pm #

    Thanks

Leave a Reply

Add <code> Some Code </code> by using this tags.