Scroll Top

Removing enhanced dropdown boxes in WooCommerce checkout

woocommerceIf you had been running the older woocommerce versions you remember a little check box option that said “Enable enhanced country select boxes”. This removed the scripting from the checkout dropdowns for the state and country select boxes.

As I am sure you have noticed, the latest versions no longer have that option. That has caused some conflicting script issues with themes in my own design so I figure it has probably plagued some of you as well. Luckily there is an easy fix:

Enter the following code into your theme functions.php file:

add_action( 'wp_enqueue_scripts', 'agentwp_dequeue_stylesandscripts', 100 );

function agentwp_dequeue_stylesandscripts() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );

wp_dequeue_script( 'select2');
wp_deregister_script('select2');

}
}

This simple bit of code will disable the enhanced boxes and give you a good old fashioned dropdown menu. This method has been tested in WooCommerce 2.3.10.

Newsletter

Subscribe to our newsletter and periodic updates to the world of websites, SEO and social media and how they can effect your business.

Contact us