protected function _initItems()
{
parent::_initItems();
foreach ($this->_items as $item) {
$applyValue = $item->getLabel();
if ($item->getValue() == \Magento\Eav\Model\Entity\Attribute\Source\Boolean::VALUE_YES) {
if (is_numeric($item->getLabel())) {
$label = $this->getAttributeModel()->getSource()->getOptionText((int) $item->getLabel());
$item->setLabel((string) $label);
}
}
if (($valuePos = array_search($applyValue, $this->currentFilterValue)) !== false) {
$item->setIsSelected(true);
$applyValue = $this->currentFilterValue;
unset($applyValue[$valuePos]);
} else {
$applyValue = array_merge($this->currentFilterValue, [$applyValue]);
}
$item->setApplyFilterValue(array_values($applyValue));
}
return $this;
}