Using amember with shopping cart that uses Smarty templates to check if member is logged in

Discussion in 'Integration' started by antn, Sep 30, 2018.

  1. antn

    antn New Member

    Joined:
    Aug 22, 2006
    Messages:
    3
    Hi,

    I am trying to use amember with a shopping cart that generates all display pages with Smarty templating engine. The page display files all end in ".tpl". The problem is amember is php and Smarty has deprecated the {include_php} function (See here: https://www.smarty.net/docsv2/en/language.function.include.php.tpl )

    I need to check if a member is logged in, and has required subscription. I also need to display their user name, and their other membership info on the shopping cart's Smarty template display pages.

    As stated, Smarty no longer uses the simple {include_php} function, instead recommending that you write a plugin. Since Smarty is a popular templating engine for php I assumed the solution would be simple to find, but I have searched and can't find, and can't figure out how to do this with amember using the Lite.php library (http://www.amember.com/docs/API/Lite.)

    Basically, I need a way to insert code at the top of each of the shopping carts .tpl pages to check if an amember member is logged in, has required subscription, and display their membership info. I am not an uber coder and need the exact code on how to do this. Please help....thank you.
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295

Share This Page