@@ -76,6 +76,20 @@ 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+
86+ /**
87+ * Store checkbox location.
88+ *
89+ * @since 2021-07-26
90+ */
91+ const CHECKBOX_LOCATION = 'cc_woo_store_information_checkbox_location ' ;
92+
7993 /**
8094 * Settings section ID.
8195 *
@@ -365,7 +379,13 @@ private function get_connection_established_options() {
365379 * @since 2019-03-21
366380 */
367381 public function render_cta_button () {
368- $ url = 'https://login.constantcontact.com/login/?goto=https%3A%2F%2Fapp.constantcontact.com%2Fpages%2Fecomm%2Fdashboard%23woocommerce ' ;
382+
383+ $ url = get_option ( self ::ALT_LOGIN_URL , '' );
384+
385+ if ( '' === $ url ) {
386+ $ url = 'https://login.constantcontact.com/login/?goto=https%3A%2F%2Fapp.constantcontact.com%2Fpages%2Fecomm%2Fdashboard%23woocommerce ' ;
387+ }
388+
369389 ?>
370390 <a
371391 class="button button-primary"
@@ -474,6 +494,23 @@ private function get_store_information_settings() {
474494 'true ' => esc_html__ ( 'Yes - check this box by default ' , 'cc-woo ' ),
475495 ],
476496 ],
497+ [
498+ 'title ' => esc_html__ ( 'Alternative Login Url ' , 'cc-woo ' ),
499+ 'desc ' => esc_html__ ( 'Only use if directed to by Pro Support. ' , 'cc-woo ' ),
500+ 'id ' => self ::ALT_LOGIN_URL ,
501+ 'type ' => 'text ' ,
502+ ],
503+ [
504+ 'title ' => esc_html__ ( 'Checkbox Filter Location ' , 'cc-woo ' ),
505+ 'desc ' => esc_html__ ( 'Change filter location where checkbox is rendered. ' , 'cc-woo ' ),
506+ 'type ' => 'select ' ,
507+ 'id ' => self ::CHECKBOX_LOCATION ,
508+ 'default ' => 'false ' ,
509+ 'options ' => [
510+ 'woocommerce_after_checkout_billing_form ' => esc_html__ ( 'After checkout billing form ' , 'cc-woo ' ),
511+ 'woocommerce_review_order_before_submit ' => esc_html__ ( 'Before order submit button ' , 'cc-woo ' ),
512+ ],
513+ ],
477514 [
478515 'type ' => 'sectionend ' ,
479516 'id ' => 'cc_woo_store_information_settings ' ,
@@ -643,7 +680,8 @@ private function meets_connect_requirements() {
643680 get_option ( self ::STORE_NAME_FIELD , '' ),
644681 get_option ( self ::CURRENCY_FIELD , '' ),
645682 get_option ( self ::COUNTRY_CODE_FIELD ),
646- get_option ( self ::EMAIL_FIELD )
683+ get_option ( self ::EMAIL_FIELD ),
684+ get_option ( self ::CHECKBOX_LOCATION , 'woocommerce_after_checkout_billing_form ' )
647685 );
648686
649687 $ validator = new SettingsValidator ( $ model );
0 commit comments