Hello,
I have this code below that works fine, this code is used, when we select another variant, the message is changed without the necessity of updating the page.
But I want to change the availability check of the variant by checking if its inventory is non-zero.
Unfortunately, I am encountering a problem because the “inventory_quantity” variable is not recognized by the code. Could someone help me to solve this problem?
if (backorder.length) {
backorder.forEach((element) => {
if (variant) {
if (variant.available) {
element.innerHTML = ' ';
} else {
element.innerHTML = 'Votre bijou est en fabrication et vous sera livré sous 6 semaines.';
}
} else {
element.innerHTML = theme.strings.unavailable;
}
});
}