Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Removing enhanced dropdown boxes in WooCommerce checkout

If 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.



This post first appeared on Spokane Website Design Blog | 20 Miles North Web D, please read the originial post: here

Share the post

Removing enhanced dropdown boxes in WooCommerce checkout

×

Subscribe to Spokane Website Design Blog | 20 Miles North Web D

Get updates delivered right to your inbox!

Thank you for your subscription

×