Skip to content

Instantly share code, notes, and snippets.

@acanza
Last active March 8, 2018 18:57
Show Gist options
  • Select an option

  • Save acanza/50b4bed2a2c84a0e0bec3d4e9160875e to your computer and use it in GitHub Desktop.

Select an option

Save acanza/50b4bed2a2c84a0e0bec3d4e9160875e to your computer and use it in GitHub Desktop.
[Cart Notice for WooCommerce] Elimina la etiqueda de (sin IVA) cuando se muestra la cantidad restante para alcanzar el precio mínimo en el carrito.
// [Cart Notice for WooCommerce] Elimina la etiqueda de (sin IVA) cuando se muestra la cantidad restante para alcanzar el precio mínimo en el carrito.
if ( class_exists( 'WooCommerce' ) && class_exists( 'BeRocket_cart_notices' ) ) {
add_filter( 'wp_footer', 'delete_tax_label' );
function delete_tax_label(){
if ( is_cart() ) {
?>
<!-- Start BeRocket_cart_notices -->
<script type="text/javascript">
jQuery( document ).ready( function ($) {
function search_and_delete_price_tax_label( ){
var wc_notices = $( '.woocommerce-info' );
wc_notices.each( function( i, e ){
var tax_label = $( e ).find( '.woocommerce-Price-taxLabel' );
if ( tax_label.length > 0 ) {
tax_label.remove();
};
});
}
search_and_delete_price_tax_label();
// Elimina etiqueta del precio cuando se actualiza el carrito
$( '.button[name="update_cart"]' ).click( function(){
$( document ).ajaxSuccess( function(){
setTimeout( search_and_delete_price_tax_label, 100 );
});
});
});
</script>
<!-- End BeRocket_cart_notices -->
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment