Singup Page - Membership Type - Replace Radio buttons with selectbox

Discussion in 'Templates customization' started by mhmtozek, Sep 22, 2010.

  1. mhmtozek

    mhmtozek Member

    Joined:
    Aug 9, 2010
    Messages:
    51
    I tried to hack code but it seems a bit difficult, I will continue to play in signup.html maybe i can find a solution but any help here that would accelerate me to fix the the problem will be very much appreciated

    I do not sell membership type, i sell products. I will have over 10-15 products on my site, and on signup page instead of listing them via Radio buttons, i will like to display them in selectbox. any chance for that?

    As a logged in user, i can get that dropdown box nicely listed under Add/Renew subscription link, but for new users, signup page has radio buttons not a selectbox.

    And last question, what is the method to replace wording on site? Instead of using Membership Type, I will like to display Select Product
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can do this without a problem.
    in signup.html template find this code:
    Code:
        <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>
    
    change it to:
    Code:
        <td>
        {if $config.select_multiple_products}
         <select name='product_id[]' multiple size=5>
        {else}
         <select name='product_id'>
        {/if}
        {foreach from=$products item=p} 
            <option value='{$p.product_id}' {if in_array($p.product_id, (array)$smarty.request.product_id)}selected{/if}
            />
            {$p.title} ({$p.terms})
            </option>
        {if $p.price <= 0.0 }     {assign var="paysys_id_not_required" value="1"}    {/if}        
        {/foreach}
        </select>
        </td>
    
    In regards to language variables have a look:
    http://manual.amember.com/Editing_Phrases/Text_Messages
  3. mhmtozek

    mhmtozek Member

    Joined:
    Aug 9, 2010
    Messages:
    51
    Thanks for prompt reply Alex, your suggestion fixed a problem which i was struggling since yesterday.

    Both issues are resolved, thanks again :)

Share This Page