web2008 Posted March 17, 2019 Share Posted March 17, 2019 This should be simple, but I just can't figure it out. In "configuredomains.tpl" I will display a text that should not be displayed by domain transfers. if register domain - Show text if transfer domain - Don`t show text Is there anyone who can help me with this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 17, 2019 Share Posted March 17, 2019 1 hour ago, web2008 said: This should be simple, but I just can't figure it out. don't get lulled in with that thought - i've wasted a lot of time thinking that with WHMCS! 🙄 1 hour ago, web2008 said: In "configuredomains.tpl" I will display a text that should not be displayed by domain transfers. if register domain - Show text if transfer domain - Don`t show text Is there anyone who can help me with this? this would not be straightforward because that page can, and often will, handle a mix of registrations and transfers on the same page... as an illustration of this, take a look at the Smarty variables available (i've removed some unnecessary ones to make the image simpler) when I view 2 transfers and a registration on the configuredomains template... as you can see, there is no obvious variable to determine if a domain is a transfer or registration... maybe is EPP was required for all transfers, but it isn't for .uk domains - however, the cart session variables will hold which they are! 🙂 to keep things simple, it would be easier to display your custom message inside the {foreach $domains as $num => $domain} loop... you could display it outside of it if you had too, but let's not add any complications like that on a quiet Sunday afternoon! ☺️ {if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if} obviously, where i'm adding "This is a transfer" in the output, you could easily use a Language Override for that if you need the text to be in the client's chosen language. to answer your specific coding question, it would be the code below and you wouldn't need to check if it were a transfer if you're not going to display any text if it is. {if $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if} 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 17, 2019 Author Share Posted March 17, 2019 Thank you very much, this I had never found out for myself! Else, is it possible to combine the code below (which works) with yours? {if strpos( $domainfieldname, "Eier type") !== false and substr($domain.domain,-2) eq "no"} HTML or Text {/if} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 17, 2019 Share Posted March 17, 2019 20 minutes ago, web2008 said: Else, is it possible to combine the code below (which works) with yours? if you say your existing code works, then yes.. {if strpos( $domainfieldname, "Eier type") !== false and substr($domain.domain,-2) eq "no" and $smarty.session.cart.domains.{$num}.type eq "register"} HTML or Text {/if} though your code implies that there is either only one (or it's the last) additional domain field for this TLD or you're outputting inside the $domain.fields foreach... 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 17, 2019 Author Share Posted March 17, 2019 What I am trying to do is that my existing code should display HTML / Text only when registering a new domain, not a transfer. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 17, 2019 Share Posted March 17, 2019 3 minutes ago, web2008 said: What I am trying to do is that my existing code should display HTML / Text only when registering a new domain, not a transfer. then it should work... if it were me, and if this were for the .no TLD, then i'd probably change the substr from -2 to -3 and search for ".no" - because that second condition would match a .casino domain... the first part wouldn't though, so this is largely irrelevant, but it's a good habit to get into to be as accurate as you can with conditions. 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 17, 2019 Author Share Posted March 17, 2019 Sorry, I don't quite think I understand what you mean, because I've tried many combinations who not works. Or, do you think that what I want to do is not possible? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 18, 2019 Share Posted March 18, 2019 16 hours ago, web2008 said: Or, do you think that what I want to do is not possible? well you haven't told me exactly WHAT you are trying to do and, more importantly, WHERE you're trying to do it in the template. it might be useful if you attached your configuredomains.tpl template or PM a link to your site and I can figure out what you're trying to do and where... I didn't particularly like the use of that strpos, but you said it was working - so I let that go. 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 18, 2019 Author Share Posted March 18, 2019 What I want is to show the HTML/Text if TLD=.no and type is "Register" Now HTML/Text is also displayed when type = "Transfer" and works fine for TLD=.no I send you a PM with configuredomains.tpl if you can help. 0 Quote Link to comment Share on other sites More sharing options...
lims Posted March 20, 2019 Share Posted March 20, 2019 (edited) On 3/18/2019 at 11:58 PM, web2008 said: What I want is to show the HTML/Text if TLD=.no and type is "Register" Now HTML/Text is also displayed when type = "Transfer" and works fine for TLD=.no I send you a PM with configuredomains.tpl if you can help. did you mean hide this ? open General Settings >> Domaiin >> UnCheck ==> Allow clients to transfer a domain to you Edited March 20, 2019 by lims 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 20, 2019 Share Posted March 20, 2019 Just now, lims said: did you mean hide this ? no he meant the configure domains stage... 1 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.