Streaming live at 10am (PST)

**HOW TO GUIDE** Remove default option from product variant select field

I ran into an issue (annoyance) with the product variant select field.
I wanted to remove/change the default option. Below is some simple JS that lets you do this.

The script below finds every field in the Add To Cart widget and replaces the first option with a string of your choice. Leave it blank for an ‘empty’ option.

<script>    
const x = document.querySelectorAll('.w-commerce-commerceaddtocartform select');

window.onload = function() {
    for (i = 0; i < x.length; i++) {
        x[i].options[0].innerHTML = "*your text goes here*";
    }
};
</script>

This script finds every field in the Add To Cart widget and removes the first option altogether.

<script>    
const x = document.querySelectorAll('.w-commerce-commerceaddtocartform select');

window.onload = function() {
    for (i = 0; i < x.length; i++) {
        x[i].options[0].innerHTML = "";
    }
};
</script>

Hope this helps anyone having the same issue.