Dear Mr. Tahir,
the issue is caused when I try to add the code below inside the function.php file ( the code is necessary to customize button with woocommerce style.
I do not understand if the issue is caused by the code or the position where I insert it.
add_action( ‘wp_enqueue_scripts’, ‘woocommerce_enqueue_chosen’ );
function woocommerce_enqueue_chosen() {
global $woocommerce;
$suffix = defined( ‘SCRIPT_DEBUG’ ) && SCRIPT_DEBUG ? ” : ‘.min’;
wp_register_script( ‘ajax-chosen’, $woocommerce->plugin_url() . ‘/assets/js/chosen/ajax-chosen.jquery’.$suffix.’.js’, array(‘jquery’, ‘chosen’), $woocommerce->version );
wp_register_script( ‘chosen’, $woocommerce->plugin_url() . ‘/assets/js/chosen/chosen.jquery’.$suffix.’.js’, array(‘jquery’), $woocommerce->version );
wp_enqueue_script( ‘ajax-chosen’ );
wp_enqueue_script( ‘chosen’ );
wp_enqueue_style( ‘woocommerce_chosen_styles’, $woocommerce->plugin_url() . ‘/assets/css/chosen.css’ );
}
add_action( ‘wp_footer’, ‘woocommerce_make_variations_chosen’ );
function woocommerce_make_variations_chosen() {
echo ”
<script language=\”JavaScript\”>
jQuery(\”.variations select\”).chosen({ disable_search_threshold: 100 });
jQuery(\”.woocommerce-ordering select\”).chosen({ disable_search_threshold: 100 });
</script>
“;
}