Skip to content

Commit c3f33c3

Browse files
committed
Merge branch 'try/dependabot-updates' into feature/cc-257-dependebot
2 parents e3ce85d + e4f142e commit c3f33c3

File tree

3 files changed

+60
-7
lines changed

3 files changed

+60
-7
lines changed

src/Plugin.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,24 @@ public function do_deactivation_process() {
300300

301301
$this->clear_abandoned_checkouts_expiration_check();
302302

303-
if ( ! get_option( ConnectionStatus::CC_CONNECTION_ESTABLISHED_KEY ) ) {
304-
return;
305-
}
306-
303+
delete_option( CheckoutsTable::DB_VERSION_OPTION_NAME );
304+
delete_option( ConnectionStatus::CC_CONNECTION_USER_ID );
305+
delete_option( ConnectionStatus::CC_FIRST_CONNECTION );
307306
delete_option( ConnectionStatus::CC_CONNECTION_ESTABLISHED_KEY );
307+
308+
309+
// WooCommerce Options
310+
delete_option( 'cc_woo_store_information_first_name' );
311+
delete_option( 'cc_woo_store_information_last_name' );
312+
delete_option( 'cc_woo_store_information_phone_number' );
313+
delete_option( 'cc_woo_store_information_store_name' );
314+
delete_option( 'cc_woo_store_information_currency' );
315+
delete_option( 'cc_woo_store_information_currency' );
316+
delete_option( 'cc_woo_store_information_contact_email');
317+
delete_option( 'cc_woo_store_information_alt_login_url' );
318+
delete_option( 'constant_contact_for_woo_has_setup' );
319+
delete_option( 'cc_woo_customer_data_allow_import' );
320+
308321
}
309322

310323
/**

src/View/Admin/WooTab.php

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 );

src/View/Checkout/NewsletterPreferenceCheckbox.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function __construct() {
6161
* @since 2019-03-13
6262
*/
6363
public function register_hooks() {
64-
add_action( 'woocommerce_after_checkout_billing_form', [ $this, 'add_field_to_billing_form' ] );
64+
65+
$checkbox_location = get_option( 'cc_woo_store_information_checkbox_location', 'woocommerce_after_checkout_billing_form' );
66+
add_action( $checkbox_location, [ $this, 'add_field_to_billing_form' ] );
6567
add_action( 'woocommerce_checkout_update_user_meta', [ $this, 'save_user_preference' ] );
6668
add_action( 'woocommerce_created_customer', [ $this, 'save_user_preference' ] );
6769
add_action( 'woocommerce_checkout_create_order', [ $this, 'save_user_preference_to_order' ] );

0 commit comments

Comments
 (0)