Edit file File name : single-product-variations.min.js Content :const triggerActiveAttributeButton=()=>{var t=document.querySelector(".ast-variation-button-group .ast-single-variation.active");t&&t.click()},productVariation=a=>{var t=document.querySelectorAll(".ast-single-variation"),e=document.querySelector(".reset_variations");e&&e.addEventListener("click",t=>{document.querySelectorAll(".ast-single-variation").forEach(t=>{t.classList.remove("active"),t.style.opacity="1",t.style.pointerEvents="inherit"})}),t&&t.forEach(t=>{t.addEventListener("click",t=>{var e=t.target.closest(".ast-variation-button-group"),e=(e&&(e=e.querySelectorAll(".ast-single-variation"))&&e.forEach(t=>{t.classList.remove("active")}),document.querySelector(".ast-product-single-variable form .variations")),e=(e&&(allVariationSelector=e.querySelectorAll("select"),allVariationButton=e.querySelectorAll(".ast-variation-button-group"),allVariationSelector)&&allVariationButton&&setTimeout(()=>{allVariationSelector.forEach(t=>{var e=t.querySelectorAll("option");const i=[];e.forEach(t=>{i.push(t.getAttribute("value"))});e=t.nextElementSibling;const a=null!==e?e.querySelectorAll(".ast-single-variation"):null;null!==a&&a.forEach(t=>{a.forEach(t=>{i.includes(t.getAttribute("data-slug"))?(t.style.opacity="1",t.style.pointerEvents="inherit"):(t.style.opacity=".5",t.style.pointerEvents="none")})})})},100),t.target.getAttribute("data-slug")),i=t.target.closest("td").querySelector("select");e&&i&&(t.target.classList.add("active"),i.value=e,i.dispatchEvent(new Event("change",{bubbles:!0})),triggerActiveAttributeButton()),null!=a&&a.flexslider(0)})})};document.addEventListener("DOMContentLoaded",function(t){productVariation()}),document.addEventListener("astUpdateSingleProductVariations",function(){productVariation()}),jQuery(".composite_data").on("wc-composite-initializing",function(t,e){e.actions.add_action("component_scripts_initialized",function(){productVariation()},100)}); Save