Hi, I'm using 4.2.6 and have just added the credits plugin. I want to know if this plugin can be used to control access to a subscription? I have a support services that I sell which allows 12 hours (or 720 credits) over a 12 month period. Basically I'd like to be able to reduce the credit by one for each hour of support given over the 12 months sign-up period, and then when the credit has run out (even if the 12 month period is still valid) remove the subscription from the users list. I can see that if a new user is added, then the am_credit table adds the record with the 720 credits set in the product detail page and the user is able to access the service. However if I manually reduce the credit to 0 or -1 the user still has the subscription. Will the credit plugin do what I'm asking and is there anyone that can help guide me in the right direction? Thanks
User still have subscription and that is correct. In the same place where you are deducting credits via API, you must also check user balance and deny his access if necessary by (for example!) throwing an exception throw new Am_Exception_InputError("You have no enough credits to view this page");
Thanks Alex. If I create a basic php page; <?php require_once 'members/bootstrap.php'; $plugin = Am_Di::getInstance()->plugins_misc->loadGet('credits'); $balance = $plugin->balance(); echo "balance=$balance <br />n"; ?> this works and shows the credit balance. However if I insert that php code into a page made in Wordpress and protected by amember I get an error, and the balance isn't returned. The error is; Script Error An internal error happened in the script, please contact webmaster for details. I can't see an error logged in my http error_log or in amember logs. Are you able to check if my require_once is correct and what the problem might be? Thanks
Hello, I am interested in knowing if the credits plugin can be used in the following way: - Members purchase credits - Each credit allows them to create one post in our WordPress site - If credits aren't renewed within 12 months (or whatever other duration), then their posts are marked as draft - If later they decide to purchase credits their posts will be marked as live (or pending)
todddown, Try to specify full unix path to bootstrap.php in require_once shotoshi, No this can't be done by default and requires several customizations in wordpress.
Ok. Where you have that code exactly? Do you have any output before that code? The problem can be in sessions. amember send session cookies from bootstrap.php so if you have any output before that line aMember will generate an exception. So try to move require_once 'members/bootstrap.php'; to the top of the file, before any output.
Hi Alex, the whole code was used as the content of a wordpress page. I've tried moving the require_once to the top of my header.php file - still got same error and then to top of inex.php and still got the same error.
I know this is a crazy old thread, but I'm having the exact same problem that toddown had -- can someone help me out with how this was resolved? Everything I try, I get the "Script Error..." I know my path to bootstrap.php is correct, because if I change the path, I get a different error.
@visualp Please contact us in helpdesk (https://www.amember.com/support/). We will troubleshoot your issue.