My One step checkout is giving me a headache.. The dev console in IE is giving me an error from this snippet:
var checkout = new Checkout();
$$('#checkout-payment-method-load dt input').invoke('observe', 'click', function(e) {
var element = e.element();
var name = 'payment_form_' + element.getValue();
payment.currentMethod = element.getValue();
/* Hide all other forms */
$$('dd.payment-method').invoke('hide');
if(element.checked) {
payment.switchMethod(payment.currentMethod);
var form = $(name);
var container = $('container_payment_method_' + element.getValue());
if(element !== null && container !== null) {
container.show();
$(name).show();
}
}
});
This is the line that’s giving me trouble:
if(element !== null && container !== null) {
container.show();
$(name).show();
If I comment out this, It’s working fine:
$(name).show();
I can’t see the purpose of this line? Can anyone help me with this?
Suggestion
For one of my client using OneStepCheckOut extension.
In my extension, JS variable name – ‘name’ has an value – “payment_form_cashondelivery” which is the id for “Cash On Delivery” payment information.
So, please check that you have “Cash on Delivery” Payment Method.
If you are not enabled this payment option, then put an IF condition in JS to check the ID is exist ot not.