var quoteBaseGrandTotal = _getQuote()->getBaseGrandTotal(); ?>; var isGiftCardApplied = isFullyPaidAfterApplication()): ?>truefalse; if (quoteBaseGrandTotal < 0.0001 && isGiftCardApplied) { Payment.prototype.init = function () { var elements = Form.getElements(this.form); var method = null; for (var i=0; i < elements.length; i++) { if (elements[i].name == 'payment[method]' && elements[i].value == 'free') { elements[i].checked = true; method = 'free'; } else { elements[i].disabled = true; (elements[i]).parentNode.hide(); if(elements[i].name == 'payment[method]'){ $methodForm = $('container_payment_method_' + elements[i].value); if($methodForm){ $methodForm.hide(); } } } } if (method) this.switchMethod(method); }; } payment.init(); Payment.prototype.init = function () {};