首先,应该删除已注册的脚本,注册新脚本,然后将脚本排入队列。
检查以下脚本以替换签出。带有自定义签出脚本的min.js。
add_action( \'wp_enqueue_scripts\', \'shopkeeper_wp_enqueue_scripts_for_frontend\', 99 );
function shopkeeper_wp_enqueue_scripts_for_frontend(){
if( is_checkout() ){
// Checkout Page
wp_deregister_script(\'wc-checkout\');
wp_register_script(\'wc-checkout\', SHOPKEEPER_JS_PATH . "override_checkout.js",
array( \'jquery\', \'woocommerce\', \'wc-country-select\', \'wc-address-i18n\' ), WC_VERSION, TRUE);
wp_enqueue_script(\'wc-checkout\');
}
}