Regarding Order form landing page

Hello,

I am trying to bypass the payment selection page to directly show the order form and this is code that i am using:
jQuery(document).ready(function(){
Infusion.Ecomm.OrderForms.selectPaymentType(‘creditcard’);
Infusion.Ecomm.OrderForms.ajaxSubmitForm(‘orderForm’, false, 0, ‘’, ‘jQuery("#identifier").val()’, ‘RENDER_ORDER_FORM’, [‘ORDER_FORM_BILLING_ENTRY’, ‘PAYMENT_SELECTION’, ‘ORDER_FORM_SHIPPING_ENTRY’, ‘SHIPPING_OPTIONS’, ‘CHECKOUT_LINKS’]);
});

On loading the URL for the first time the code did not work and showing me the error:
Infusion.Ecomm.OrderForms.selectPaymentType is not a function.

But when I reload the page again the code works and shows me the order form directly.
Can anyone help me with that ?

You’ll need to hook the ajax.done method. General form load/ready won’t do it.

Thanks for replying John_Borelli
I tried few things already with the ajaxComplete function but this did not worked.
I used this code but not working:
jQuery(document).ajaxComplete(function () {
alert(‘Completed’);
});
Can you help me with using the ajax.done method in my custom script ?

I think the .done is just a psuedo for complete. Where are you putting the code? I normally put form completion checks in the footer. Also, you might try body instead of document?

Yes I have tried the code in the footer with the body as well in place of document but its not working. Can you place the code which worked for you please ?