Hello,
this +2 added is a repeating problem caused by some themes that have their own quantity button handling. +1 from the plugin and + 1 from the theme. Although I resolved some cases, including the most popular themes that I mainly handled individually in plugin’s code, I was never able to eliminate the issue completely.
The theme’s quantity buttons normally are hidden for almost all themes, unless as it comes out, they are outside the quantity DIV – the case of @valeriocosta.
The website with the problem reported by @mrmelhay is under construction with no access so hopefully, what I suggest here is applicable for You too.
1. This is a safe way to disable the click event assigned to the theme’s buttons. Safe means without affecting quantity buttons not processed by this plugin that come from mini-carts etc. The script searches for the buttons not further than the parent of this plugin’s buttons container. Please look for .php plugin’s file and in line 567 is a function that should have this line added:
$(".qib-container").parent().off("click", ".plus:not(.qib-button), .minus:not(.qib-button)");
In the end, it will look like this:
wc_enqueue_js( $event_listeners .
'
function QtyChng() {
$(".qib-container").parent().off("click", ".plus:not(.qib-button), .minus:not(.qib-button)");
$(document).off("click", ".qib-button").on( "click", ".qib-button", function() {'
. $quantity_change .
'});
}
'
);
Please let me know if this works, if yes, I’ll have it included with the next plugin patch.
2. For the plus and minus buttons added by the theme that are visible, the similar trick can’t be safely used, as there is no parent selector in CSS and hiding .plus and .minus class in the whole HTML document could make some other quantity buttons disappear (mini-carts etc.), so feel free to try this in your child theme CSS or theme’s extra CSS, but it’s not something I can put in the plugin and will need to think if there is any good applicable solution:
.minus:not(#qib_id):not(#qib_id), .plus:not(#qib_id):not(#qib_id) {
display: none;
}
Best regards,
Ryszard
-
This reply was modified 4 years, 6 months ago by
taisho.