From 687b618cdd81aa418c92a591c15d7c7c4b0d588c Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 30 Nov 2017 11:47:06 -0500 Subject: [PATCH] Fix for dysfunctional WooCommerce dropdowns by dequeueing selectWoo styles/scripts --- functions.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/functions.php b/functions.php index 4935ba2..5d751db 100755 --- a/functions.php +++ b/functions.php @@ -314,6 +314,27 @@ function custom_wc_checkout_fields( $fields ) { } add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' ); +/* + * The action below is necessary to make select2 work, which is the script used + * for dropdown menus on the woocommerce checkout pages. Without it, any version + * between 3.2.0 and at least 3.2.5 will have unusable dropdowns on the checkout + * pages for iOS devices (iPad, iPhone). It still works fine on OSX (mac). + * + * This will need to be included on every WooCommerce site until they fix it, if + * they ever do. + */ +add_action( 'wp_enqueue_scripts', 'agentwp_dequeue_stylesandscripts', 100 ); + +function agentwp_dequeue_stylesandscripts() { + if ( class_exists( 'woocommerce' ) ) { + wp_dequeue_style( 'selectWoo' ); + wp_deregister_style( 'selectWoo' ); + + wp_dequeue_script( 'selectWoo'); + wp_deregister_script('selectWoo'); + + } +} // Dissable captch if it has been solved once using session // safely start a session -- 2.17.1