JavaScript:
// Get the element that displays Box swatch and "Box and Card" swatch
// Deactivate Box and "Box and Card" swatch
// Add appropriate copy for the alert
let productSwatches = document.querySelectorAll(".swatches__holder span");
productSwatches.forEach(element => {
let attributeValue = element.getAttribute("data-swatch-option");
console.log("data-swatch-option=" + attributeValue);
if (attributeValue == "Box") {
element.setAttribute("class", "swatch--disabled");
}
if (attributeValue == "Box and Card") {
element.setAttribute("class", "swatch--disabled");
}
});
HTML:
Add My Design To:
BoxCard
Box and Card
Подробнее здесь: https://stackoverflow.com/questions/731 ... nt-working
Мобильная версия