Skip to content

Commit a3ebfa1

Browse files
authored
Merge pull request #127 from WebDevStudios/feature/cc-243-update-url
Added support for dynamic login url.
2 parents 8f4724f + ba69714 commit a3ebfa1

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/View/Admin/WooTab.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ class WooTab extends WC_Settings_Page implements Hookable {
7676
*/
7777
const EMAIL_FIELD = 'cc_woo_store_information_contact_email';
7878

79+
/**
80+
* Alternative Login URL.
81+
*
82+
* @since 2021-06-02
83+
*/
84+
const ALT_LOGIN_URL = 'cc_woo_store_information_alt_login_url';
85+
7986
/**
8087
* Settings section ID.
8188
*
@@ -365,7 +372,13 @@ private function get_connection_established_options() {
365372
* @since 2019-03-21
366373
*/
367374
public function render_cta_button() {
368-
$url = 'https://login.constantcontact.com/login/?goto=https%3A%2F%2Fapp.constantcontact.com%2Fpages%2Fecomm%2Fdashboard%23woocommerce';
375+
376+
$url = get_option( self::ALT_LOGIN_URL, '' );
377+
378+
if ( '' === $url ) {
379+
$url = 'https://login.constantcontact.com/login/?goto=https%3A%2F%2Fapp.constantcontact.com%2Fpages%2Fecomm%2Fdashboard%23woocommerce';
380+
}
381+
369382
?>
370383
<a
371384
class="button button-primary"
@@ -474,6 +487,12 @@ private function get_store_information_settings() {
474487
'true' => esc_html__( 'Yes - check this box by default', 'cc-woo' ),
475488
],
476489
],
490+
[
491+
'title' => esc_html__( 'Alternative Login Url', 'cc-woo' ),
492+
'desc' => esc_html__( 'Only use if directed to by Pro Support.', 'cc-woo' ),
493+
'id' => self::ALT_LOGIN_URL,
494+
'type' => 'text',
495+
],
477496
[
478497
'type' => 'sectionend',
479498
'id' => 'cc_woo_store_information_settings',

0 commit comments

Comments
 (0)