I am looking to have the product price automatically updated based on the quantity the customer has chosen.
Currently when you choose a custom option in magento the
In Magento 1.9.2.4, the code file to edit is js/varien/product.js
In Magento 1.9.3 and above, the file to edit is js/varien/product_options.js
Add the following code:
var qty;
if($('qty').getValue().length == 0 || isNaN($('qty').getValue()) || $('qty').getValue() <= 0) {
qty = 1;
} else {
qty = $('qty').getValue();
price *= qty;
}
right after
if (price < 0) price = 0;
and before
if (price > 0 || this.displayZeroPrice) { ...
And, at the end of the file add:
Event.observe(window, 'load', function() {
$('qty').observe('blur', function(e){
optionsPrice.reload();
});
});
Source: https://magentojai.blogspot.com/2015/06/price-update-while-change-qty-in.html