Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Last active January 31, 2018 10:07
Show Gist options
  • Save kreamweb/375a015f3580c2f416c851bc8d5c54cc to your computer and use it in GitHub Desktop.
Save kreamweb/375a015f3580c2f416c851bc8d5c54cc to your computer and use it in GitHub Desktop.
Fix for themes that use javascripts for quantity fields
<?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