Now by default the first size is shown. If a user clicks on a different size, I want the price to change in the main product price div. How can this be done?
So basically want I want is: if there is an option that has brackets, then strip the brackets and show what's inside them in the main price DIV.
Any help is appreciated as always!
A regular expression would probably be the easiest way to do that.
If this will be in a select drop down, why not put the dollar amount in the value attribute?
<option value="£25.00">Small (£25.00)</option>
Here is a quick test using jQuery:
<option value="£25.00" selected="selected">Small (£25.00)</option>
<option value="£30.00">Medium (£30.00)</option>
<option value="£35.00">Large (£35.00)</option>
var value = $('select[name="selectItem"] option:selected').val();
Hey dude, I need the value of the option as when a user chooses the option, the value is then compared to that in the database and gets the price, hence why if I could get the figure between the brackets then update the price DIV.