Jump to content

Ajax Order Form cannot change billing period - sometimes


Meebox

Recommended Posts

Hi guys,

 

I'm using the Ajax Order Form, selling Webhotels and VPS's. The customer can choose different billing cycles for both products.

 

The only difference between the products are that the VPS's has some custom fields and the webhotels has to choose a domain. Other then that, they are just added in WHMCS as usual.

 

When I try to change the billing cycle for the webhotel, it works perfectly. When trying to change the billing cycle for the VPS's (with the custom fields) - not working. It simply doesn't update the template.

 

Any clue what is wrong? Or is there a fix available? I'm using the default ajax order form code.

 

Thanks!

Link to comment
Share on other sites

  • 4 weeks later...

This issue is occurring because the form has duplicated instances of the fields. What happens is when you load a product and configure it and then switch to another product that has less configuration options, the data from the last form still exists.

 

There is a very simple fix to this issue.

 

Open up order/templates/ordering.js

 

Find the line from the function "loadproductconfig" (line 20 by default):

if (pid) var displaynum = 1; else var displaynum = 2;

 

Add under it:

if (displaynum == 1) {

$("#productconfig2").html('');

}

 

This will now remove the additional configuration from the previous product :D

Edited by jeremyhaber
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated