dropdown for product variant picker

main
alexanderroese 2024-07-13 23:45:05 +02:00
parent a311b18c8d
commit ed9ac3da1e
1 changed files with 0 additions and 22 deletions

View File

@ -41,10 +41,6 @@
%}
{% if shx_current_page contains "texte" %}
<script>
console.log("3 product variant", "{{ picker_type }}", {{ product | json }}, {{ shx_current_page }})
</script>
<style>
/* Custom dropdown button styling */
.shx-custom-dropdown {
@ -171,8 +167,6 @@
event.currentTarget.classList.add('shx-custom-selected-variant');
dropdownContent.style.display = 'none';
console.log('Selected variant:', selectedVariant);
// Additional code to handle the selected variant can go here
});
});
@ -184,22 +178,6 @@
}
}
});
// Set the initial value when the page loads
/* window.addEventListener('load', function() {
const selectedValue = selectElement.value;
// customSelectedValue.innerText = selectedValue;
console.log("load", selectedValue)
/*
document.querySelectorAll('.shx-custom-dropdown-content div').forEach(div => {
if (div.getAttribute('data-value') === selectedValue) {
div.classList.add('shx-custom-selected-variant');
} else {
div.classList.remove('shx-custom-selected-variant');
}
}); */ /*
}); */
</script>
{% else %}
{%- if picker_type == 'swatch' -%}