Last active
January 31, 2018 10:07
-
-
Save kreamweb/375a015f3580c2f416c851bc8d5c54cc to your computer and use it in GitHub Desktop.
Fix for themes that use javascripts for quantity fields
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
<?php | |
if ( defined( 'YITH_YWRAQ_PREMIUM' ) ) { | |
function ywraq_print_my_inline_script() { | |
?> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(document).on('ywraq_table_reloaded', function ($) { | |
jQuery(document).find( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' ); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'ywraq_print_my_inline_script', 99 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment