I was successfully able to change the value of the "price" class on this page using this jQuery script:
jQuery("#options_46_2").click(function(){
var priceOldValue = parseInt(jQuery('.product-options-bottom .price-box .price').text().replace(/[^0-9.]/g, ""));
if (this.checked) {
var selectedWeight = jQuery("#select_32 option:selected").text();
selectedWeight = parseFloat(selectedWeight);
var priceNewValue = priceOldValue + 50 * selectedWeight;
jQuery(".product-options-bottom .price-box .price").html("Rs" + priceNewValue + ".00");
}
else {
jQuery(".product-options-bottom .price-box .price").html("Rs" + priceOldValue + ".00");
}
});
Now, I want this changed value to be the actual value of the product's price when a user clicks on "Add to cart" button. How should I do it?
Also, is there any more elegant way to do this, for other products?