Different Fields for different memberships

Discussion in 'Templates customization' started by robdavies, Feb 28, 2006.

  1. robdavies

    robdavies New Member

    Joined:
    Feb 28, 2006
    Messages:
    6
    Hi
    I have a basic free membership and several products defined for which I only need name and email address.
    However, now I come to the stage where I need to add products which require additional information (some need phone number, some postal address) but I don't want to switch these fields on for the products that don't need them as we've found in the past asking for too much information unneccesarily loses us a lot of sign ups.
    How can I have the address fields or certain additional fields show up only for certain products?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    It is possible to do by template modification.

    Put your free product into price_group = -12 (in product settings)
    Access your free signup page as http://yoursite.com/amember/signup.php?price_group=-12

    Edit file amember/templates/signup.html
    and replace lines
    PHP:
    {$additional_fields_html}
    to these:
    PHP:
    {if $smarty.request.price_group ne "-12"}
    {
    $additional_fields_html}
    {/if}
  3. robdavies

    robdavies New Member

    Joined:
    Feb 28, 2006
    Messages:
    6
    how will this work?

    I get the basic idea, but I have a few questions.
    Using three basic products as examples, let me explain what I need to do:

    product 1 - basic signup - allows users to access information and sign up to additional products. Requires email address and name only, email address for verification. It's the only product to appear on the basic signup page. It has price group 1 and scope all.

    product 2 is the next natural stage. It can be ordered via the member panel or via signup page. I've done this using the -1000 piece of code I saw on another thread (sorry I don't seem to be able to find it again now I want to point to it) that makes products with a - number above 1000 show up on the member panel but not on the signup page. It also has scope all and requires a phone number to be entered but not full address details.

    product 3 and onwards require full address details. Some are scope all, some signup only, and all have various negative numbers. (I know this might seem a strange way of doing it but after various attempts to get the right configuration, this turned out to be the best)

    So my question is this:

    Using the example you gave below,

    Code:
    {if $smarty.request.price_group ne "-12"}
    {$additional_fields_html}
    {/if}  
    and adapting it to the price groups I'm using >-1000
    how do I then alter the additional_fields_html file to request only those fields relevant to the particular product?

    And would I need to add the address fields as additional fields in the amember CP, as I have them turned off, or should I turn them back on, which I can only do if there is a way to supress them from appearing on the products that don't need them.
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Unfortunately, it is not easy to implement these things, and it is not as easy as change several lines of code.
  5. Asa

    Asa New Member

    Joined:
    Jun 24, 2004
    Messages:
    17
    What if you used {if} and {elseif} statements to create a custom login for each product that needs a custom set of fields.

    On the products that dont need a field filled in, set the input element to hidden and enter and arbitrary value, like "default". We do this and display different login forms for different products.

    Hope that helps.
  6. robdavies

    robdavies New Member

    Joined:
    Feb 28, 2006
    Messages:
    6
    That's the way I'm headed.
    On the first sign-up it's easy, I can just add default values. After that it's going to get interesting.
    I'm thinking re-enable address fields and use {if} statements to set a default value of 'please enter', so when a user logs in and goes to their profile, they can complete missing fields is they want.
    Of course that means checking for existing entries in those fields on all but the first signup page, because I don't want to overwrite existing information in address fields when someone is signing up for a product that only needs a phone number and vice versa.
    I'm not quite sure how to do this yet, but I do know the only way to sign up for anythingother than the first product is to be logged in, so I should be able to check the existing user's details before changing anything.
    Then all I need do is use the same principle with the added fields like the phone number, account number etc. Add them and hide them with default values inside {if} statements for products where they are not required and collect them where they are.
    Wish me luck!

Share This Page