Since upgrading a Magento website from 1.8 to 1.9 and switching them onto the RWD theme, the price is not updating when selecting product options for bundled products.
The console returns the following error when you select an option:-
Uncaught TypeError: Cannot read property 'update' of null
This occurs at line 83 of bundle.js
which is tierPriceElement.update(tierPriceHtml);
.
This is part of the changeSelection
method which in it's entirety, is included below:-
changeSelection: function(selection){
var parts = selection.id.split('-');
if (this.config['options'][parts[2]].isMulti) {
selected = new Array();
if (selection.tagName == 'SELECT') {
for (var i = 0; i < selection.options.length; i++) {
if (selection.options[i].selected && selection.options[i].value != '') {
selected.push(selection.options[i].value);
}
}
} else if (selection.tagName == 'INPUT') {
selector = parts[0]+'-'+parts[1]+'-'+parts[2];
selections = $$('.'+selector);
for (var i = 0; i < selections.length; i++) {
if (selections[i].checked && selections[i].value != '') {
selected.push(selections[i].value);
}
}
}
this.config.selected[parts[2]] = selected;
} else {
if (selection.value != '') {
this.config.selected[parts[2]] = new Array(selection.value);
} else {
this.config.selected[parts[2]] = new Array();
}
this.populateQty(parts[2], selection.value);
var tierPriceElement = $('bundle-option-' + parts[2] + '-tier-prices'),
tierPriceHtml = '';
if (selection.value != '' && this.config.options[parts[2]].selections[selection.value].customQty == 1) {
tierPriceHtml = this.config.options[parts[2]].selections[selection.value].tierPriceHtml;
}
tierPriceElement.update(tierPriceHtml);
}
this.reloadPrice();
},
I can see that the exact same issue used to exist on here but it has since been deleted.
Given this is the code that is packaged with the Magento 1.9, it is strange this is not working as expected... I did force the theme to fallback onto the template files for the base
theme and the same error was triggered when trying to change the options on a bundled product.
JavaScript certainly isn't my speciality (nor debugging it), is there something not right with the above snippet? Or any suggestions on how I can find the cause of this?
Edit
It appears it is something in the theme after all as I reverted to the default RWD theme and the prices were updating - perhaps an extension or something else being called in the layout XML.