• Resolved amafequefez

    (@amafequefez)


    Hi everyone!
    I have a product in which the costumer can select the items in his box (tried to add the image here but won’t upload). https://amafequefez.com.br/produto/monte-seu-presente/

    Even putting 2 on quantity on the right, for example, the client still need to check the box on the left. Not very intuitive.

    But I can’t find the setting to take the checkbox out and keep the quantity.


    Thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Janilyn T

    (@janilyn409)

    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>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘checkbox and quantity on same product’ is closed to new replies.