Credits Install

Discussion in 'aMember Pro v.4' started by g40servers, Feb 9, 2013.

  1. g40servers

    g40servers New Member

    Joined:
    Dec 5, 2012
    Messages:
    10
    I have signed up to use the Credits Addon, but I can not find the documentation on where to install it and how to get started using it. Can someone please give me some direction on where to install the Credits Addon so I can start using it?

    Thanks
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Upload plugin file to /amember/application/default/plugins/misc/ folder then enable it from amember CP -> Setup -> Plugins -> Other
    Configure count of credits which user will get when he purchase product in aMember CP -> Manage products -> Edit Product.

    Plugin allows to sell "credits" - count of credits will be configured
    in product billing plan settings, and added to user account after purchase

    Code to deduct "credits" must be implemented by your system

    Credits are not expiring with subscription (!)
    aMember does not take account of subscription dates at all when accounting credits
    Once accounted, credit records are not updated if product setting changed
    @example
    // no comment
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120);
    // with comment
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120, "Used 120 credits");
    // debit 120 credits from user# 1234
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120, "Used 120 credits", 1234);
    // balance - get current number of credits
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->balance();

Share This Page