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;
}
  • 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.. – Qaisar Satti Feb 9 '16 at 11:31
  • No I tried code to get final price and it is still showing wrong price. – Anup Chaudhary Feb 9 '16 at 11:33
  • this is the base price of this product? – Qaisar Satti Feb 9 '16 at 11:37
  • See I have just changed both images – Anup Chaudhary Feb 9 '16 at 11:49
  • yes, 2000 is the base price of the product – Anup Chaudhary Feb 9 '16 at 11:49
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

  • Ok, I have just changed 2nd product price to 3000/- and now slider showing me 0 - 3000. But not 4000 why? – Anup Chaudhary Feb 9 '16 at 11:39
  • First of all change the visibility of all products to Catalog and Search – Ahsan Horani Feb 9 '16 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. – Ahsan Horani Feb 9 '16 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/-? – Anup Chaudhary Feb 9 '16 at 11:50
  • By setting visibility to Catalog and Search still it is not showing correct price. – Anup Chaudhary Feb 9 '16 at 11:53
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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