How to override javascript file in wordpress

Some time we required to override plugin and theme jQuery file to used below script.
if override plugin file add in your theme functions.php file and override theme file to add on child theme functions.php file.

function checkout_script(){
	wp_dequeue_script('wc-checkout');	
	wp_enqueue_script( 'wc-checkout', get_bloginfo( 'stylesheet_directory' ). '/woocommerce/assets/checkout.js' , array( 'jquery' ), false, true );	
}

add_action( 'wp_enqueue_scripts', 'checkout_script',1 ); 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s