I made the select currency option TH, Eu,USD. If the customer choose THB, the price will show only THB price with multiple price option but when load the page I want the system show default THB price fist when the page load, and then we can change to us or usd later, please advice
/******************* JQUERY **************************/
$(document).ready(function(){
$('#theSelect').change(function(){
var string = $(this).val();
$('.hideStuff').slideUp('fast');
$('.is'+string+'').delay(320).slideDown('fast');
});
});
/****************** CSS **************************/
.hideStuff {display: none;}
/*************** HTML *************************************/
<div class="selectContainer">
<select id="theSelect">
<option value="">- Select -</option>
<option value="isTHB">THB</option>
<option value="isUSD">USD</option>
<option value="isEU">EU</option>
</select>
</div>
<div class="hideStuff isTHB">3000 THB</div>
<div class="hideStuff isUSD">50 USD</div>
<div class="hideStuff isEU">40 EU</div>
Also you’ll probably have to use jQuery Cookie plugin if you want the previously selected values to be stored temporarily (unless you’re not getting your values from a $_GET or something) You can then load them from a cookie on page load.
You would implement it onChange:
And load when page refreshes
Check out https://github.com/carhartl/jquery-cookie