Shopify themes, liquid, logos, and UX
Dawn v9
I have two line line item property fields on a product page (buy-buttons-custom.liquid).
<p class="line-item-property__field">
<label for="length">length</label><br>
<input required class="required" id="length" type="text" onblur="changeoptionvalue()" name="properties[length]">
</p>
<p class="line-item-property__field">
<label for="width">width</label><br>
<input required class="required" id="width" type="text" onblur="changeoptionvalue()" name="properties[width]">
</p>
I created this function (global.js):
function changeoptionvalue(){
var length = +(document.getElementById("length").value);
var width = +(document.getElementById("width").value);
var total = length + width;
if (total<20) {
selector.selectVariant("44380039577868", selector); //not working
//here i want to select option value x of option z
} else {
//here i want to select option value y of option z
}
}
How can i code to select a specific option value of a specific option inside a product page?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024