Jump to content

Order Link: Preselect subdomain and automatically check plus goto next step


wulfric

Recommended Posts

Thank you very much for taking a moment out of your day to look at this.

 

How do I automatically click the "check" button for the customer when using domain (or subdomain) preselected option on order process?

 

  1. A user would click a link
  2. A domain check would be passed automatically for them on page example/cart.php?a=add&pid=2&domainoption=subdomain&sld=abc
  3. They would end up on page example.com/cart.php?a=confproduct&i=1

Essentially, I want the customer to skip the step that they would type in a domain. I don't want to disable domain registration in product details setup admin area though.

 

  • WHMCS 7.* using stock standard_cart order template.
  • Here is the example link I'm grabbing from the docs: example.com/cart.php?a=add&pid=1&domainoption=subdomain&sld=abc
  • http://docs.whmcs.com/Linking_to_WHMCS > Order Links > Preselected Domain Option

Edited by wulfric
added clarity
Link to comment
Share on other sites

if you take subdomain as an example, you could add the following to the beginning of configureproductdomain.tpl (the include line is already there)...

{include file="orderforms/standard_cart/common.tpl"}

{if $domainoption eq 'subdomain'}
<script>
jQuery(function(){
  jQuery('#useSubdomain').click();
});
</script>
{/if}

and then further down on that page, you would change...

<button type="submit" class="btn btn-primary btn-block">

to...

<button type="submit" class="btn btn-primary btn-block" id="useSubdomain">

It should work for the other domain options too if you check the correct Smarty variable and add an appropriate ID to the button field (if it's not there already).

Link to comment
Share on other sites

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.

×
×
  • 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