var onItemOptionChange = function(obj) { document.getElementById('itemPrice').innerHTML = getPriceByVariant(obj.options[obj.options.selectedIndex].value); document.getElementById('retailPrice').innerHTML = getRetailPriceByVariant(obj.options[obj.options.selectedIndex].value); if (getAttributeValueByVariant('Height',obj.options[obj.options.selectedIndex].value)) document.getElementById('attribute_Height').innerHTML = getAttributeValueByVariant('Height',obj.options[obj.options.selectedIndex].value); if (getAttributeValueByVariant('Weight',obj.options[obj.options.selectedIndex].value)) document.getElementById('attribute_Weight').innerHTML = getAttributeValueByVariant('Weight',obj.options[obj.options.selectedIndex].value); if (getAttributeValueByVariant('Width',obj.options[obj.options.selectedIndex].value)) document.getElementById('attribute_Width').innerHTML = getAttributeValueByVariant('Width',obj.options[obj.options.selectedIndex].value); } var getAttributeValueByVariant = function(attributeName, variantValue) { if (attributeName == 'Height' && variantValue == '') return '16mm'; if (attributeName == 'Weight' && variantValue == '') return '1.80'; if (attributeName == 'Width' && variantValue == '') return '30mm'; } var getPriceByVariant = function(variantOption) { } var getRetailPriceByVariant = function(variantOption) { } var addToBasket = function() { if (document.getElementById('itemOptions')) { var obj = document.getElementById('itemOptions').options; document.getElementById('i_variant_option').value = obj[obj.selectedIndex].value; } document.getElementById('i_qty').value = document.getElementById('qty').options[document.getElementById('qty').options.selectedIndex].value; document.getElementById('addForm').submit(); }