示例#1
0
 /**
  * {@inheritDoc}
  */
 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];
 }
 /**
  * @param FilterItem $filterItem
  * @param Option $swatchOption
  * @return array
  */
 protected function getOptionViewData(FilterItem $filterItem, Option $swatchOption)
 {
     $customStyle = '';
     $linkToOption = $this->buildUrl($this->eavAttribute->getAttributeCode(), $filterItem->getValue());
     if ($this->isOptionDisabled($filterItem)) {
         $customStyle = 'disabled';
         $linkToOption = 'javascript:void();';
     }
     return ['label' => $swatchOption->getLabel(), 'link' => $linkToOption, 'custom_style' => $customStyle];
 }