Products as dropdown list in signup

Discussion in 'Templates customization' started by worldgif, Nov 4, 2007.

  1. worldgif

    worldgif New Member

    Joined:
    Oct 11, 2007
    Messages:
    6
    Elsewhere in this forum I see the following code to change the products from a radio-button select to a dropdown list in signup.html:

    <select name=product_id size=1>
    {foreach from=$products item=p}
    <option value="{$p.product_id}"
    {if $p.product_id == $smarty.request.product_id }selected{/if}>
    {$p.title} ({if $p.price > 0 }{$config.currency|default:"$"}{$p.price}{else}free{/if})
    </option>
    {/foreach}
    </select>

    I have used the above code successfully but it has to replace more recent code in signup.html which includes the possibility of purchasing multiple products, as in:

    {foreach from=$products item=p}
    {if count($products)>1}
    {if $config.select_multiple_products}
    <input 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 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} ({if $p.price > 0 }{$config.currency|default:"$"}{$p.price}{else}free{/if})</b><br />
    <span class="small">{$p.description}</span></label><br />
    {if $p.price <= 0.0 }
    <input type="hidden" name="paysys_id_not_required" value="for javascript" />
    {/if}
    {/foreach}

    The modified code may eventually create problems if aMember is used differently, will it not?

    Steve
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can replace that whole block with your code. It will work right if you don't have allow to purchase multiply products on signup page enabled.

Share This Page