Jump to content

Require domain name to be registered / transferred for only 1 product


AeonCube

Recommended Posts

Require domain name to be registered / transferred for only 1 product

This is perfect if you have a product that you want to force the user to register or transfer a domain name and not be able to use the name servers option when all other products will have this option.

 

Find the files

Locate configureproductdomain.tpl in the order form template folder you are using:

wwwroot/templates/orderforms/boxes/

wwwroot/templates/orderforms/cart/

wwwroot/templates/orderforms/default/

wwwroot/templates/orderforms/singlepage/

 

Find these lines

{if $owndomainenabled}

<input type="radio" name="domainoption" value="owndomain" id="selowndomain" onclick="document.getElementById('register').style.display='none';document.getElementById('transfer').style.display='none';document.getElementById('owndomain').style.display='';document.getElementById('subdomain').style.display='none';document.getElementById('incart').style.display='none'" /> <label for="selowndomain">{$LANG.orderdomainoption2}</label><br />

{/if}

After you have found these lines you will need to add an if statement around these.

 

The if statement is

{if $pid neq '#PRODUCTID#'}

{/if}

Replace #PRODUCTID# with the product ID found in the WHMCS admin or when you go to order a product you will see the ID (pid) in the URL string. (URL Example: http://www.yourdomain.co.uk/whmcs/cart.php?a=add&pid=1)

 

So the end code will be

{if $pid neq '#PRODUCTID#'}

{if $owndomainenabled}

<input type="radio" name="domainoption" value="owndomain" id="selowndomain" onclick="document.getElementById('register').style.display='none';document.getElementById('transfer').style.display='none';document.getElementById('owndomain').style.display='';document.getElementById('subdomain').style.display='none';document.getElementById('incart').style.display='none'" /> <label for="selowndomain">{$LANG.orderdomainoption2}</label><br />

{/if}

{/if}

Hope this is handy :)
Link to comment
Share on other sites

@Zorro67

Sorry to say the group ID does not get passed through the URL. The only way would to have the group ID to be posted through a form or the URL.

This could be done but would require some code changes to the other order pages. If you would like for me to code this for just send me a PM.

Link to comment
Share on other sites

Thanks, you are right. I tested this against our setup but configureproductdomain.tpl doesn't have the group ID passed to it.

 

This is indicative of other opportunities for customisation. How to pass a standard variable from one page to another?

 

(i'm not a coder by the way).

 

Thanks for the offer, I'll PM you on this topic

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 11 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