Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

price range not display #12

Open
gobigops opened this issue Mar 29, 2017 · 1 comment
Open

price range not display #12

gobigops opened this issue Mar 29, 2017 · 1 comment

Comments

@gobigops
Copy link

gobigops commented Mar 29, 2017

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
Copy link

Comment this if condition
if($filter instanceof Magento\CatalogSearch\Model\Layer\Filter\Price)
in magento2-price-slider/Block/FilterRenderer.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants