feat: add complementos feature for linking multiple accessories and quantities to products

This commit is contained in:
2026-06-22 03:35:06 -04:00
parent 97cbe13196
commit 606ed94722
6 changed files with 231 additions and 4 deletions

View File

@@ -39,4 +39,17 @@ document.addEventListener("DOMContentLoaded", function () {
});
});
}
window.toggleNuevoComplementoInput = function(prodId, selectEl) {
const wrapper = document.getElementById(`nuevo_comp_wrapper_${prodId}`);
if (wrapper) {
if (selectEl.value === '__nuevo__') {
wrapper.style.display = 'block';
wrapper.querySelector('input').setAttribute('required', 'required');
} else {
wrapper.style.display = 'none';
wrapper.querySelector('input').removeAttribute('required');
}
}
};
});