Hi @amafequefez ,
For your information, our developers said the auto-select feature was dependent on the theme or template being used on the site so they didn’t make it.
If you would like to have that feature, kindly add custom to achieve it on your site so you can use it properly.
Even if our developers add that to our developers, it’s not sure that the feature can function well on all themes/templates so there would require much customization from us. That might lead to user dissatisfaction or dispute. It’s why we don’t add this to our plugin although our developers can do it.
Best regards.
I find it weird that it would somewhat be linked to the theme. Anyway, here is the JS I use. Tried it on your site and it works, @amafequefez. Just include it somewhere on the page.
<script>
// include sub products according to qty change
function includeSubProduct(el) {
setTimeout(_ => {
let item = el.closest('.wooco_component_product_selection_item'),
qty = el.parentNode.querySelector('.wooco_qty').value
if (item.classList.contains('wooco_item_selected') !== (qty > 0)) { // xor
item.click()
}
}, 100)
}
// press btn [+] => add product
document.querySelectorAll('.wooco_component_product_qty_plus')
.forEach(btn => btn.addEventListener('click', _ => includeSubProduct(btn)))
// press btn [-] => remove product if qty = 0
document.querySelectorAll('.wooco_component_product_qty_minus')
.forEach(btn => btn.addEventListener('click', _ => includeSubProduct(btn)))
// input change => idem
document.querySelectorAll('input.wooco_qty')
.forEach(input => input.addEventListener('input', _ => includeSubProduct(input)))
</script>