80 $this->storeManager = $context->getStoreManager();
82 parent::__construct($context,
$data);
91 'rss_catalog_category_' 94 . $this->customerSession->getId()
108 'title' =>
'Category Not Found',
109 'description' =>
'Category Not Found',
110 'link' => $this->
getUrl(
''),
118 $data = [
'title' =>
$title,
'description' =>
$title,
'link' => $newUrl,
'charset' =>
'UTF-8'];
121 foreach ($this->rssModel->getProductCollection(
$category, $this->getStoreId()) as
$product) {
123 $product->setAllowedPriceInRss(
true);
125 $this->_eventManager->dispatch(
'rss_catalog_category_xml_callback', [
'product' =>
$product]);
133 <td><a href="%s"><img src="%s" border="0" align="left" height="75" width="75"></a></td> 134 <td style="text-decoration:none;">%s %s</td> 141 $this->imageHelper->init(
$product,
'rss_thumbnail')->getUrl(),
146 $data[
'entries'][] = [
148 'link' =>
$product->getProductUrl(),
161 protected function renderPriceHtml(\
Magento\Catalog\Model\Product
$product)
164 $priceRender = $this->
getLayout()->getBlock(
'product.price.render.default');
166 $priceRender = $this->
getLayout()->createBlock(
167 \
Magento\Framework\Pricing\Render::class,
168 'product.price.render.default',
169 [
'data' => [
'price_render_handle' =>
'catalog_product_prices']]
175 $price = $priceRender->render(
176 \
Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
179 'display_minimal_price' =>
true,
180 'use_link_for_as_low_as' =>
true,
181 'zone' => \
Magento\Framework\Pricing\Render::ZONE_ITEM_LIST
196 $storeId = $this->storeManager->getStore()->getId();
214 return $this->_scopeConfig->isSetFlag(
215 'rss/catalog/category',
228 $category = $this->categoryFactory->create();
229 $treeModel =
$category->getTreeModel()->loadNode($this->storeManager->getStore()->getRootCategoryId());
230 $nodes = $treeModel->loadChildren()->getChildren();
233 foreach ($nodes as $node) {
234 $nodeIds[] = $node->getId();
240 ->addAttributeToSelect(
'url_key')
241 ->addAttributeToSelect(
'name')
242 ->addAttributeToSelect(
'is_anchor')
243 ->addAttributeToFilter(
'is_active', 1)
244 ->addAttributeToSort(
'name')
251 'link' => $this->rssUrlBuilder->getUrl([
'type' =>
'category',
'cid' =>
$category->getId()]),
254 $result = [
'group' =>
'Categories',
'feeds' => $feeds];
getUrl($route='', $params=[])