member products array

Discussion in 'Integration' started by darrinb, Jul 20, 2010.

  1. darrinb

    darrinb New Member

    Joined:
    Jul 19, 2010
    Messages:
    4
    How do you include the product expiration date in the $member_products loop (in member_main.html)?

    {foreach from=$member_products item=p}
    {foreach from=$p.add_urls item=t key=url}
    <a href="{$url}">{$t}</a>
    {/foreach}</div>

    {if $p.url gt "" }
    <a href="{$p.url}">{$p.title}</a>
    {else}
    {$p.title}
    {/if}
    {/foreach}
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Here is how you get product expiration date in member.html template:
    Code:
    
    {foreach from=$member_products item=p}
    {foreach from=$p.add_urls item=t key=url}
    <a href="{$url}">{$t}</a>
    {/foreach}</div>
    
    {if $p.url gt "" }
    <a href="{$p.url}">{$p.title}</a>{php}
    $expire = ''; 
    $product_id = $this->_tpl_vars[p][product_id];
    foreach($GLOBALS[db]->get_user_payments($_SESSION[_amember_id], 1) as $p){
    if($product_id == $p[product_id] && $p[expire_date]>$expire) $expire = $p[expire_date];
    }
    if($expire) print $expire; 
    {/php}
    {else}
    {$p.title}
    {/if}
    {/foreach} 
    
  3. darrinb

    darrinb New Member

    Joined:
    Jul 19, 2010
    Messages:
    4
    @alexander thank you!!! Worked perfectly!

Share This Page