Jump to content

How to remove NS fields from VPS order form only?


Recommended Posts

Hello,

We are no longer offering the ability to use customized Nameservers for our VPS servers and are looking for a solution on how to remove the fields from the order form.

The problem is while hiding the options the fields will remain hidden when ordering a dedicated server, also.

Any way to achieve this?

Thanks in advance for your great help.

Link to comment
Share on other sites

  • 10 months later...
  • WHMCS Technical Analyst

This should be possible with a template customization according to our documentation: http://docs.whmcs.com/Order_Form_Templates

To only hide a field for certain products then something along the lines of this could be used:

{if $productinfo.name eq 'Bronze'}<input type="hidden" name="ns1prefix" size="10" value="NA" />
{else}
<input type="text" name="ns1prefix" size="10" value="{$server.ns1prefix}" />
{/if}


I hope this is what you are looking for.

Link to comment
Share on other sites

While this answer is good for most, it needs to be updated. I had the luck to get a WHMCS CS agent who kindly explained the need to replace

value="{$server.ns1prefix}"

with

value="NA"

Please note that not doing so will cause a validation error since the Order Page is expecting the value to be provided to be assigned to that field.

Link to comment
Share on other sites

  • WHMCS Technical Analyst

Hello,

The above example is using an IF/ELSE statement, so the first line of code checks the product name and to only hide the ns1 field for the bronze  product and you are correct. You would use what you have provided for the value and that is "NA".

However, if you do not want to do this for every product you would still use the original value code of "{$server.ns1prefix}" in the ELSE part of the statement or it will not bring over the ns1 value. It would just bring over "NA" each time.

So, you are correct if you want to do this for every product, you need to have a value of "NA" in there for validation purposes and you would want to do it for every product you would remove the IF/ELSE statement and just use this:

<input type="text" name="ns1prefix" size="10" value="NA" />

I hope that makes sense.

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