
[img]https://i.stack.imgur .com/8RJn3.png[/img]
Однако у меня этот метод по-прежнему не работает. Кто-нибудь может помочь? Спасибо.
$('#partQuantity').on('click', "#plus" + data[k].Id, function(event) {
event.preventDefault();
var quantityInput = document.getElementById('qua' + data[k].SkuSizeId); // Assuming 'SkuSizeId' is the correct property
if (quantityInput) {
var currentValue = parseInt(quantityInput.value) || 1;
if (currentValue < data[k].OnHand) {
quantityInput.value = currentValue + 1;
}
}
});
$('#partQuantity').on('click', "#minus" + data[k].Id, function(event) {
event.preventDefault();
var quantityInput = document.getElementById('qua' + data[k].SkuSizeId); // Assuming 'SkuSizeId' is the correct property
var currentValue = parseInt(quantityInput.value);
if (currentValue > 1) {
quantityInput.value = currentValue - 1;
}
});
Подробнее здесь: https://stackoverflow.com/questions/781 ... ty-product
Мобильная версия