Jump to content

viewcart.tpl order form customisation help


Recommended Posts

Hello Everyone

 

I am new to the forums and am still learning the WHMCS system. I need some help. I want to add some custom fields to the new customer form that the clients fill out in viewcart.tpl. I created the custom fields in the client area. The fields are 'Middle Name', 'ABN/ACN', 'Number of email addresses', 'website url', 'domain names to filter' and 'how did you find us'. Then I went to edit the form table in viewcart.tpl. I added one field first to the form table to test to see if it worked by putting this line in:

 

<tr><td class="fieldlabel">{$LANG.clientareamiddlename}</td><td class="fieldarea">{if $loggedin}{$clientsdetails.middlename}{else}<input type="text" name="middlename" tabindex="3" style="width:80%;" value="{$clientsdetails.middlename}" />{/if}</td></tr>

 

Then I went to check it and the field was there but it was unlabeled, just a blank text box. Could some please help me? I am still trying to understand how to customize template pages. :)

 

I know there is another way to do it without any template customization which is adding custom fields to the products and selecting show on order form. I do not want to use this method though cause it puts the custom fields on a separate page titled configure instead of the page titled review and checkout. :?:

 

- - - Updated - - -

 

Oh here is my WHMCS url: www.paypanel.net.au

Link to comment
Share on other sites

client custom fields should be added to the bottom of the form automatically by whmcs - you shouldn't have to edit the template to show them - unless you're either using a custom template that doesn't include the custom fields code or you want to change the order in which they're being shown (which you probably will do).

 

your website seems to be down so I couldn't check it.

 

but to answer your question about why the above code was unlabelled, it will probably be because $LANG.clientareamiddlename has no corresponding entry in the language files.

 

this could be fixed by using Language Overrides and the following page will take you through the process step by step - http://docs.whmcs.com/Language_Overrides

 

it shouldn't be necessary to use these in this situation, but it might be a useful read for you at some later point.

 

to manually add a custom field in a specific position, you would need to modify the template and use code similar to that posted in the thread below...

 

http://forum.whmcs.com/showthread.php?73387-Placing-individual-custom-client-fields-on-the-registration-form&p=332402#post332402

 

btw - with regards to "how did you find us", there is another way to do this by product custom fields - http://blog.whmcs.com/?t=66223

 

I know that you don't want to use custom fields in your products, but I added the link in case others reading this thread wanted to use it.

Link to comment
Share on other sites

I forgot that the website isn't open to the public yet. It is behind a firewall that only a few IPs can access including mine. I figured out how to make them show up on the order form. I just had to tick the show on order form button in the field options. I will just leave them as they appear for now. I won't worry about manually adding custom fields for now but thanks for your help anyway.

:)

 

- - - Updated - - -

 

One last thing I forgot, with payment method fields like credit card details do you have to enable a payment gateway before any options appear under 'Payment Method' in viewcart.tpl under the form?

 

:-)

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