Skip Navigation

[Resolved] Select2 + WooCommerce Conflict

This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Nigel 7 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#449522
Screen Shot 2016-10-23 at 1.09.32 PM.png

When I activate WP Types/Views while WooCommerce is active, many select fields show up incorrectly. For instance, on ~/wp-admin/admin.php?page=views-editor&view_id=123 (please see attached).

After quite a significant amount of time debugging, I can only get my select fields to show if I run the following code in my functions.php file:

function rdsp_dequeue_script() {
	if ( is_admin() ) {	

		$current_screen = get_current_screen();
		$target_admin_page = 'toolset_page_views-editor';

		if (  $current_screen->base !== $target_admin_page ){
			wp_dequeue_script( 'select2');
			wp_dequeue_script('views-shortcodes-gui-script');
		}
		if (  $current_screen->base == $target_admin_page ){
			wp_dequeue_script( 'select2');
			wp_dequeue_script( 'views-editor-js' );
			wp_dequeue_script( 'views-pagination-js' );
		}
	};
}
add_action( 'wp_print_scripts', 'rdsp_dequeue_script', 0 );
add_action( 'admin_enqueue_scripts', 'rdsp_dequeue_script', 0 );
#449524

Types/Views also appears to also conflict with ACF for select as well: https://wordpress.org/plugins/advanced-custom-fields/

#450070

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Ryan

According to the debug info you provided, you are still using an older version of Views (2.1).

The Types 2.2.2 update included breaking changes (related to updating the jQuery select2 library to a current version) which required updating other Toolset plugins at the same time, including Views.

We tried to anticipate compatibility issues with other plugins that still use a deprecated version of select2 (such as WooCommerce) and if you run current versions of all Toolset plugins you shouldn't see any such issues.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.