woocommerce-phone-validator icon indicating copy to clipboard operation
woocommerce-phone-validator copied to clipboard

Phone validation error: Internal error πŸ₯Ά

Open Estalhun opened this issue 4 years ago β€’ 11 comments
trafficstars

No error in the debug log in debug mode, no other...anything...

`

WordPress Environment

WC Version: 4.8.0 REST API Version: βœ” 4.8.0 WC Blocks Version: βœ” 3.8.1 Action Scheduler Version: βœ” 3.1.6 WC Admin Version: βœ” 1.7.3 Log Directory Writable: βœ” WP Version: ❌ 5.5.3 - There is a newer version of WordPress available (5.6) WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: – Language: hu_HU External object cache: –

Server Environment

Server Info: LiteSpeed PHP Version: 7.4.13 PHP Post Max Size: 256 MB PHP Time Limit: 240 PHP Max Input Vars: 1000 cURL Version: 7.71.0 OpenSSL/1.1.1d

SUHOSIN Installed: – MySQL Version: 10.3.27-MariaDB Max Upload Size: 128 MB Default Timezone is UTC: βœ” fsockopen/cURL: βœ” SoapClient: βœ” DOMDocument: βœ” GZip: βœ” Multibyte String: βœ” Remote Post: βœ” Remote Get: βœ”

Database

WC Database Version: 4.8.0 WC Database Prefix: wp_ Total Database Size: 279.19MB Database Data Size: 229.85MB Database Index Size: 49.34MB

Post Type Counts

astra_adv_header: 1 attachment: 482 cartflows_flow: 1 cartflows_step: 2 customize_changeset: 6 custom_css: 2 elementor_library: 17 is_search_form: 1 nav_menu_item: 52 oembed_cache: 268 page: 46 popup_theme: 6 post: 281 product: 6 pt_view: 1 revision: 4070 rp4wp_link: 880 seopress_404: 334 shop_coupon: 7 shop_order: 2897 shop_order_refund: 1 testimonials: 3 wc_afrsm: 2 wc_dynamic_pricing: 5 woo_coupon_reminder: 2 woo_mb_template: 23 wpforms: 1 wp_show_posts: 1 ywrac_cart: 1

Security

Secure connection (HTTPS): βœ” Hide errors from visitors: βœ”

Active Plugins (57)

Dropin Plugins (1)

advanced-cache.php: advanced-cache.php

Must Use Plugins (1)

Health Check Troubleshooting Mode: by – 1.7.2

Settings

API Enabled: – Force SSL: – Currency: HUF (Ft) Currency Position: right_space Thousand Separator: Decimal Separator: , Number of Decimals: 0 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5)

Connected to WooCommerce.com: –

WC Pages

Shop base: #9538 - /shop/ Cart: #33 - /cart/ Checkout: #9493 - /checkout/ My account: #35 - /my-account/ Terms and conditions: #1985 - /aszf/

Theme

Name: Astra Version: 2.6.2 Author URL: https://wpastra.com/about/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: βœ”

Templates

`

Estalhun avatar Jan 08 '21 13:01 Estalhun

Please fix this asap. am also facing same issue

devgene avatar Jan 22 '21 20:01 devgene

I use a custom php code now, but the plug-in would be fine:

add_action('woocommerce_checkout_process', 'phonenumber_custom_checkout_field_process'); function phonenumber_custom_checkout_field_process() { if( is_checkout() ) { global $woocommerce; if ( ! (preg_match('/^+[1-9][0-9]{9,}$/', $_POST['billing_phone'] ))) { wc_add_notice( "A megadott mobiltelefonszΓ‘m helytelen!" ,'error' ); } } }

Estalhun avatar Jan 23 '21 06:01 Estalhun

is it solve the problem?

devgene avatar Jan 23 '21 09:01 devgene

Alternative solution until the problem has resolved.

devgene [email protected] ezt Γ­rta (idΕ‘pont: 2021. jan. 23., Szo 10:15):

is it solve the problem?

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Preciousomonze/woocommerce-phone-validator/issues/38#issuecomment-765893621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNHTWV6G5QOS434X5J4H3TS3KHSRANCNFSM4V2PHYWQ .

Estalhun avatar Jan 23 '21 16:01 Estalhun

Hi folks, I'm so sorry about the delay. Been having a tough time here. And thanks for the temporary fix @Estalhun πŸ₯ΊπŸš€ I'll try to check it through and merge into my v2 branch, please do not be angry. 😫😭😭

Preciousomonze avatar Jan 24 '21 11:01 Preciousomonze

Hello, any update here?

kosarlukascz avatar Apr 07 '21 14:04 kosarlukascz

Improved solution:

add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process'); function my_custom_checkout_field_process() { $myerr = false; if( is_checkout() ) { global $woocommerce; $POST['billing_phone'] = '+' . trim( preg_replace( '/[\s#+-/().]/', '', $_POST['billing_phone'] ) ); if ( ! (preg_match('/^+[1-9][0-9]{9,}$/', $_POST['billing_phone'] ))) { $myerr = true; wc_add_notice( 'Wrong mobile number: ' . $_POST['billing_phone'] ,'error' ); } if ( ! (preg_match('/\d+/', trim($_POST['billing_address_1']) ))) { $myerr = true; wc_add_notice( 'Wrong address!' ,'error' ); } if ( isset($_POST['shipping_postcode']) && trim($_POST['shipping_postcode']) != '' ) { if ( ! (preg_match('/\d+/', trim($_POST['shipping_address_1']) ))) { $myerr = true; wc_add_notice( 'Wrong shipping address!' ,'error' ); } } if ( $myerr ) { wc_add_notice( 'Additonal error message:<br /> <p>Additonal error message about the addresses.</p> <p>Additonal error message about the mobile number:+36701234567</p> Additonal error message<br /> Thank you' ,'error' ); } } }

Estalhun avatar Apr 08 '21 08:04 Estalhun

I think, there is needed more complex solution. If customer enter country code, spaces in phone number, etc ..

For example, in the Czech Republic, it should be possible to specify all these formats: +420605000111 +420 605 000 111 605 000 111 605000111

kosarlukascz avatar Apr 08 '21 08:04 kosarlukascz

This line does it: $POST['billing_phone'] = '+' . trim( preg_replace( '/[\s#+-/().]/', '', $_POST['billing_phone'] ) );

Estalhun avatar Apr 08 '21 14:04 Estalhun

Hello, any fix? and do I add the improved solution as a snippet and remove the plugin?

QaisAljedyani avatar Apr 04 '22 21:04 QaisAljedyani

Hello, any fix? and do I add the improved solution as a snippet and remove the plugin?

Yeah, try the code without the plug-in. You can insert the php code with this plug-in (without editing function.php or child theme): https://docs.spacexchimp.com/plugin-installation.html?#plugin/my-custom-functions

Estalhun avatar Apr 05 '22 09:04 Estalhun