1

I am trying to get final price for price slider but it is showing me wrong price. See below images, Price should be 4000/- for right slider but it is showing me 2000.

Input Price-- enter image description here

Output Price-- enter image description here

Any Help Appreciated.

Code Where I get Maximum Price-

public function getCurrMaxPrice(){
    if($this->_currMaxPrice > 0)
    {
        $max = $this->_currMaxPrice;
    } else
    {
     $max = $this->_maxPrice;
    }

 $max;
    return $max;
}
13
  • it will calculate after the option is selected it is showing price starting from. not the final price check on cart page what final price of this product.. Commented Feb 9, 2016 at 11:31
  • No I tried code to get final price and it is still showing wrong price. Commented Feb 9, 2016 at 11:33
  • this is the base price of this product? Commented Feb 9, 2016 at 11:37
  • See I have just changed both images Commented Feb 9, 2016 at 11:49
  • yes, 2000 is the base price of the product Commented Feb 9, 2016 at 11:49

2 Answers 2

1

simple add this function in your price model

public function getPrices()
    {  
          $collection = $this->getLayer()->getProductCollection();

         $data[]=array('from' =>$collection->getMinPrice(),
            'to' =>$collection->getMaxPrice());
         return $data;
    }

in your price block

get them like that

public function getPrices()
{                          
     return Mage::getModel($this->_filterModelName)->getPrices();
}

this will give maximum and minimum price for recent collection

this is model core class

Mage/Catalog/Model/Layer/Filter/Price.php

core block price

Mage/Catalog/Block/Layer/Filter/Price.php

Don't change in core files if you want to change them copy in app/code/local

1
  • could you give me path? Commented Feb 9, 2016 at 12:46
0

It will be 2000 because the item listed has the maximum amount of 2000. Include all 3 products to the same category. Land on the category page. You will see 4000 as max price in slider. Price slider gets maximum priced item. So in your case it is 2000

5
  • Ok, I have just changed 2nd product price to 3000/- and now slider showing me 0 - 3000. But not 4000 why? Commented Feb 9, 2016 at 11:39
  • First of all change the visibility of all products to Catalog and Search Commented Feb 9, 2016 at 11:43
  • If the product with amount 4000 is listed there on the page,then it will show you the max price to 4000. Otherwise it will not. Commented Feb 9, 2016 at 11:44
  • I have just changed the images 2000/- is the base price of the product and 4000 is the max price the why I am not getting this 4000/- why only 3000/-? Commented Feb 9, 2016 at 11:50
  • By setting visibility to Catalog and Search still it is not showing correct price. Commented Feb 9, 2016 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.