Last active
March 8, 2018 18:57
-
-
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.
This file contains hidden or 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
| // [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