Hey, I'm trying to customise the AJAX order form so that I can send domain names from other pages to pre-fill the AJAX domain name search. Basically all I am trying to to is GET a variable from the URL and pass it to the domain name search value="$var" field.
If I manually input a domain in to the domainconfig.tpl template file value field then it works exactly as I want, the problem is trying to get the variable from the url to pass it to this value field.
The variable that I'm working with is prefilldomain so in the url I'd have http://www.mydomain.com/myaccount/order/?pid=1&skip=1&prefilldomain=test.com.au
I've tried several different methods to catch this variable.
Using Smarty's inbuilt method in domainconfig.tpl
I've tried to use {smarty.get.prefilldomain} which doesn't work. However, this does work on the master.tpl page, which unfortunately is of no use in this situation as I need to be able to work with it in domainconfig.tpl
Using /order/index.php
I added a get function and added it to the template variable for the domainconfig.tpl echo statement within index.php
In index.php on line 71 I added
$prefilldomain = $_GET['prefilldomain'];
Then, just before
echo processSingleTemplate($tempsdir."domainconfig.tpl",$templatevars);
I added
$templatevars['prefilldomain'] = $prefilldomain;
and then in domainconfig.tpl I added this to the input field
value="{$prefilldomain}"
Which doesn't work. However, If I change the $prefilldomain variable from a GET request to an actual domain name e.g. anothertest.com.au it works fine, although obviously does not take this value from the URL as I need it to.
Would be really great if I could have some help with this. The templating system is great and it seems like I must be missing something very small in order to get this working for me.
Any help would be much appreciated.
Thanks