Smile\ElasticsuiteSwatches\Block\Navigation\Renderer\Swatches\RenderLayered::getOptionViewData PHP Method

getOptionViewData() protected method

{@inheritDoc}
protected getOptionViewData ( Magento\Catalog\Model\Layer\Filter\Item $filterItem, Magento\Eav\Model\Entity\Attribute\Option $swatchOption )
$filterItem Magento\Catalog\Model\Layer\Filter\Item
$swatchOption Magento\Eav\Model\Entity\Attribute\Option
    protected function getOptionViewData(FilterItem $filterItem, Option $swatchOption)
    {
        $customStyle = '';
        $linkToOption = $filterItem->getUrl();
        if ($this->isOptionDisabled($filterItem)) {
            $customStyle = 'disabled';
            $linkToOption = 'javascript:void();';
        }
        if ($filterItem->getIsSelected()) {
            $customStyle = 'selected';
        }
        return ['label' => $swatchOption->getLabel(), 'link' => $linkToOption, 'custom_style' => $customStyle];
    }