Display last 4 digits and expiry

Discussion in 'Templates customization' started by solox, Nov 10, 2007.

  1. solox

    solox aMember Pro Customer

    Joined:
    Apr 21, 2007
    Messages:
    3
    Hi,
    Is there anyway I can display the last 4 digits and expiry date on the form when the users are updating their profiles?

    Thanks
  2. solox

    solox aMember Pro Customer

    Joined:
    Apr 21, 2007
    Messages:
    3
    ok .. i was able to show this by {$smarty.session._amember_user.data.cc} but how do i make it so that it only displays when there is any data. I have a field description like "Last 4 digits of Card on file: {$smarty.session._amember_user.data.cc}" and i dont want anything to appear unless the user has anything on file.
  3. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    {if $smarty.session._amember_user.data.cc}
    Last 4 digits of Card on file: {$smarty.session._amember_user.data.cc}"
    (/if}

    But you want only the last 4 digits displayed right?
    UNTESTED!
    {if $smarty.session._amember_user.data.cc}
    Last 4 digits of Card on file: {$smarty.session._amember_user.data.cc|substr:14}
    (/if}

    You may need a smarty plugin for substr to work
    http://smarty.incutio.com/?page=substring



    David
  4. scott_sm

    scott_sm New Member

    Joined:
    Aug 22, 2006
    Messages:
    26
    Did you figure out which variable displays CC expiration? I'm hunting around the code with no luck...

Share This Page