Skip to content

Instantly share code, notes, and snippets.

@pauloiankoski
Forked from claudiosanches/functions.php
Created August 1, 2013 13:22
Show Gist options
  • Save pauloiankoski/6131262 to your computer and use it in GitHub Desktop.
Save pauloiankoski/6131262 to your computer and use it in GitHub Desktop.
Imagem de carregamento no product-single
<?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