diff --git a/Helper/Configuration/NoticeHelper.php b/Helper/Configuration/NoticeHelper.php
index aa154aa6a..ea9f075c9 100644
--- a/Helper/Configuration/NoticeHelper.php
+++ b/Helper/Configuration/NoticeHelper.php
@@ -44,7 +44,7 @@ class NoticeHelper extends \Magento\Framework\App\Helper\AbstractHelper
'getClickAnalyticsNotice',
'getPersonalizationNotice',
'getRecommendNotice',
- 'getCookieConfigurationNotice',
+ 'getCookieConfigurationNotice',
];
/** @var array[] */
@@ -157,23 +157,33 @@ protected function getMsiNotice()
];
}
- protected function getVersionNotice()
+ protected function getVersionNotice(): void
{
+ $currentVersion = $this->configHelper->getExtensionVersion();
$newVersion = $this->getNewVersionNotification();
- if ($newVersion === null) {
+ if (!$currentVersion && !$newVersion) {
return;
}
- $noticeTitle = 'Algolia Extension update';
- $noticeContent = 'You are using old version of Algolia extension. Latest version of the extension is v ' . $newVersion['version'] . '
+ $notice = [
+ 'selector' => '.entry-edit',
+ 'method' => 'before'
+ ];
+
+ if ($newVersion) {
+ $noticeTitle = 'Algolia extension update';
+ $noticeContent = 'You are using an old version of Algolia extension. Latest version of the extension is v ' . $newVersion['version'] . '
It is highly recommended to update your version to avoid any unexpected issues and to get new features.
See details on our Github repository.';
+ $notice['message'] = $this->formatNotice($noticeTitle, $noticeContent);
+ }
+ else {
+ $noticeTitle = 'Algolia extension version';
+ $noticeContent = "You are using version $currentVersion of the Algolia Magento integration.";
+ $notice['message'] = $this->formatNotice($noticeTitle, $noticeContent, 'icon-bulb');
+ }
- $this->notices[] = [
- 'selector' => '.entry-edit',
- 'method' => 'before',
- 'message' => $this->formatNotice($noticeTitle, $noticeContent),
- ];
+ $this->notices[] = $notice;
}
protected function getClickAnalyticsNotice()
@@ -208,7 +218,7 @@ protected function getClickAnalyticsNotice()
'message' => $noticeContent,
];
}
-
+
protected function getCookieConfigurationNotice()
{
$noticeContent = '';
diff --git a/view/adminhtml/web/js/config.js b/view/adminhtml/web/js/config.js
index 11ff9d794..d9c7af323 100644
--- a/view/adminhtml/web/js/config.js
+++ b/view/adminhtml/web/js/config.js
@@ -38,7 +38,7 @@ require(
pageWarning += '';
var pageWarningSynonyms = '
Configurations related to Synonyms have been deprecated from the Magento dashboard. We advise you to configure synonyms from the Algolia dashboard.
'; + pageWarningSynonyms += 'Configurations related to Synonyms have been removed from the Magento dashboard. We advise you to configure synonyms from the Algolia dashboard.
'; pageWarningSynonyms += '