Can First Name/Last Name be removed or made optional?

Discussion in 'Templates customization' started by tarfos, Dec 24, 2008.

  1. tarfos

    tarfos New Member

    Joined:
    Dec 18, 2008
    Messages:
    26
    We are using aMember on a Web site where members may wish to remain anonymous, even from us. On the other hand, we need to get paid, at least for non-free products.

    Is it possible to make the first and last name fields optional, or is that required for all the payment gateways? If it's required, we'll keep them, but it might increase signups for us if the names are optional. For instance, with PayPay I believe that the only require the users e-mail address (PayPal account).

    Are there other payment gateways (common ones, not oddball ones) that require that the name be entered on our site?
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Well, you could modify the various templates (with the exception of singup) to hide the field from view?
  3. tarfos

    tarfos New Member

    Joined:
    Dec 18, 2008
    Messages:
    26
    Does aMember, or any plug-ins, depend on those fields being present? If they are hidden from view, will it break something? If we hid them, would we have to supply random dummy values behind the scenes or something? Can we make them optional, rather than hiding them?

    Or is this not a good idea in the first place?
  4. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    By hiding them I am suggesting something a bit less complex such as marking the field as not visible or even applying a style of white text on white background.

    I guess it depends on how critical TRUE anonymity is to you and your site because then you need to discuss the fact that details are in logs (payment transaction logs) as well as payment records, etc.
  5. tarfos

    tarfos New Member

    Joined:
    Dec 18, 2008
    Messages:
    26
    Can we simply mark the fields as optional in the form?

    Will blank name fields break any payment gateways (or aMember itself)?
  6. webguy22

    webguy22 aMember Pro Customer

    Joined:
    Apr 7, 2008
    Messages:
    18
    I'd like to know the answer too. I tried to just comment out the section asking for the names in signup.html in the templates folder. Figured this wouldn't work but wanted to see what would happen. When you submit the form it still comes back and says to enter first and last name. Not sure which call is checking for names. Thanks
  7. greenfin1

    greenfin1 New Member

    Joined:
    Feb 24, 2009
    Messages:
    2
    i think marking the fields optional can solve this, or there are options in the templets through you can remove what ever your want to..
  8. webguy22

    webguy22 aMember Pro Customer

    Joined:
    Apr 7, 2008
    Messages:
    18
    <tr>
    <th width="40%">#_TPL_SIGNUP_NAME# *<br />
    <div class="small">#_TPL_SIGNUP_NAME_1#</div></th>
    <td nowrap="nowrap"><input class="required" type="text" name="name_f" value="{$smarty.request.name_f|escape}" size="15" />
    <input type="text" class="required" name="name_l" value="{$smarty.request.name_l|escape}" size="15" />
    </td>
    </tr>

    The above is from templates\signup.html

    Even if you remove class="required", when the user submits the form an error still pops up in red asking to enter names.

    * Please enter your First Name
    * Please enter your Last Name

    So where downstream is this check taking place? I'm sure there is something else that needs to be turned off, changed, or commented out. Just can't seem to find it. Thanks
  9. msrsek

    msrsek New Member

    Joined:
    Oct 17, 2008
    Messages:
    16
    I haven't tried it, but seems you could modify the signup.html template to make the fields hidden, and provide them default values, like this:

    modify this:
    <input class="required" type="text" name="name_f" value="{$smarty.request.name_f|escape}" size="15" />

    to read:
    <input type="hidden" name="name_f" value="fakeLastName" size="15" />

    and same for last name.

    Hope this helps
  10. miso

    miso aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    543
    You could do that... and just give the First Name/Last Name values with User/Anonymous for all users, and then allow them to change that if they wish to from the "edit profile" page itself.

    If you truly want to hide those fields and never ask for them, you'd have to edit signup.html/signup.php and remove all the checks for first name and last name, as well as edit profile.html/profile.php in the same manner too.
  11. webguy22

    webguy22 aMember Pro Customer

    Joined:
    Apr 7, 2008
    Messages:
    18
    Thanks folks!
  12. fertilepress

    fertilepress Member

    Joined:
    Dec 6, 2008
    Messages:
    96
    I want to do something similar. But instead of removing the names, I want to remove the need for membership type and payment system. This is how the signup.html section reads:

    Code:
    tr>
    
        <th>#_TPL_SIGNUP_MEMB_TYPE# *</th>
    
        <td>
    
        {foreach from=$products item=p} 
    
        {if count($products)>1}
    
        {if $config.select_multiple_products}
    
        <input class="required" type="checkbox" id="product{$p.product_id}" name="product_id[]" value="{$p.product_id|escape}"
    
            {if in_array($p.product_id, (array)$smarty.request.product_id)}checked="checked"{/if}
    
            />
    
        {else}
    
        <input class="required"  type="radio" id="product{$p.product_id}" name="product_id" value="{$p.product_id|escape}"
    
            {if $p.product_id == $smarty.request.product_id }checked="checked"{/if}
    
            />
    
        {/if}{* end if $config.select_multiple_products *}
    
        {else}
    
        <input type="hidden" id="product{$p.product_id}" name="product_id" value="{$p.product_id}" />
    
        {/if}   
    
            <label for="product{$p.product_id}"><b>{$p.title}</b> ({$p.terms})<br />
    
            <span class="small">{$p.description}</span></label><br />
    
        {if $p.price <= 0.0 }     {assign var="paysys_id_not_required" value="1"}    {/if}        
    
        {/foreach}
    
        </td>
    
    </tr>
    
    
    
    {* Select Payment System in same way, only if its count > 1 *}
    
    {if $smarty.request.hide_paysys }
    
        <input type="hidden" name="paysys_id" value="{$smarty.request.hide_paysys|escape}">
    
        <input type="hidden" name="hide_paysys" value="{$smarty.request.hide_paysys|escape}">
    
    {else}
    
    {if $config.product_paysystem}
    
    {assign var="paysys_id_not_required" value="1"}
    
    {else}
    
    <tr>
    
        <th>#_TPL_SIGNUP_PAYSYS# *</th>
    
        <td>
    
            {foreach from=$paysystems item=p} 
    
            {if count($paysystems)>1}
    
            <input type="radio" id="paysys_id{$p.paysys_id}" name="paysys_id" value="{$p.paysys_id|escape}"
    
                {if $p.paysys_id eq $smarty.request.paysys_id }checked{/if} />
    
            {else}            
    
            <input type="hidden" id="paysys_id{$p.paysys_id}" name="paysys_id" value="{$p.paysys_id|escape}" />
    
            {/if}<label for="paysys_id{$p.paysys_id}"><b>{$p.title}</b>
    
                <span class="small">{$p.description}</span></label><br /><br />
    
            {/foreach}
    
        </td>
    
    </tr>
    
    {/if}
    
    {/if}
    
    I've tried commenting out this block of code. It eliminates those fields from the signup form, but returns with the following errors.

    Thanks!

    renee
  13. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    removed to avoid confusion with the much simpler solution below :)
  14. miso

    miso aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    543
    there's a simpler way, guys...

    just add style="display:none;" to TR tags in those rows where membership type and payment system are defined... that way you don't mess up the requirements for amember to run properly, and you get to hide those fields from the end user ;)
  15. codeispoetry

    codeispoetry aMember Pro Customer

    Joined:
    Jan 12, 2009
    Messages:
    336
    I agree with miso.

    Great suggestion, miso!

    Lee
  16. fertilepress

    fertilepress Member

    Joined:
    Dec 6, 2008
    Messages:
    96
    Thanks for the help. It worked perfectly for the payment system, but I'm still getting this error about the membership type:

    Here's that section of the member.html template

    Code:
    <tr style="display:none">
    
        <th>#_TPL_SIGNUP_MEMB_TYPE# *</th>
    
        <td>
    
        {foreach from=$products item=p} 
    
        {if count($products)>1}
    
        {if $config.select_multiple_products}
    
        <input class="required" type="checkbox" id="product{$p.product_id}" name="product_id[]" value="{$p.product_id|escape}"
    
            {if in_array($p.product_id, (array)$smarty.request.product_id)}checked="checked"{/if}
    
            />
    
        {else}
    
        <input class="required"  type="radio" id="product{$p.product_id}" name="product_id" value="{$p.product_id|escape}"
    
            {if $p.product_id == $smarty.request.product_id }checked="checked"{/if}
    
            />
    
        {/if}{* end if $config.select_multiple_products *}
    
        {else}
    
        <input type="hidden" id="product{$p.product_id}" name="product_id" value="{$p.product_id}" />
    
        {/if}   
    
            <label for="product{$p.product_id}"><b>{$p.title}</b> ({$p.terms})<br />
    
            <span class="small">{$p.description}</span></label><br />
    
        {if $p.price <= 0.0 }     {assign var="paysys_id_not_required" value="1"}    {/if}        
    
        {/foreach}
    
        </td>
    
    </tr> 
    
    
    
    {* Select Payment System in same way, only if its count > 1 *}
    
    {if $smarty.request.hide_paysys }
    
        <input type="hidden" name="paysys_id" value="{$smarty.request.hide_paysys|escape}">
    
        <input type="hidden" name="hide_paysys" value="{$smarty.request.hide_paysys|escape}">
    
    {else}
    
    {if $config.product_paysystem}
    
    {assign var="paysys_id_not_required" value="1"}
    
    {else}
    
    <tr style="display:none"> 
    
        <th>#_TPL_SIGNUP_PAYSYS# *</th>
    
        <td>
    
            {foreach from=$paysystems item=p} 
    
            {if count($paysystems)>1}
    
            <input type="radio" id="paysys_id{$p.paysys_id}" name="paysys_id" value="{$p.paysys_id|escape}"
    
                {if $p.paysys_id eq $smarty.request.paysys_id }checked{/if} />
    
            {else}            
    
            <input type="hidden" id="paysys_id{$p.paysys_id}" name="paysys_id" value="{$p.paysys_id|escape}" />
    
            {/if}<label for="paysys_id{$p.paysys_id}"><b>{$p.title}</b>
    
                <span class="small">{$p.description}</span></label><br /><br />
    
            {/foreach}
    
        </td>
    
    </tr>
    
    {/if}
    
    {/if}
    renee
  17. fertilepress

    fertilepress Member

    Joined:
    Dec 6, 2008
    Messages:
    96
    It worked! I used the Signup Link Wizard and now it works like a charm. Thanks so much for your help. :)

    renee
  18. gibban

    gibban New Member

    Joined:
    Jul 10, 2009
    Messages:
    1
    Is there no Amember admin who can andswer tarfos qustion?
    How to change the fieldes First name and Surname from requiered to optional
    Not hide them just change the value.

Share This Page