_amember_product_ids condition - need a smarty version - here is PHP version.

Discussion in 'Customization & add-ons' started by joshuwae, Aug 25, 2010.

  1. joshuwae

    joshuwae New Member

    Joined:
    Nov 16, 2006
    Messages:
    9
    How can I write this using smarty tags in an aMember template file? I need to have this in header.html. I'm successfully using this in non-aMember pages.


    <?php
    $need_one_from = array(69);
    if (array_intersect($need_one_from, (array)$_SESSION['_amember_product_ids'])){
    print "You have product #69";
    } else {
    print "You don't have product #69";
    }
    ?>


    Thanks!
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    in smarty code you can use php code like this
    {php}
    code
    {/php}

    David
  3. joshuwae

    joshuwae New Member

    Joined:
    Nov 16, 2006
    Messages:
    9
    Thanks David. Also JUST found:

    {if in_array(69, $smarty.session._amember_product_ids) }

    Yeah - you've got product #69.

    {/if}
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Oh yeah, thats much better!

    David

Share This Page