Jump to content

Prefill ajax order form with domain name


renegadesk

Recommended Posts

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

Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...

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