Support » Plugin: YITH WooCommerce Quick View » Quantity buttons not working

  • Resolved Marcelo Herrera

    (@rafadizeo)


    Hi team, I have a problem with the plugin. I have a code to modify the quantity buttons (+ and -). The code works fine in single product but does not work in modal window (quick view). This is the code I am using.

    jQuery( function ( $ ) {
        $('.td-quantity-button').on('click', function () {
            var $this = $(this);
            var $input = $this.parent().find('input');
            var $quantity = $input.val();
            var $new_quantity = 0;
            if ($this.hasClass('plus')) {
                var $new_quantity = parseFloat($quantity) + 1;
            } else {
                if ($quantity > 0) {
                    var $new_quantity = parseFloat($quantity) - 1;
                }
            }
            $input.val($new_quantity);
        });
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Marcelo Herrera

    (@rafadizeo)

    Solved! replacing

    $('.td-quantity-button').on('click',

    with

    $( document ).on( 'click', '.quantity .minus, .quantity .plus',

    Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,
    I’m happy to see that you achieved your goal.
    Don’t hesitate write us whenever you need.

    I have this code in js
    not working in quick view

    `jQuery(“input.product-count”).TouchSpin({
    min: 1,
    max: 1000,
    step: 1,
    buttondown_class: “btn btn-link”,
    buttonup_class: “btn btn-link”,
    });

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Quantity buttons not working’ is closed to new replies.