Results 1 to 10 of 55

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    28
    Plugin Contributions
    0

    customer issue How can I Make certain Customer Registration fields optional?

    Hi Zen-Cart Gurus,
    My site ( http://games.savagesoftware.com.au ) sells original downloadable games.
    As a result things like the customer's address should not really be mandatory as customers will always be downloading the games they purchase. We may offer hardcopy version of the games at a later time, but for now it is all downloadable

    Essentially the only things that should be mandatory are First Name, Last Name, Dob and the email address and password. Is there an easy way to make the other fields optional?

    Thanks.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,825
    Plugin Contributions
    0

    Default Re: How can I Make certain Customer Registration fields optional?

    Is there an easy way to make the other fields optional?
    First, there are several fields you can completely disable in the Admin> Configuration> Customer Details

    Making the other fields optional will take some work - you can set the minimum required characters to zero, but then you'll also want to disable the javascript verifications and remove the required status from the template.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    May 2006
    Posts
    28
    Plugin Contributions
    0

    Default Re: How can I Make certain Customer Registration fields optional?

    I have disabled everything I can in Admin> Configuration> Customer Details. Where should I start looking to amend the Javascript and the required status?

  4. #4
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    16
    Plugin Contributions
    0

    Default Re: How can I Make certain Customer Registration fields optional?

    I'm having the same issue -- there are fields that need to be made optional, but still included in the form. Notably, any store that wants to take international orders has to make state and postal code optional, since not all countries have either of those. But there doesn't appear to be any way of doing that.

    In an archived thread on this topic, I saw the suggestion of setting the minimum value to 0 as a way of making a field optional, but I tried that and it didn't work. The field still shows up marked as required. Maybe the customer actually could leave it blank anyway, but unless the customer is psychic they aren't going to know that.

    So until this bug is fixed in a future version, I would also appreciate knowing where to start looking to disable the verification so that the store can actually take orders from people in more than one or two countries. Does anyone know how to do this?

  5. #5
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    16
    Plugin Contributions
    0

    Default Re: How can I Make certain Customer Registration fields optional?

    I think I just solved my own problem. :)

    I set the minimum length for province/state and postal code to 0, then (after some poking around to figure out what needed editing) opened up tpl_modules_create_account.php and saved a copy of it in my custom template folder, and commented out line 99:
    Code:
      //  if (zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert" id="stText">' . ENTRY_STATE_TEXT . '</span>';
    And part of line 110 as follows:
    Code:
    <?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"');
    	// (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': '');
    (remembering to put a semicolon at the point where I broke the line.

    I saved the file, went to the create account form, and ta-da! No more "required" asterisk next to those fields. I filled in the form to create a test account, leaving those fields blank, and expecting to still get tripped up by some kind of Javascript verification, and to my astonishment nothing went wrong -- it accepted the form, with no state or postal code.

    So I guess it doesn't use Javascript validation for those specific fields, or at least not if they've already been set to 0 in the Minimum Values area of the admin.

    So... For anyone else who's wanting to make some customer fields optional, apparently this is how you do it.

  6. #6
    Join Date
    May 2006
    Posts
    28
    Plugin Contributions
    0

    Idea or Suggestion Re: How can I Make certain Customer Registration fields optional?

    OK after much prodding and trial and error, I have found that the following files need to be changed to hide any mandatory fields...

    modules/[your mod]/create_account.php
    modules/pages/create_account/jscript_form_check.php
    templates/[your mod]/templates/tpl_modules_create_account.php

    Now on our site, only the Salutation, First & Last Name, Email Address and Password are mandatory and are the only fields that appear.

    It would be nice to have all these fields turn-off and onable via the admin screens.
    Also it would be nice if modules/pages/ and the various sub-directories also adhered to the excellent mod override features as the only way I could fix the Javascript validation was to change the default file directly, which is not ideal, considering a new version of Zen-Cart has just been released.

    I hope this helps someone else.

 

 

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
  •