Title: Allow Negative Value
Last modified: August 21, 2016

---

# Allow Negative Value

 *  Resolved [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/)
 * Hi, I would like to allow a negative value of 120 credits.
 * Example: User 1 wants to send credits to User 2, User one only have 10 credits,
   but want to send 60 credits. As it is now User 1 is getting a warning “not enough
   credits”, but I would like to allow this. So instead of having the limit of 0,
   the limit should be instead -120.
 * Any advices?
 * Thanks.
 * [http://wordpress.org/extend/plugins/mycred/](http://wordpress.org/extend/plugins/mycred/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3743836)
 * Hey Alex
 * In the `myCRED-addon-tranfer.php` file located in your add-ons directory holds
   the `mycred_user_can_transfer()` function. On line 755 you will find the zero
   balance check which you could change to a negative value; allowing your users
   account to go minus. In version 1.0.8 I will be adding a filter hook so you can
   change this value without editing plugin files but till then, this is the only
   way to achieve what you are looking for.
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3743912)
 * Hi, and thanks!
 * But I did not get it to work 🙁
 * Even when I commented the line out I got the same string in return when trying
   to send credits.
 * I tried with a higher value too, but even then the limit was still at 0.
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744005)
 * Yes you are correct, forgot about the ajax check. Question. Would you want users
   to be able to go minus just once then cut them off or would you want to allow
   them to transfer even if their account is already minus as long as they do not
   reach a certain amount?
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744019)
 * I would like them to be able to send credits even if they already are at a negative
   value, down to a negative value of 120.
 * I am building a timebank and I would like it to be easy to see who are in debt
   to the rest of the community and who have been working more then they have received
   labor.
    Your plugin is absolutly perfect for this project!
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744033)
 * You will also need to adjust the function handling the AJAX call for transfers.
   In the same file around line 322. Here we check for zero balance again so you
   will need to change this but I should have 1.0.8 out later today.
 * You can see how it will work at [http://mycred.me/filters/mycred_transfer_acc_limit/](http://mycred.me/filters/mycred_transfer_acc_limit/)
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744065)
 * Feature introduced in 1.0.8
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744074)
 * Thanks!
 * So, to change the limit in version 1.0.8, how do i do? I cant find the feature
   anywhere in the settings panel 🙁
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744079)
 * Hey Alex.
    There is no feature under settings for this. Visit the [mycred_transfer_acc_limit](http://mycred.me/filters/mycred_transfer_acc_limit/)
   page and copy the example to your themes functions.php file.
 * Change the value in the example from -100 to the value you need and save. Thats
   all you need to do.
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744087)
 * Sigh, think i have tried everything with out success now 🙁
 * Anybody else who have tried changing the limit to a negative value?
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744088)
 * Can you send me a link where I could have a look?
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744089)
 * I am using it at [http://tidsbank.se/](http://tidsbank.se/)
 * I have added following code at the bottom of my themes functions.php.
 * I have installet version 1.0.8 of your plugin.
 * I run WP Version 3.5.1
 *     ```
       <?php
       add_filter( 'mycred_transfer_acc_limit', 'adjust_transfer_account_limit' );
       function adjust_transfer_account_limit( $amount )
       {
       	return 0-100;
       }
       ?>
       ```
   
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744090)
 * When added the code I get this message when trying to upload an image
 * Warning: Cannot modify header information – headers already sent by (output started
   at /public_html/tidsbank.se/wp-content/themes/OneCommunity/functions.php:1408)
   in /public_html/tidsbank.se/wp-admin/async-upload.php on line 32
    105
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744093)
 * Could you send me an email on [support@mycred.me](https://wordpress.org/support/topic/allow-negative-value/support@mycred.me?output_format=md)
   and I can send you an updated version to see if that resolves the issue.
 *  Thread Starter [AlexBangkok](https://wordpress.org/support/users/alexbangkok/)
 * (@alexbangkok)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744114)
 * Thank you soo much for all the help! I am very happy for the help since this 
   was a big thing before the soft launch of the site, and I dont think the website
   could operate without your plugin.
 * Thanks so much!
 * //Alex
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744115)
 * My pleasure, let me know if you have any future issues.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Allow Negative Value’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/allow-negative-value/#post-3744115)
 * Status: resolved