Need help showing upsell message to free users

Discussion in 'Customization & add-ons' started by salesfolksoftware, Jun 4, 2019.

  1. salesfolksoftware

    salesfolksoftware New Member

    Joined:
    Mar 30, 2019
    Messages:
    2
    How do I show a message (or template) to only free users?

    I'm trying to use this code, but it's not distinguishing between paid and free accounts (at least not on the test accounts I manually upgraded to premium/paid from the admin console):

    Code:
    if ( !Am_Lite::getInstance()->haveSubscriptions(Am_Lite::PAID)  && preg_match('#^/page.*#i', $_SERVER['REQUEST_URI']) ) {
            include $this->_script('_upsell.phtml');
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
  3. salesfolksoftware

    salesfolksoftware New Member

    Joined:
    Mar 30, 2019
    Messages:
    2
    Thanks!

    Is there no way to just do it by product type and not by payment?
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Yes, you can check if user has access to particular products by its IDs:
    Code:
    Am_Lite::getInstance()->haveSubscriptions([1, 2, 3]);
    where 1,2,3 is IDs (most left column # in page with products list)
    of product you want to check.

    Best Regards.

Share This Page