ChrisGooding Posted January 11, 2009 Share Posted January 11, 2009 Anyone got any idea if this would work? {php} include('location/tos.php'); {/php} Are you meaning inside the afore mentioned box? 0 Quote Link to comment Share on other sites More sharing options...
AndrewMKP Posted January 12, 2009 Share Posted January 12, 2009 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? 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted January 12, 2009 Share Posted January 12, 2009 I would love to be able to display different terms for different product/services 0 Quote Link to comment Share on other sites More sharing options...
ChrisGooding Posted January 12, 2009 Share Posted January 12, 2009 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!! 0 Quote Link to comment Share on other sites More sharing options...
dmc_ss Posted January 12, 2009 Share Posted January 12, 2009 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} 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted January 12, 2009 Share Posted January 12, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
AndrewMKP Posted January 13, 2009 Share Posted January 13, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
ChrisGooding Posted January 13, 2009 Share Posted January 13, 2009 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 ) 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 28, 2009 Share Posted March 28, 2009 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! 0 Quote Link to comment Share on other sites More sharing options...
dmc_ss Posted March 29, 2009 Share Posted March 29, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
lane Posted April 10, 2009 Share Posted April 10, 2009 Thanks for the share 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 16, 2009 Share Posted April 16, 2009 {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..? 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 16, 2009 Share Posted April 16, 2009 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 (: 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted April 16, 2009 Share Posted April 16, 2009 Thanks Emma. 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 16, 2009 Share Posted April 16, 2009 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.. (: 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted April 16, 2009 Share Posted April 16, 2009 Do you think it would be possible to have different files fetched for different product groups? 0 Quote Link to comment Share on other sites More sharing options...
moonsoft Posted April 16, 2009 Share Posted April 16, 2009 im not really that great with php but couldn't use you some kind of if then or var setting to recognize the product number and if it matches include a different file for tos? 0 Quote Link to comment Share on other sites More sharing options...
Zorro67 Posted April 16, 2009 Share Posted April 16, 2009 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 . 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted April 17, 2009 Share Posted April 17, 2009 Thanks guys 0 Quote Link to comment Share on other sites More sharing options...
moonsoft Posted April 17, 2009 Share Posted April 17, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 17, 2009 Share Posted April 17, 2009 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... 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 17, 2009 Share Posted April 17, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted April 17, 2009 Share Posted April 17, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 18, 2009 Share Posted April 18, 2009 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. (: 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 18, 2009 Share Posted April 18, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.