Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    9
    Plugin Contributions
    0

    Default Require a referral code on signup?

    I'm not sure if this is in the right area, but I figure it's close.

    I have a client who is starting up a new business, and she's getting a bunch of people to promote her product/site. I've added the Referral Code to the New Customer signup form, but it's not enough for her that it's there, she also wants it to be a required field (IE: I guess so people don't forget to fill it in. If they weren't referred by anyone, then they should enter "none" or something like that).

    So my question is, how do I make the Referral Code a required field? Is that even possible?

  2. #2
    Join Date
    Dec 2005
    Location
    SWFL
    Posts
    469
    Plugin Contributions
    0

    Default Re: Require a referral code on signup?

    Disclaimer -- I'm not a programmer, so you'll need to put your head together with someone who is if you need more help.

    I believe the file you have to edit is: includes/templates/template_default/templates/tpl_modules_create_account.php

    You'd have to save it as includes/templates/CUSTOM/templates/tpl_modules_create_account.php

    where CUSTOM is your template override folder.

    You would need to add code to force the referral. (You'd need to set the switch in Configuration --> Customer Details too.)


    The code referring to referrals is towards the bottom.

    HTML Code:
    <?php
      if (CUSTOMERS_REFERRAL_STATUS == 2) {
    ?>
    <fieldset>
    
    <legend><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></legend>
    <label class="inputLabel" for="customers_referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>
    <?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '15') . ' id="customers_referral"'); ?>
    <br class="clearBoth" />
    </fieldset>
    Exactly WHAT you have to add -- I suggest looking at switches for other required fields, like name, etc. and using those to try it out.

    And...If I'm totally wrong I'm sure someone will correct me. *LOL* (off to get more coffee...)

    HTH,
    Lesli in SW Florida ~ writer, teacher, and dodging hurricanes!

  3. #3
    Join Date
    Dec 2005
    Location
    SWFL
    Posts
    469
    Plugin Contributions
    0

    Default Re: Require a referral code on signup?

    Oops -- meant to add you'll also want to edit the language file for that field so it says something like "Enter code or else enter NONE" or something like that so they don't get frustrated.
    Lesli in SW Florida ~ writer, teacher, and dodging hurricanes!

  4. #4
    Join Date
    Apr 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Require a referral code on signup?

    Thanks for the tip, I've gotten that far, and I've got the form to *look* like it's required... But I was hoping someone knew precisely where the switch is to MAKE it required.

    Any thoughts? I'll poke around with it, and post any findings I have, in case someone else needs the info later.

  5. #5
    Join Date
    Apr 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Require a referral code on signup?

    Ok, so I found the javascript file that I need to change in /includes/modules/pages/create_account/jscript_form_check.php and I've added a new line at the bottom:

    Code:
    check_input("customers_referral", 0, "<?php echo ENTRY_CUSTOMERS_REFERRAL_ERROR; ?>");
    Which should work... Except any changes I make the the file are ignored. I know I'm probably doing something wrong here, but I'm not sure what.

    I've double-checked that it's going to the server, and I've tried adding comments to see if the changes are taking... I've even tried deleting everything in the file, and re-uploading it, and there are no changes to the login page.

    Any thoughts? Thanks in advance.

  6. #6
    Join Date
    Apr 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Require a referral code on signup?

    Ok, nevermind, I figured out why the changes weren't being reflected.

    There are two sets of JS files. One here:

    /includes/modules/pages/create_account/

    and

    /includes/modules/pages/login/

    The page I was trying to change is actually the "login" page... So, that's sorted.

    So, the Javascript requires the variable, but I don't think the store code requires is beyond that. If Javascript was disabled, they'd be able to pass thru without entering a referral code.

    It's not ideal, but for simplicities sake, I'll leave it. The user has been told it's required, and Javascript forces it to be required. I think it might be enough.

 

 

Similar Threads

  1. Can I require entering a referral code to create account?
    By tamadrummer1975 in forum General Questions
    Replies: 1
    Last Post: 2 Aug 2011, 12:36 AM
  2. Can I require a 3 digit referral code to creat account?
    By tamadrummer1975 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 20 Jul 2011, 09:46 PM
  3. referral code question
    By Rasyr in forum Managing Customers and Orders
    Replies: 7
    Last Post: 30 Apr 2009, 04:41 PM
  4. free gift by referral code
    By k4satin in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 9 Nov 2008, 07:42 PM
  5. Customer Referral Code questions
    By Rasyr in forum General Questions
    Replies: 0
    Last Post: 11 Oct 2008, 09:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg