Adding fields for gift voucher plugin

Discussion in 'Templates customization' started by pascalevdb, Nov 16, 2012.

  1. pascalevdb

    pascalevdb Member

    Joined:
    May 30, 2007
    Messages:
    41
    good morning,

    Using Amember 3.1.4

    I need to add fields
    1. for gift voucher plugin
    2. for a product that is diplayed only to members
    3. fields should only display for this specific product
    3. since this is a "only display member" product, I think the fields need to be on the credit card page.

    below is the original code that amember uses for gift voucher plugin, but it is intented to go on signup page.

    QUESTION: how do I modify code so it only shows for a specific product? And what page do I add the code to? Thanks

    Gift Voucher Code for additional fields:

    <tr>
    <th colspan=2 style='text-align: center'><b>GIFT CERTIFICATE</b></th>
    </tr>
    <tr>
    <th><b><label for="voucher_email">Email to send gift certificate</label></b><br />
    <small>please enter it if you are ordering gift certificate</small></th>
    <td nowrap>
    <input type=text name=voucher_email value="{$smarty.request.voucher_email|escape}">
    </td>
    </tr>
    <tr>
    <th><b><label for="voucher_comment">Comment to send with gift certificate</label></b><br />
    <small>please enter it if you are ordering gift certificate</small></th>
    <td nowrap>
    <textarea name=voucher_comment rows=5 cols=50>{$smarty.request.voucher_comment}</textarea>
    </td>
    </tr>
    <tr>
    <th><b><label for="voucher_date">Date to send gift certificate</label></b><br />
    <small>if you want to delay gift certificate sending, <br />
    enter date value (mm/dd/yyyy) into this field.<br />
    If you keep this field empty, certificate will be sent immediately
    </small></th>
    <td nowrap>
    <input type=text name=voucher_date value="{$smarty.request.voucher_date|escape}" size=11 maxlength=10>
    </td>
    </tr>
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    If you want to add this code to a product with is available in member's area only, add it to /amember/templates/member_add_renew.html template. (somewhere inside renewal form).
    In order to display it for special product, set negative price group for this product (for example -1)
    then add these tags around gift voucher code:
    {if $smarty.request.price_group==-1}
    Gift voucher html code here
    {/if}

Share This Page