On the Magento admin new product page
/app/design/adminhtml/default/default/template/catalog/product/edit.phtml
I've tried to add the following code
<!-- Start Edits -->
<script src="jquery-2.1.1.js"></script>
<script type="text/javascript" >
//<![CDATA[
alert("This code is running!");
$(window).load(function(){
function calculate()
{
var values = [
$("#cost").val(),
$("#shipping_paid").val(),
$("#tax_paid").val()
];
var percent_value = $("#our_markup").val();
var sub_total = eval( values.join('+') );
var total = eval("sub_total+(sub_total * percent_value)");
$("#price").val(total);
}
$(document).on('input', 'input', calculate);
$(document).on('change', 'select,input', calculate);
});
//]]>
</script>
<!-- End Edits -->
Which will tally up the 3 text fields with id = "cost", "shipping_paid", "tax_paid", and put them in the text field id = "price". But for some reason it does not seem to want to perform correctly.
I have tried it in a stand alone file and all functionality works correctly.
Any help is appreciated!