JelleG Posted August 22, 2016 Share Posted August 22, 2016 (edited) Hi, Inside my /orderforms/template/domainoptions.tpl I want to check if the template is "adddomain". I want to check if the template where the domainoptions are displayed is /orderforms/template/adddomain.tpl How can I achieve that? Or can I achieve that by using a custom titlename? So how can I add a custom pagetitle to the adddomain.tpl? I want to use a code like this in my domainoptions.tpl: {if $pagetitle eq 'adddomain'} <form class="domainresults domainfrm" action="cart.php?a=add&domain=register" method="post"> {/if} Edited August 22, 2016 by JelleG 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 22, 2016 Share Posted August 22, 2016 This could happend if domainoptions.tpl had adddomain.tpl included. But they are two different templates that are been loaded by cart 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2016 Share Posted August 22, 2016 I suspect the only way (well there may be others but this is the only one occurring to me!) is to see if the referring URL contains a product ID... if it does, then it must be coming from configureproductdomain.tpl; if it doesn't, then it must be adddomain.tpl - I don't think there's a 3rd option. to prove this, add the following to the top of domainoptions.tpl and go through the initial order process steps of registering a domain and adding a product with required domain and the output should be correct for each. {if !$smarty.server.HTTP_REFERER|strstr:'pid='} adddomain {else} configureproductdomain {/if} 0 Quote Link to comment Share on other sites More sharing options...
JelleG Posted August 22, 2016 Author Share Posted August 22, 2016 (edited) I suspect the only way (well there may be others but this is the only one occurring to me!) is to see if the referring URL contains a product ID... if it does, then it must be coming from configureproductdomain.tpl; if it doesn't, then it must be adddomain.tpl - I don't think there's a 3rd option. to prove this, add the following to the top of domainoptions.tpl and go through the initial order process steps of registering a domain and adding a product with required domain and the output should be correct for each. {if !$smarty.server.HTTP_REFERER|strstr:'pid='} adddomain {else} configureproductdomain {/if} Thanks for your reply! Tried that, works great! I have somethings a other strange thing. When I check a domain, it says it is already registered, but instead the domain is still available. But when I directly check it again, it works well and I can register it. How can I solve this issue? Edited August 22, 2016 by JelleG 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2016 Share Posted August 22, 2016 i've seen that occur previously - often it can be a caching issue within WHMCS... or you're hitting whois lookup limits and getting false positives. what I tend to do, when testing domainchecker (or the cart+domain search), is to go slower and try not to do too many searches too quickly/often... sometimes to ensure I do, I enable captcha and/or reduce the number of suggestion tlds. it can be a real pain with testing domain search templates/hooks on WHMCS, especially when you're making multiple minor tweaks to the code and start getting incorrect/inconsistent answers. 0 Quote Link to comment Share on other sites More sharing options...
JelleG Posted August 22, 2016 Author Share Posted August 22, 2016 i've seen that occur previously - often it can be a caching issue within WHMCS... or you're hitting whois lookup limits and getting false positives. what I tend to do, when testing domainchecker (or the cart+domain search), is to go slower and try not to do too many searches too quickly/often... sometimes to ensure I do, I enable captcha and/or reduce the number of suggestion tlds. it can be a real pain with testing domain search templates/hooks on WHMCS, especially when you're making multiple minor tweaks to the code and start getting incorrect/inconsistent answers. Thanks! So the only solution to the problem, will be to reduce the number of searches? Inside the cart we do not use suggestion tlds, so that should not be the problem. There is no workaround to solve this? Because when the cart is used by many customers at the same time, the error will also appear, I guess . 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2016 Share Posted August 22, 2016 So the only solution to the problem, will be to reduce the number of searches?Inside the cart we do not use suggestion tlds, so that should not be the problem. without seeing the problem occur on your site, it's difficult to say... (and I know how hard it can be to reproduce it on demand!) - certainly, if you aren't using suggestions, then whois limits (in terms of quantity) shouldn't be the issue - frequency might be an issue if you were doing multiple searches quickly. There is no workaround to solve this? depends on the cause. Because when the cart is used by many customers at the same time, the error will also appear, I guess . i've ran into during testing (ob v5 & 6) - but never heard of it occurring live for customers... probably because they aren't searching as quick as we would during testing. 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.