← All changes
|
app/Modules/PaymentMethods/PromoGateways/Addons/AddonGatewaySettings.php
+4
-2
1.4.2
→
1.6.5
View file →
| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons; |
| 4 | 4 | |
| 5 | +use FluentCart\App\Helpers\Helper; | |
| 5 | 6 | use FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings; |
| 6 | 7 | use FluentCart\App\Services\PluginInstaller\PaymentAddonManager; |
| 7 | 8 | use FluentCart\Framework\Support\Arr; |
| 8 | 9 | |
| @@ -160,8 +161,9 @@ | ||
| 160 | 161 | protected function renderInstallButton($addonSlug, $addonFile, $addonSource, $repoLink, $mode = 'light') |
| 161 | 162 | { |
| 162 | 163 | $styles = $this->getAddonNoticeStyles()[$mode]; |
| 163 | 164 | $downloadIcon = 'M13 10H18L12 16L6 10H11V3H13V10M4 19H20V12H22V20C22 20.5304 21.7893 21.0391 21.4142 21.4142C21.0391 21.7893 20.5304 22 20 22H4C3.46957 22 2.96086 21.7893 2.58579 21.4142C2.21071 21.0391 2 20.5304 2 20V12H4V19Z'; |
| 165 | + $buttonLabel = defined('FLUENTCART_PRO_PLUGIN_VERSION') ? __('Install & Activate', 'fluent-cart') : __('Download', 'fluent-cart'); | |
| 164 | 166 | |
| 165 | 167 | return '<button type="button" class="fct-btn fct-btn-primary fct-install-addon-btn" |
| 166 | 168 | style="display: inline-flex; align-items: center; background: ' . $styles['button_primary_bg'] . '; color: ' . $styles['button_primary_text'] . '; padding: 10px 24px; border-radius: 6px; border: none; font-weight: 500; font-size: 14px; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);" |
| 167 | 169 | data-addon-slug="' . esc_attr($addonSlug) . '" |
| @@ -169,9 +171,9 @@ | ||
| 169 | 171 | data-repo-link="' . esc_attr($repoLink) . '" |
| 170 | 172 | data-source-type="' . esc_attr(Arr::get($addonSource, 'type', 'github')) . '" |
| 171 | 173 | data-source-link="' . esc_attr($addonSource['link'] ?? '') . '">' |
| 172 | 174 | . $this->renderIcon($downloadIcon, 'width: 16px; height: 16px; margin-right: 6px; fill: ' . $styles['button_primary_text'] . ';') |
| 173 | - . __('Install & Activate', 'fluent-cart') | |
| 175 | + . $buttonLabel | |
| 174 | 176 | . '</button>'; |
| 175 | 177 | } |
| 176 | 178 | |
| 177 | 179 | |
| @@ -246,9 +248,9 @@ | ||
| 246 | 248 | $proRequired = !empty($config['pro_required']) && !defined('FLUENTCART_PRO_PLUGIN_VERSION'); |
| 247 | 249 | if ($proRequired) { |
| 248 | 250 | $statusMessage = __('Requires Pro', 'fluent-cart'); |
| 249 | 251 | $statusColor = $styles['status_warning']; |
| 250 | - $upgradeUrl = esc_url($config['repo_link'] ?? 'https://fluentcart.com/pricing/'); | |
| 252 | + $upgradeUrl = esc_url($config['repo_link'] ?? Helper::getUpgradeUrl('feature_lock_gateway_' . $this->gatewaySlug)); | |
| 251 | 253 | $actionButton = '<a href="' . $upgradeUrl . '" target="_blank" rel="noopener noreferrer" ' |
| 252 | 254 | . 'style="display: inline-flex; align-items: center; background: ' . $styles['button_primary_bg'] . '; color: ' . $styles['button_primary_text'] . '; padding: 10px 24px; border-radius: 6px; font-weight: 500; font-size: 14px; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">' |
| 253 | 255 | . $this->renderIcon('M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 4l5 2.18V11c0 3.5-2.33 6.79-5 7.93-2.67-1.14-5-4.43-5-7.93V7.18L12 5z', 'width: 16px; height: 16px; margin-right: 6px; fill: ' . $styles['button_primary_text'] . ';') |
| 254 | 256 | . __('Upgrade to Pro', 'fluent-cart') |