Jump to content

Need Custom Hook Created


Recommended Posts

We would like to hire someone to create an action hook for the code below that we would like to be posted to viewcart.tpl. The code prevents a user registering for web hosting with a domain like mywebdomain.com from also using an email that uses mywebdomain.com such as tom@mywebdomain.com.... Our server thinks the domain is hosted locally and sends the emails locally, resulting in non-delivery as the client has yet to transfer their DNS to us. We used to simply paste the code at the top of viewcart.tpl, but this means we have to re-paste it everytime we upgrade.

 

<script type="text/javascript">
 var domains = new Array();
 var products = new Array();
 {foreach from=$domains item=array_item key=id}
 domains['{$id}'] = '{$array_item.domain}';
 {/foreach}
 {foreach from=$products item=array_item key=id}
 products['{$id}'] = '{$array_item.domain}';
 {/foreach}
{literal}
 $(document).ready(function(){
   $("#email").blur(function() {
     if ((jQuery.inArray($('#email').val().toLowerCase().split("@")[1], domains) != "-1") || (jQuery.inArray($('#email').val().toLowerCase().split("@")[1], products) != "-1")) {
       alert("The email you have chosen uses the same domain name as your website, " + $('#email').val().toLowerCase().split("@")[1] + ". Please use a different email account that is not related to the domain name you will be using with LeadPress.");
       $('#email').val('');
     }
   });
 });
{/literal}
</script>

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.

  • 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