Jump to content

HOW TO: Include Terms & Conditions on Order/Register Page instead of a link


wizzy420

Recommended Posts

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

yes correct, so it drags the TOS from the located file and puts it into a scrollable box, is this possible? If so what code would I use?

 

We use that method on other sites within a text box, so as per php functionality, yes it will.

 

I can't see why the fact it's in WHMCS form should make a difference.

 

I would love to be able to display different terms for different product/services

 

That would be good, although possibly difficult if you allow clients to order more than 1 product at a time!!

Link to comment
Share on other sites

Ok this is my complete {if $accepttos} section.

 

Andrew, it includes the link to the TOS file for dynamic updating however I use a windows based server and had to supply the entire file path location in the include statement, but it does work once you get the file location correct.

 

WHMCS 3.8.1

 

{if $accepttos}

<p class="cartsubheading" align="center">Terms and Conditions</p>

<p align=center>You must review the Terms and Conditions below and tick the "I have read and agree to the Hosting<br>Terms and Conditions" box beneath to signify your acceptance of the terms and conditions.</center></p>

<center>

<div style="border:1px black solid; width:600px; height:200px; overflow:auto;">

{include file='CHANGE TO SUIT YOUR FILE LOCATION'}

<p align="center"><input type="checkbox" name="accepttos" id="accepttos" /> <labelfor="accepttos">{$LANG.ordertosagreement}

</label><p>

</div>

</center>

{/if}

Link to comment
Share on other sites

I would love to be able to display different terms for different product/services

That would be good, although possibly difficult if you allow clients to order more than 1 product at a time!!

 

This is true. It wouldn't be so bad if they were just one line sentences where you have to tick to agree. So if it were a hosting account, that TOS tick box would appear, but if it were a web banner design, that TOS would appear. If both services were ordered, both tick boxes would appear. I guess this is sort of different from what this thread is about, but I still like the idea.

Link to comment
Share on other sites

Ok this is my complete {if $accepttos} section.

 

Andrew, it includes the link to the TOS file for dynamic updating however I use a windows based server and had to supply the entire file path location in the include statement, but it does work once you get the file location correct.

 

WHMCS 3.8.1

 

{if $accepttos}

<p class="cartsubheading" align="center">Terms and Conditions</p>

<p align=center>You must review the Terms and Conditions below and tick the "I have read and agree to the Hosting<br>Terms and Conditions" box beneath to signify your acceptance of the terms and conditions.</center></p>

<center>

<div style="border:1px black solid; width:600px; height:200px; overflow:auto;">

{include file='CHANGE TO SUIT YOUR FILE LOCATION'}

<p align="center"><input type="checkbox" name="accepttos" id="accepttos" /> <labelfor="accepttos">{$LANG.ordertosagreement}

</label><p>

</div>

</center>

{/if}

 

Thanks, I will try it later tonight or tomorrow and update you.

Link to comment
Share on other sites

Actually you could have it do more than one.... I think, although I think it would look a little messy.

 

I'm not sure of the code (I do logic Im afraid), but,

 

You have a for each statement wherby it inserts a TOS box for each product displayed, but if product 2 has the same product id then it doesnt.

 

so, my logic way of writing it would be...

 

for each ordered product, insert;

 

{TOS Box}

if product_gid= 1 then include TOS Linux

else

if product_gid = 2 then include TOS Windows

{TOS Box}

 

I know the coding will be wrong, the layout probably is too, heck the values probably are too....

 

But logically I think it may work. Essentially there is only 1 TOS box, but different layout options within the tos bod using if's.

 

All that is required is the bit of code to make it put a box for each product, and I'm guessing there will be something simmalar for the cart page layouts :)

 

OOOhhh I may be on to something there :o)

Link to comment
Share on other sites

  • 2 months later...

Why do we keep using {php}.....{/php}?

I've just read that it's insecure?

Are there any topics in regards to which form of PHP should be used?

 

Wow... i think we've got a bit of work to catch up on, if this is true!

