- public function getRssData()
- {
- $newUrl = $this->rssUrlBuilder->getUrl(['_secure' => true, '_nosecret' => true, 'type' => 'notifystock']);
- $title = __('Low Stock Products');
- $data = ['title' => $title, 'description' => $title, 'link' => $newUrl, 'charset' => 'UTF-8'];
-
- foreach ($this->rssModel->getProductsCollection() as $item) {
- /* @var $item \Magento\Catalog\Model\Product */
- $url = $this->getUrl(
- 'catalog/product/edit',
- ['id' => $item->getId(), '_secure' => true, '_nosecret' => true]
- );
- $qty = 1 * $item->getQty();
- $description = __('%1 has reached a quantity of %2.', $item->getName(), $qty);
- $data['entries'][] = ['title' => $item->getName(), 'link' => $url, 'description' => $description];
- }
-
- return $data;
- }