Looking to hire: Need to automatically update custom fields after purchases.

Discussion in 'Customization & add-ons' started by yodude711, Jan 17, 2013.

  1. yodude711

    yodude711 New Member

    Joined:
    Jan 9, 2013
    Messages:
    11
    Hi there,
    I'm looking to hire someone to add a little customization to my amember installation. v4 of course.

    I have some custom fields setup called "credit balances". One of the products within amember that my users purchase are more of these credits. I'd like for each user's credit balance to be updated whenever he purchases more credits.

    Is this possible? How could it be done? How much would it cost? How long would it take?

    I am using the cc plugin with auth.net-cim integration.

    Thank you!
    Blair
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    I might be wrong but this already should be possible via credits plugin.
    It allows to add credits to user's balance when user purchase products from amember.
  3. yodude711

    yodude711 New Member

    Joined:
    Jan 9, 2013
    Messages:
    11
    Thanks for replying, Alex. I am looking into the credits plugin now, and the documentation for it on the wiki. Some things I don't understand:

    If the user purchases these credits, and they are then added to their account, can the user see how many credits he has in his "bank"? Ideally, we could put a custom field into their profile, or some other place within their member's area, that displays the number of credits they have. I see the sample sourcecode that would display the number of credits, but I'm not sure how to use that, or where to put that.

    Also, I would need to be able to debit their credit balance manually via the admin side each week. How can we do this?

    Also, is it possible to have 2 types of credits?

    Thanks!
    Blair
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    1. Yes you need to use sample code which you can use in your plugin.
    If you want to put it inside aMember's template just use this code where ever you need to put balance:
    echo "Your Balance: ".Am_Di::getInstance()->plugins_misc->loadGet('credits')->balance();

    2. You should be able to do this from amember CP -> Browse Users -> Edit User -> Credits Tab

    3. No by default.
  5. yodude711

    yodude711 New Member

    Joined:
    Jan 9, 2013
    Messages:
    11
    Ok cool, I see how to insert the balance into the template (layout.phtml). Is there a way to insert it in a new block on the member's homepage using the site.php file?

    Thanks.
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
  7. yodude711

    yodude711 New Member

    Joined:
    Jan 9, 2013
    Messages:
    11
    Hi Alex,
    Thanks for that link. I should have been more specific with my question. When I use the hook on the site.php file as your above-mentioned link says to do, it won't allow me to insert php code, only html. So I'm not able to insert the CreditBal line as mentioned.

    However, I did find the templates within the script to manipulate and edit the members area homepage, including adding blocks, editing blocks, etc. I was able to insert the proper php code that way.

    So I'm all good here. Thank you!

Share This Page