Message for expired prouct

Discussion in 'Templates customization' started by shahg12, May 20, 2013.

  1. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    Hi,

    If a users has an expired product, I want to display a message saying that your product has expired please renew.

    Currently I use this, but this displays message for active product and not expired.

    <div id="memberMessage" style="width:100%;">
    {foreach from=$member_products item=p}
    {if $p.product_id eq "143" }

    message here

    {else}
    &nbsp;
    {/if}
    {/foreach}</div>

    Thanks
  2. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    anyone? been waiting for someone to reply for 6 days now! this places looks so deserted now!
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Take a look here:

    http://manual.amember.com/AMember_Session_Variables

    specifically:

  4. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    so are you saying it's not possible at all? I have no knowledge of php so can if there is a way, can you please tell me how?

    thanks
  5. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Saying that link provides you specifics to the session variables where that kind of information is exposed.
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    If you need that code within aMember template you can use this:
    Code:
    {php}
    // Here is how you can get all complated payments which user have 
    foreach($GLOBALS['db']->get_user_payments($_SESSION[_amember_id],1) as $payment){
    //  do whatever checks you need.
    }
    {/php}
    
    shahg12 likes this.
  7. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24


    Thanks for that - I'm still a little lost

    You see my codebelow:
    Code:
    <div id="memberMessage" style="width:100%;">
    {foreach from=$member_products item=p}
    {if $p.product_id eq "143" }
     
    message here
     
    {else}
    &nbsp;
    {/if}
    {/foreach}</div>
    That displays message for all active members of product 143, but not to members who have product 143 as expired, how do i merge your code into mine so the message is displayed to both active and expired members of product 143

    Thanks
  8. shahg12

    shahg12 New Member

    Joined:
    Oct 11, 2007
    Messages:
    24
    any help from anyone? please.....?

Share This Page