Khandaker Toihidul Islam
Front-end Developer
React Js | Javascript | HTML | CSS | Bootstrap | Wordpress | PHP | Mysql

Add script into woocommerce checkout page

We can easily add our custom script in woocomerce checkout page by adding the following fuction in function.php of active theme folder


function add_checkout_script() { ?>
    <script type="text/javascript">
        jQuery(document).on( "updated_checkout", function(){
	     $("#divId").click(function () {
		 alert('ok');
	     });
        });         
    </script>
<?php       
}
add_action( 'woocommerce_after_checkout_form', 'add_checkout_script' );

You may also like...