Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2006
    Posts
    31
    Plugin Contributions
    0

    Default Making Company Field on Create Account Required

    I was wondering if anyone could tell me how I can change the Company field on the Create Account page to be required, I can't seem to find how to do it in the admin panel.... thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Making Company Field on Create Account Required

    includes/modules/YOURTEMPLATE/create_account.php
    line 40 contains:
    PHP Code:
      if (ACCOUNT_COMPANY == 'true'$company zen_db_prepare_input($_POST['company']); 
    change that one line to these several lines:
    PHP Code:
      if (ACCOUNT_COMPANY == 'true') {
        
    $company zen_db_prepare_input($_POST['company']);
        if (
    strlen($company) < 4) {
          
    $error true;
          
    $messageStack->add('create_account'ENTRY_COMPANY_NAME_ERROR);
        }
      } 
    And add a definition for your error message to your
    includes/languages/YOURTEMPLATE/english.php :
    PHP Code:
    define('ENTRY_COMPANY_NAME_ERROR''Please enter a company name.'); 


    Note: the example test above checks that the company name entered is at least 4 characters long.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2006
    Posts
    31
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    Ok, thank you very much that worked great. Now, this may seem ridiculous, but I can NOT figure out how to get the red "Required field" asterisk to appear next to company name. Any hints? Thanks again!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Making Company Field on Create Account Required

    That's in the includes/languages/YOURTEMPLATE/english.php
    PHP Code:
      define('ENTRY_COMPANY_TEXT'''); 
    Just add a * or whatever you want in the quotes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2006
    Posts
    31
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    Found it! Thanks very much!

  6. #6
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    I got the * to show up on the create account form however I edited the code as stated in my : /includes/modules/create_account.php file but it does not do anything when company field is left blank.

    I did not have a creat_account.php file in my /includes/modules/classic foler.

    Do I need to do anything to: templates/template_default/templates/tpl_modules_create_account.php ?

    Is there anything I can do to correct this?

  7. #7
    Join Date
    Jun 2006
    Posts
    17
    Plugin Contributions
    0

    Re: Making Company Field on Create Account Required

    I tried to make the company field required, but it doesnt require the company field. Is this snipit good for zen 1.30?
    Not getting error or anything, works like default.
    I do have the * showing next to the field, but thats about it.

  8. #8
    Join Date
    Feb 2007
    Posts
    212
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    how can i make the address field optional? As i wont really be needing there address info..i want customers to make it a option to enter in there address.

  9. #9
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    Quote Originally Posted by jasbor View Post
    I tried to make the company field required, but it doesnt require the company field. Is this snipit good for zen 1.30?
    Not getting error or anything, works like default.
    I do have the * showing next to the field, but thats about it.
    I believe the following will force the Company field to be mandatory:

    Go to admin/configuration/minimum values and enter a number greater than 0 in "Company."

    Good luck!

    Tim

  10. #10
    Join Date
    Sep 2009
    Location
    Ontario, Canada
    Posts
    23
    Plugin Contributions
    0

    Default Re: Making Company Field on Create Account Required

    I know this is an old thread, but thanks DrByte, your solution was perfect.


 

 

Similar Threads

  1. v139h How to make customer referral a required field during create account?
    By idc1 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Jan 2012, 09:47 PM
  2. State problem with new account (when making state field not required)
    By earmsby in forum Managing Customers and Orders
    Replies: 9
    Last Post: 13 May 2007, 10:04 PM
  3. Company Name is Required field?!?!
    By wickedklown in forum General Questions
    Replies: 10
    Last Post: 1 Feb 2007, 02:52 AM
  4. Company Name: field on create account isn't working
    By immersive in forum General Questions
    Replies: 2
    Last Post: 22 Jan 2007, 05:32 AM
  5. Making the company name 'required' in registration
    By pilot in forum Managing Customers and Orders
    Replies: 5
    Last Post: 20 Jul 2006, 07:47 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR