Posted on

Can not add2cart grouped product when 1 input field is diabled

I need to disable the input field when customergroup = 0 or 1 and quantity is < 0 but when I add the argument ‘disabled’ to the input, the add2cart button does not put the other available items in the cart anymore.

<input type=”number”
name=”super_group[<?= $block->escapeHtmlAttr($_item->getId()) ?>]”
data-selector=”super_group[<?= $block->escapeHtmlAttr($_item->getId()) ?>]”
value=”<?= $block->escapeHtmlAttr($_item->getQty() * 1) ?>”
title=”<?= $block->escapeHtmlAttr(__(‘Qty’)) ?>”
class=”input-text qty”
min=”0″
data-validate=”{‘validate-grouped-qty’:’#super-product-table’}”
data-errors-message-box=”#validation-message-box”
<?php if ($disable_box === ‘1’ && ($block->getStockStatus($_item) == ‘1’ || $block->getStockStatus($_item) == ‘0’ )) {echo ‘disabled’;} ?> />
</div>

Leave a Reply

Your email address will not be published.