_getListItem(); $this->_prepareCategories($item); if (!empty($item['list'])) { $this->_doc->addScript('js/royalslider/jquery.royalslider.js'); $this->_doc->addScript('js/royalslider/jquery.rs.auto-height.js'); $this->_doc->addScript('js/royalslider/jquery.rs.autoplay.js'); $this->_doc->addCriticalStylesheet('css/thirdpart/royalslider.css'); $this->_doc->addCriticalStylesheet('css/thirdpart/royalslider-default.css'); $this->_doc->addScript('js/app/ECommerce/product/featured-block.js'); $this->_doc->addInitObject('App_Product_FeaturedBlock'); $item['productBaseUrl'] = static::getViewUrl(); return $item; } return null; } protected function _prepareCategories(array &$item) { foreach ($item['list'] as $index => $row) { $row['categories'] = explode(',', $row['categories']); $visible = false; foreach ($row['categories'] as $categoryId) { if ($this->_isCategoryVisible($categoryId)) { $visible = true; break; } } if (!$visible) { unset($item['list'][$index]); } } return $this; } }