42 \
Magento\Framework\
App\Rss\UrlBuilderInterface $rssUrlBuilder,
45 $this->storeManager = $context->getStoreManager();
48 $this->rssUrlBuilder = $rssUrlBuilder;
49 parent::__construct($context,
$data);
67 $storeModel = $this->storeManager->getStore(
$storeId);
70 $url = $this->_urlBuilder->getUrl(
'');
71 $newUrl = $this->rssUrlBuilder->getUrl([
72 'type' =>
'discounts',
74 'cid' => $customerGroupId,
76 $title =
__(
'%1 - Discounts and Coupons', $storeModel->getFrontendName());
77 $lang = $this->_scopeConfig->getValue(
78 'general/locale/code',
79 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
92 foreach ($this->rssModel->getDiscountCollection(
$websiteId, $customerGroupId) as
$rule) {
93 $toDate =
$rule->getToDate()
94 ?
'<br/>Discount End Date: ' . $this->
formatDate(
$rule->getToDate(), \IntlDateFormatter::MEDIUM)
99 '<table><tr><td style="text-decoration:none;">%s<br/>Discount Start Date: %s %s %s</td></tr></table>',
100 $rule->getDescription(),
119 $customerGroupId = (int) $this->
getRequest()->getParam(
'cid');
120 if ($customerGroupId ==
null) {
123 return $customerGroupId;
133 $storeId = $this->storeManager->getStore()->getId();
151 return $this->_scopeConfig->isSetFlag(
152 'rss/catalog/discounts',
153 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
164 $url = $this->rssUrlBuilder->getUrl([
165 'type' =>
'discounts',
169 $data = [
'label' =>
__(
'Coupons/Discounts'),
'link' =>
$url];
formatDate( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)