There seems to be a conflict between Bricks and WooCommerce Composite Products which is causing the quantity selector to not work correctly. The function bricksWooQuantityTriggers() is not properly targeting the span elements which need the .brx-initialized class added. This issue is only present when using the quantity selector on Composite Products pages, as the form element is replaced with a div with a class of .component_options.
Video: https://vimeo.com/822107323/3ddbf9303e?share=copy
function bricksWooQuantityTriggers() {
var quantityButtons = bricksQuerySelectorAll(document, ‘form .quantity .action’)
quantityButtons.forEach(function (button) {
// @since 1.7.1 - Skip already initialized button
if (button.classList.contains('brx-initialized')) {
return
}
// @since 1.7.1 - Add initialized class to prevent re-initialization
button.classList.add('brx-initialized')
button.addEventListener('click', function (e) {
e.preventDefault()
// Only update cart if quantity input is not readonly (@since 1.7)
var quantityInput = e.target.closest('.quantity').querySelector('.qty:not([readonly])')
if (!quantityInput) {
return
}
var updateCartButton = document.querySelector('button[name="update_cart"]')
if (updateCartButton) {
updateCartButton.removeAttribute('disabled')
updateCartButton.setAttribute('aria-disabled', 'false')
}
if (e.target.classList.contains('plus')) {
quantityInput.stepUp()
} else if (e.target.classList.contains('minus')) {
quantityInput.stepDown()
}
// Trigger change event for product quantity input (@since 1.7)
const quantityInputEvent = new Event('change', { bubbles: true })
quantityInput.dispatchEvent(quantityInputEvent)
})
})
}