Skip to content
Snippets Groups Projects
Commit 6af90b68 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

feature(popup): changed content

parent 51d68ba7
No related branches found
No related tags found
1 merge request!9feature(popup): changed content
Pipeline #11759 passed with stages
in 3 minutes and 52 seconds
## [1.1.4] - 2021-08-18
### Changed
- popup content
## [1.1.3] - 2021-08-16
### Added
- popup css
......
......@@ -105,7 +105,7 @@ export default class ActivationReminder extends React.Component {
</Row>
<Row className={"activation"}>
<Col>
Already have a license key? <a target="_top" href={this.props.subscriptions_url}>Activate it!</a>
Already have a license key? <a target="_blank" href={this.props.how_to_activate_link}>Learn how to activate it in your store →</a>
</Col>
</Row>
</Container>
......
......@@ -14,6 +14,7 @@ document.addEventListener( 'DOMContentLoaded', function () {
subscriptions_url={element.getAttribute( 'data-subscriptions_url' )}
buy_plugin_url={element.getAttribute( 'data-buy_plugin_url' )}
read_more_url={element.getAttribute( 'data-read_more_url' )}
how_to_activate_link={element.getAttribute( 'data-how_to_activate_link' )}
/>, element );
}
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -115,6 +115,7 @@ class PrepareActivationReminderCommand extends BaseCommand
$file_contents = str_replace( 'script-version', rand(1, 1000), $file_contents );
$file_contents = str_replace( 'logo-url', $settings->get_logo_url(), $file_contents );
$file_contents = str_replace( 'buy-plugin-url', $settings->get_buy_plugin_url(), $file_contents );
$file_contents = str_replace( 'how-to-activate-link', $settings->get_how_to_activate_link(), $file_contents );
$file_contents = str_replace( 'new Reminder();', 'new ' . $short_classname . '();', $file_contents );
file_put_contents( $class_file, $file_contents );
}
......
......@@ -9,6 +9,7 @@ class Settings {
const LOGO_URL = 'logo-url';
const BUY_PLUGIN_URL = 'buy-plugin-url';
const ACTIVATION_REMINDER = 'activation-reminder';
const HOW_TO_ACTIVATE_LINK = 'how-to-activate-link';
/**
* @var string
......@@ -30,17 +31,24 @@ class Settings {
*/
private $buy_plugin_url;
/**
* @var string
*/
private $how_to_activate_link;
/**
* @param string $plugin_title
* @param string $plugin_dir
* @param string $logo_url
* @param string $buy_plugin_url
* @param string $how_to_activate_link
*/
public function __construct( string $plugin_title, string $plugin_dir, string $logo_url, string $buy_plugin_url ) {
$this->plugin_title = $plugin_title;
$this->plugin_dir = $plugin_dir;
$this->logo_url = $logo_url;
$this->buy_plugin_url = $buy_plugin_url;
public function __construct( string $plugin_title, string $plugin_dir, string $logo_url, string $buy_plugin_url, string $how_to_activate_link ) {
$this->plugin_title = $plugin_title;
$this->plugin_dir = $plugin_dir;
$this->logo_url = $logo_url;
$this->buy_plugin_url = $buy_plugin_url;
$this->how_to_activate_link = $how_to_activate_link;
}
/**
......@@ -71,6 +79,13 @@ class Settings {
return $this->buy_plugin_url;
}
/**
* @return string
*/
public function get_how_to_activate_link(): string {
return $this->how_to_activate_link;
}
/**
*
*/
......@@ -86,6 +101,7 @@ class Settings {
self::PLUGIN_DIR,
self::LOGO_URL,
self::BUY_PLUGIN_URL,
self::HOW_TO_ACTIVATE_LINK,
];
foreach ( $settings_fields as $field ) {
if ( ! isset( $settings[ self::ACTIVATION_REMINDER ][ $field ] ) ) {
......@@ -106,7 +122,8 @@ class Settings {
$settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_TITLE ],
$settings[ self::ACTIVATION_REMINDER ][ self::PLUGIN_DIR ],
$settings[ self::ACTIVATION_REMINDER ][ self::LOGO_URL ],
$settings[ self::ACTIVATION_REMINDER ][ self::BUY_PLUGIN_URL ]
$settings[ self::ACTIVATION_REMINDER ][ self::BUY_PLUGIN_URL ],
$settings[ self::ACTIVATION_REMINDER ][ self::HOW_TO_ACTIVATE_LINK ],
);
}
......
......@@ -36,7 +36,7 @@ class Reminder {
$cookie_name = md5( site_url() . 'plugin-dir' );
$subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' );
$read_more_url = 'https://flexibleshipping.com';
echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\"></span>";
echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\" data-how_to_activate_link=\"how-to-activate-link\"></span>";
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment