diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php
index 29b9141..8ccc903 100755
--- a/Block/Adminhtml/System/Config/Form/Info.php
+++ b/Block/Adminhtml/System/Config/Form/Info.php
@@ -88,12 +88,13 @@ public function render(AbstractElement $element)
break;
}
}
-
+ $moduleReviewUrl = false;
if ($latestVersion = $moduleInfo->getVersion()) {
$fullModuleTitle = $moduleInfo->getProductName();
$moduleUrl = $moduleInfo->getProductUrl();
$moduleImage = $moduleInfo->getProductImage();
+ $moduleReviewUrl = $moduleInfo->getReviewUrl();
$newVersionAvailable = version_compare($latestVersion, $currentVersion) > 0;
$moduleTitle = str_replace(['Magento 2', 'Magento'], ['', ''], (string)$fullModuleTitle);
@@ -198,61 +199,83 @@ public function render(AbstractElement $element)
User Guide
- ' : '') . '
+ ' : '') . (($canUpgradeToMaxPlan || $newVersionAvailable) && $moduleReviewUrl ?'
+
+
+
+
+ Leave a Review (Get $10)
+
+
+ ' : ' ') . '
';
- if ($canUpgradeToMaxPlan) {
- $escapedUrl = $this->escapeHtml($moduleUrl . '/pricing' . $utmParam);
- $html .= '
';
- }
+ if ($canUpgradeToMaxPlan) {
+ $escapedUrl = $this->escapeHtml($moduleUrl . '/pricing' . $utmParam);
+ $html .= '
';
+ }
- if ($newVersionAvailable) {
- $partUpdateProductUrl = 'fan.com/downloadable/customer/products';
- $html .= '
';
- }
- $html .= '
- ';
- if ($newVersionAvailable) {
- $html .= '
- Version v' . $this->escapeHtml($latestVersion) . ' is available
-
';
- }
+ if ($newVersionAvailable) {
+ $partUpdateProductUrl = 'fan.com/downloadable/customer/products';
+ $html .= '
';
+ }
+ $html .= '
+ ';
+ if ($newVersionAvailable) {
+ $html .= '
+ Version v' . $this->escapeHtml($latestVersion) . ' is available
+
';
+ }
+ if (!$canUpgradeToMaxPlan && !$newVersionAvailable && $moduleReviewUrl) {
+ $html .= '
+
+
';
+ }
- $fontPath = "Magefan_Community::fonts/variable/LDIoaomQNQcsA88c7O9yZ4KMCoOg4Ko20yw.woff2";
- $html .= '
+ $fontPath = "Magefan_Community::fonts/variable/LDIoaomQNQcsA88c7O9yZ4KMCoOg4Ko20yw.woff2";
+ $html .= '
+
+
';
return $html;
}
+ /**
+ * Append UTM parameters to a URL, inserting them before any # fragment.
+ *
+ * @param string $url
+ * @param string $utmParams
+ * @return string
+ */
+ protected function appendUtmToUrl(string $url, string $utmParams): string
+ {
+ if (strpos($url, '#') !== false) {
+ [$baseUrl, $fragment] = explode('#', $url, 2);
+ return $baseUrl . $utmParams . '#' . $fragment;
+ }
+ return $url . $utmParams;
+ }
+
/**
* Return extension url
*