Jump to content

Order Forms - Customisation


nathanb

Recommended Posts

Hi all,

I have been looking online on how to remove "root password" and the nameserver sections from the server order form. I changed the class to hidden but that just leaves a bunch of whitespace which isn't the best looking. I have attached an image. 

All I need is "Hostname" that will add the hostname to the order. Everything else is done via configurable options. 

Any help is greatly appreciated 🙂

Thanks,
Nathan

Screenshot at Jul 22 19-16-17.png

Link to comment
Share on other sites

Hi Nathan,

20 hours ago, nathphotographs said:

I have been looking online on how to remove "root password" and the nameserver sections from the server order form. I changed the class to hidden but that just leaves a bunch of whitespace which isn't the best looking.

if using CSS isn't an option, usually because WHMCS haven't added unique IDs or names to elements, then the next option is to edit the template...

from your screenshot, that should be /templates/orderforms/standard_cart/configureproduct.tpl and specifically the block of code below....

                        {if $productinfo.type eq "server"}
                            <div class="sub-heading">
                                <span>{$LANG.cartconfigserver}</span>
                            </div>
                            <div class="field-container">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="inputHostname">{$LANG.serverhostname}</label>
                                            <input type="text" name="hostname" class="form-control" id="inputHostname" value="{$server.hostname}" placeholder="servername.yourdomain.com">
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="inputRootpw">{$LANG.serverrootpw}</label>
                                            <input type="password" name="rootpw" class="form-control" id="inputRootpw" value="{$server.rootpw}">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="inputNs1prefix">{$LANG.serverns1prefix}</label>
                                            <input type="text" name="ns1prefix" class="form-control" id="inputNs1prefix" value="{$server.ns1prefix}" placeholder="ns1">
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="inputNs2prefix">{$LANG.serverns2prefix}</label>
                                            <input type="text" name="ns2prefix" class="form-control" id="inputNs2prefix" value="{$server.ns2prefix}" placeholder="ns2">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {/if}

so assuming those 3 fields aren't required, removing their 3 div blocks should give a cleaner look.

Link to comment
Share on other sites

Hi, 

Thanks for the reply. 

2 minutes ago, brian! said:

so assuming those 3 fields aren't required, removing their 3 div blocks should give a cleaner look.

I tried this originally and it messed up the entire page. I tried to remove one of them and it still seemed to "corrupt" the page. Everything doesn't align and is where it wants to be. I'm thinking it could be because its a default WHMCS template so its expecting the sections but not entirely sure. 

Thanks,
Nathan

Link to comment
Share on other sites

On 23/07/2019 at 08:04, nathphotographs said:

I tried this originally and it messed up the entire page.

it shouldn't have - for example, if I remove the 3 divs...

                        {if $productinfo.type eq "server"}
                            <div class="sub-heading">
                                <span>{$LANG.cartconfigserver}</span>
                            </div>
                            <div class="field-container">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="inputHostname">{$LANG.serverhostname}</label>
                                            <input type="text" name="hostname" class="form-control" id="inputHostname" value="{$server.hostname}" placeholder="servername.yourdomain.com">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {/if}

I get this...

7sEYcDx.png

with recent versions, there are additional checks and the fields you removed are effectively required... so I assume if you're not seeing that error when you try to continue the order, you're possibly using an older release of WHMCS.. if you're using v7.7+, the workaround would be to make them hidden input fields with random values in them (as I think has been discussed elsewhere in another thread).

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