dropdown for product variant picker
parent
81e53a4072
commit
f9c9287ceb
|
@ -156,7 +156,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const selectElement = document.querySelector('.shx-dummy-select field__input');
|
const selectElement = document.querySelector('.shx-dummy-select');
|
||||||
const dropdownContent = document.getElementById('shx-custom-dropdown-content');
|
const dropdownContent = document.getElementById('shx-custom-dropdown-content');
|
||||||
const selectedButton = document.getElementById('shx-custom-selected');
|
const selectedButton = document.getElementById('shx-custom-selected');
|
||||||
|
|
||||||
|
@ -169,6 +169,8 @@
|
||||||
const selectedVariant = event.currentTarget.getAttribute('data-value');
|
const selectedVariant = event.currentTarget.getAttribute('data-value');
|
||||||
selectedButton.innerText = event.currentTarget.innerText;
|
selectedButton.innerText = event.currentTarget.innerText;
|
||||||
|
|
||||||
|
console.log("selEl", selectElement, selectedVariant)
|
||||||
|
|
||||||
// Set the selected option in the original select element
|
// Set the selected option in the original select element
|
||||||
selectElement.value = selectedVariant;
|
selectElement.value = selectedVariant;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue