I have a Magento test store with an onepagecheckout extension that utilizes a onepagecheckout.js file. I am trying to add 'click' event observers to the payment radio buttons, but nothing happens when they are clicked.
The observers are being added to individual input elements using a javascript function:
addObservers: function () {
$$('input[name="payment[method]"]').each(function (el) {
el.observe('click', function () {
checkout.update({
'review': 1,
'payment-changed': 1
});
});
});
}
The elements being looped through in the code match the ids and names of the input elements:
el = input#p_method_bankpayment.radio
el = input#p_method_paypal_express.radio
el = input#p_method_cashondelivery.radio
el = input#p_method_phoenix_cashondelivery.radio
The update function is supposed to fetch new content via AJAX when the page is loaded, but it doesn't seem to be executed as there is no network activity visible when the events should be triggered.
You can view the installation here: (Add items to cart, proceed to checkout, but stop before finalizing)
I'm wondering why the observers are not functioning properly. Other installations with this extension are working fine. Any insights?