-
-
Save pauloiankoski/6131262 to your computer and use it in GitHub Desktop.
Imagem de carregamento no product-single
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cs_woocommerce_add_to_cart_load() { | |
if ( is_product() ) { | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
$(".single_add_to_cart_button").on('click', function() { | |
$('<p><img src="LINK DA IMAGEM" alt="carregando" /></p>').insertAfter($(this)); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'cs_woocommerce_add_to_cart_load' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment