File tree Expand file tree Collapse file tree 3 files changed +37
-14
lines changed
Expand file tree Collapse file tree 3 files changed +37
-14
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,27 @@ With Constant Contact you can:
41413. Pre-filtered segmented lists.
42424. Syncing status for contacts.
4343
44+ == Frequently Asked Questions ==
45+
46+ #### Overall WooCommerce and Constant Contact Guide
47+ [https://knowledgebase.constantcontact.com/guides/KnowledgeBase/34383-Guide-Constant-Contact-and-WooCommerce?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/guides/KnowledgeBase/34383-Guide-Constant-Contact-and-WooCommerce?q=woocommerce*&lang=en_US)
48+
49+ #### How to Sync Contacts between WooCommerce and Constant Contact
50+ [https://knowledgebase.constantcontact.com/articles/KnowledgeBase/33143-Sync-Contacts-Between-Your-WooCommerce-Store-and-Constant-Contact?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/33143-Sync-Contacts-Between-Your-WooCommerce-Store-and-Constant-Contact?q=woocommerce*&lang=en_US)
51+
52+ #### How to use the Product Block to insert WooCommerce Products to an Email
53+ [https://knowledgebase.constantcontact.com/articles/KnowledgeBase/33144-Add-Products-from-a-WooCommerce-Store-to-an-Email?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/33144-Add-Products-from-a-WooCommerce-Store-to-an-Email?q=woocommerce*&lang=en_US)
54+
55+ #### How to Create an Automated Abandoned Cart Reminder Email for WooCommerce
56+ Customers
57+ [https://knowledgebase.constantcontact.com/articles/KnowledgeBase/36890-Create-an-Automated-Abandoned-Cart-Reminder-Email-for-WooCommerce-Customers?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/36890-Create-an-Automated-Abandoned-Cart-Reminder-Email-for-WooCommerce-Customers?q=woocommerce*&lang=en_US)
58+
59+ #### VIDEO Tutorial: Create an Automated WooCommerce Abandoned Cart Email
60+ [https://knowledgebase.constantcontact.com/tutorials/KnowledgeBase/37409-Tutorial-Create-an-Automated-WooCommerce-Abandoned-Cart-Email?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/tutorials/KnowledgeBase/37409-Tutorial-Create-an-Automated-WooCommerce-Abandoned-Cart-Email?q=woocommerce*&lang=en_US)
61+
62+ #### View WooCommerce Sales and Recovered Revenue Reporting
63+ [https://knowledgebase.constantcontact.com/articles/KnowledgeBase/36892-View-Recovered-Revenue-from-the-WooCommerce-Abandoned-Cart-Reminder-Email?q=woocommerce*&lang=en_US](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/36892-View-Recovered-Revenue-from-the-WooCommerce-Abandoned-Cart-Reminder-Email?q=woocommerce*&lang=en_US)
64+
4465== Changelog ==
4566
4667= 1.3.1 =
Original file line number Diff line number Diff line change 1212namespace WebDevStudios \CCForWoo \Settings ;
1313
1414use WebDevStudios \CCForWoo \Utility \Validatable ;
15+ use WC_Validation ;
1516
1617/**
1718 * Class SettingsValidator
@@ -94,21 +95,17 @@ private function has_valid_email() {
9495 /**
9596 * Verify that the phone number is valid.
9697 *
97- * @since 2019-03-08
98+ * @since 2019-03-08
9899 * @author Zach Owen <zach@webdevstudios>
100+ *
101+ * @uses WC_Validation::is_phone()
102+ *
99103 * @return bool
100104 */
101- private function has_valid_phone () {
102- $ phone_number = $ this ->settings ->get_phone_number ();
103-
104- if ( '+ ' === substr ( $ phone_number , 0 , 1 ) ) {
105- $ phone_number = substr ( $ phone_number , 1 );
106- }
107-
108- preg_match ( '/^[\d\-()]/ ' , $ phone_number , $ matches );
109- preg_match ( '/[^\d\-()]/ ' , $ phone_number , $ invalid_matches );
110-
111- return ! empty ( $ matches [0 ] ) && empty ( $ invalid_matches );
105+ private function has_valid_phone (): bool {
106+ return ! empty ( $ this ->settings ->get_phone_number () )
107+ ? WC_Validation::is_phone ( $ this ->settings ->get_phone_number () )
108+ : false ;
112109 }
113110
114111 /**
Original file line number Diff line number Diff line change @@ -711,7 +711,7 @@ private function validate_value( $field ) {
711711 }
712712
713713 /**
714- * Sanitize the phone number to only include digits, -, and (, )
714+ * Sanitize incoming phone number.
715715 *
716716 * @since 2019-03-08
717717 * @author Zach Owen <zach@webdevstudios>
@@ -721,7 +721,7 @@ private function validate_value( $field ) {
721721 * @return string
722722 */
723723 public function sanitize_phone_number ( $ value ) {
724- return is_scalar ( $ value ) ? preg_replace ( ' /[^\d\-()+]+/ ' , '' , $ value ) : '' ;
724+ return wc_sanitize_phone_number ( $ value );
725725 }
726726
727727 /**
@@ -836,6 +836,11 @@ public function display_anti_spam_notice() {
836836 public function save () {
837837 parent ::save ();
838838
839+ // Prevent redirect to customer_data_import screen if we don't meet connection requirements.
840+ if ( ! $ this ->meets_connect_requirements () ) {
841+ return ;
842+ }
843+
839844 if ( $ this ->connection ->is_connected () || $ this ->has_active_settings_section () ) {
840845 return ;
841846 }
You can’t perform that action at this time.
0 commit comments