:(

 

Can anyone please verify someones post as working?

i.e. simply display the t's & c's in a text box with scroll bars (external file), where they must click i agree, to proceed?

 

Something simple would be great, rather than adding the I AGREE to the bottom of a text box etc... (which was not successful).

 

Thanks again!

Good to see everyone keen to help each other!

Link to comment
Share on other sites

Can anyone please verify someones post as working?

i.e. simply display the t's & c's in a text box with scroll bars (external file), where they must click i agree, to proceed?

 

Something simple would be great, rather than adding the I AGREE to the bottom of a text box etc... (which was not successful).

 

The tick box at the bottom of the scroll box works perfectly fine for me.

 

Regards, David.

Link to comment
Share on other sites

  • 2 weeks later...

{include file="terms.txt"}

or

{include file='terms.txt'}

 

This does not seem to work (within a template .tpl file)

I thought it was bad to mix <p> and <div> tags...?

As i thought "document type" (at the top of a document) was meant to specify which iso is in use.

Therefore i thought you "weren't" meant to mix iso standards..?

Link to comment
Share on other sites

This token expired error thing is really annoying...

Once again, i lose a large post, where i'm trying to help everyone else.....

This time i will attempt to re-create it.... again!

 

------------------ Solution Working & Resolved! ---------------------

 

You can't use "include file" or "file_get_contents" etc...

None of these are compatible with { } (smarty templates)

 

The solution follows.

 

REGISTER + ORDERING TERMS & CONDITIONS

Replace your code (as per the instructions on the 1st and 2nd page).

 

{if $accepttos}
<p><strong>TERMS AND CONDITIONS OF SERVICE</strong></p><p align="left">To continue, you must tick "I AGREE", and click on the "Continue" button.... enter your own friendly text here.....</p>

   <div align="center"><p><div align="left" style="text-align:left; border:1px black solid; width:600px; height:350px; overflow:auto; padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:5px;">
          <p align="Left"><div align="center"><b>COMPANY NAME'S PRODUCT & SERVICE TERMS AND CONDITIONS</b></div><br />{$LANG.ordertosagreement}
          <p align="center"><labelfor="accepttos"><input type="checkbox" name="accepttos" id="accepttos" />  I AGREE</label></p>

   	<!-- #### INSERT FROM FILE #### -->
   	{fetch file='filename.txt'}

   </div></p></div>
{/if}

 

For more information on Smarty Templates and this function, please visit here: http://www.smarty.net/manual/en/language.function.fetch.php

 

Enjoy this problem finally resolved!

 

Emma

(:

Link to comment
Share on other sites

i'll send you the bill.... (;

 

- 28th March - 17th April @ $150/hr (Coding - Testing - Pulling out Hair!)

- 8 broken keyboards (munched)

- 11 broken mice (squashed)

- 6 bottles of wine (empty) d:

 

Heheh..

(:

Link to comment
Share on other sites

I would think an extra staement just above (and replacing) the filename statement would suffice eg

 

{if $gid eq "001" or $gid eq "002"}{fetch file='filename1.txt'}{else}

 

{if $gid eq "004" or $gid eq "003"}{fetch file='filename2.txt'}{else}

 

{fetch file='filename3.txt'}{/if}

 

Although my hack would give you either, or, not multiple TOS

 

And I haven't checked whther the $gid variable is carried to the checkout page . ;)

Link to comment
Share on other sites

I would think an extra staement just above (and replacing) the filename statement would suffice eg

 

{if $gid eq "001" or $gid eq "002"}{fetch file='filename1.txt'}{else}

 

{if $gid eq "004" or $gid eq "003"}{fetch file='filename2.txt'}{else}

 

{fetch file='filename3.txt'}{/if}

 

Although my hack would give you either, or, not multiple TOS

 

And I haven't checked whther the $gid variable is carried to the checkout page . ;)

 

let us know if that works cause if so this is really gonna be an awesome hack for me, then I dont have to use some 10,000 word TOS to insure it encompases everything

Link to comment
Share on other sites

i just can't beleive the fact, that no one else mentioned the fact that Include doesn't work inside Smarty Templates... I.e. has to be in a PHP file, not TPL file...

Who says it doesn't work!!

 

It does work in a template... so long as you have the correct path to the file to be included which is relative to the templates directory.

Link to comment
Share on other sites

let us know if that works cause if so this is really gonna be an awesome hack for me, then I dont have to use some 10,000 word TOS to insure it encompases everything

 

I will, but I'm not going to try it until V4 Stable is released.

Link to comment
Share on other sites

so you're telling me that this would work?:

 

{include file='http://www.whmcs.com/text_file.txt'}

 

?

As it won't work, either with " or '...

 

However when i changed this to:

{fetch file='http://www.whmcs.com/text_file.txt'}

 

Not a problem. Worked first time, and every time...

 

For it to work without the FQDN, what path is it referring to (by default)?

../%template%/*.* ?

or

../whmcs/*.* ?

 

 

Thank you for your time and effort. (:

Link to comment
Share on other sites

so you're telling me that this would work?:

 

{include file='http://www.whmcs.com/text_file.txt'}

 

?

As it won't work, either with " or '...

 

However when i changed this to:

{fetch file='http://www.whmcs.com/text_file.txt'}

 

Not a problem. Worked first time, and every time...

 

For it to work without the FQDN, what path is it referring to (by default)?

../%template%/*.* ?

or

../whmcs/*.* ?

 

 

Thank you for your time and effort. (:

 

No that wont work as a url

 

Have you actually looked at smarty.net at the docs?

 

As per your example, that txt file is in the whmcs root (would be better in your template theme dir)

 

{include file='../text_file.txt'}

 

As I have already said "relative to the templates directory"

 

FLIP: By the way, a friendly warning, all downloads, links and images of any of my mods that you have posted on the pirate forum that you as Co-Administrator of are to be REMOVED IMMEDIATELY or action will follow.

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