9
9
10
10
/**
11
11
* Class NotifyStock
12
+ *
12
13
* @package Magento\Catalog\Block\Adminhtml\Rss
13
14
*/
14
15
class NotifyStock extends \Magento \Backend \Block \AbstractBlock implements DataProviderInterface
@@ -41,7 +42,7 @@ public function __construct(
41
42
}
42
43
43
44
/**
44
- * @return void
45
+ * @inheritdoc
45
46
*/
46
47
protected function _construct ()
47
48
{
@@ -50,12 +51,12 @@ protected function _construct()
50
51
}
51
52
52
53
/**
53
- * { @inheritdoc}
54
+ * @inheritdoc
54
55
*/
55
56
public function getRssData ()
56
57
{
57
- $ newUrl = $ this ->rssUrlBuilder ->getUrl (['_secure ' => true , '_nosecret ' => true , 'type ' => 'notifystock ' ]);
58
- $ title = __ ('Low Stock Products ' );
58
+ $ newUrl = $ this ->rssUrlBuilder ->getUrl (['_secure ' => true , '_nosecret ' => true , 'type ' => 'notifystock ' ]);
59
+ $ title = __ ('Low Stock Products ' )-> render () ;
59
60
$ data = ['title ' => $ title , 'description ' => $ title , 'link ' => $ newUrl , 'charset ' => 'UTF-8 ' ];
60
61
61
62
foreach ($ this ->rssModel ->getProductsCollection () as $ item ) {
@@ -65,39 +66,39 @@ public function getRssData()
65
66
['id ' => $ item ->getId (), '_secure ' => true , '_nosecret ' => true ]
66
67
);
67
68
$ qty = 1 * $ item ->getQty ();
68
- $ description = __ ('%1 has reached a quantity of %2. ' , $ item ->getName (), $ qty );
69
+ $ description = __ ('%1 has reached a quantity of %2. ' , $ item ->getName (), $ qty )-> render () ;
69
70
$ data ['entries ' ][] = ['title ' => $ item ->getName (), 'link ' => $ url , 'description ' => $ description ];
70
71
}
71
72
72
73
return $ data ;
73
74
}
74
75
75
76
/**
76
- * { @inheritdoc}
77
+ * @inheritdoc
77
78
*/
78
79
public function getCacheLifetime ()
79
80
{
80
81
return 600 ;
81
82
}
82
83
83
84
/**
84
- * { @inheritdoc}
85
+ * @inheritdoc
85
86
*/
86
87
public function isAllowed ()
87
88
{
88
89
return true ;
89
90
}
90
91
91
92
/**
92
- * { @inheritdoc}
93
+ * @inheritdoc
93
94
*/
94
95
public function getFeeds ()
95
96
{
96
97
return [];
97
98
}
98
99
99
100
/**
100
- * { @inheritdoc}
101
+ * @inheritdoc
101
102
*/
102
103
public function isAuthRequired ()
103
104
{
0 commit comments