price range not display
gobigops opened this issue · 1 comments
gobigops commented
please help me dude
$priceArr = $filter->getResource()->loadPrices(10000000000); // function stop in this line
<?php
/**
* Catalog layer filter renderer
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Netmeds\Layernav\Block;
use Magento\Catalog\Model\Layer\Filter\FilterInterface;
class FilterRenderer extends \Magento\LayeredNavigation\Block\Navigation\FilterRenderer
{
/**
* @param FilterInterface $filter
* @return string
*/
public function render(FilterInterface $filter)
{
$this->assign('filterItems', $filter->getItems());
$this->assign('filter' , $filter);
$html = $this->_toHtml();
$this->assign('filterItems', []);
return $html;
}
public function getPriceRange($filter){
$Filterprice = array('min' => 0 , 'max'=>1000);
if($filter instanceof \Magento\CatalogSearch\Model\Layer\Filter\Price){
$priceArr = $filter->getResource()->loadPrices(10000000000); // function stop in this line
$Filterprice['min'] = reset($priceArr);
$Filterprice['max'] = end($priceArr);
}
return $Filterprice;
}
public function getFilterUrl($filter){
$query = ['price'=> ''];
return $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true, '_query' => $query]);
}
}
sohelkhan4666 commented
Comment this if condition
if($filter instanceof Magento\CatalogSearch\Model\Layer\Filter\Price)
in magento2-price-slider/Block/FilterRenderer.php