Adding new am_user to custom DB

Discussion in 'Integration' started by meduteam, Apr 5, 2015.

  1. meduteam

    meduteam aMember Pro Customer

    Joined:
    Mar 9, 2012
    Messages:
    7
    Hi there,

    we use amember along with Wordpress and a custom DB for an online course. When a new user registers via amember, a new user is created in the am_user table. However, in our system, this user also needs to be created in our custom DB at the same time. So far we do this manually...

    I would like to customize amember so that at the same time, both, the am_user and our custom DB table get a new user entry after the user pays for the course. Can you / anyone tell me where in the amember script the new user is created in the am_user table? I would then try to modify this script at this point.

    Of course, other ideas welcome!

    Thanks a lot, cheers!
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    I do not recommend to customize aMember core files, these modifications will be lost after upgrade.
    However you can create plugin which will do what you need.
    Please have a look:
    http://www.amember.com/docs/API/Protect
  3. meduteam

    meduteam aMember Pro Customer

    Joined:
    Mar 9, 2012
    Messages:
    7
    Hi Alex, thanks a lot! I thought it would be easiest just to add a simple SQL command line like INSERT user ... after the registration is complete. But I will look into the plugin you recommend.
    Thanks!
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
  5. meduteam

    meduteam aMember Pro Customer

    Joined:
    Mar 9, 2012
    Messages:
    7
    Hi Alex,
    thanks again! This plugin maker looks really awesome. However I don't get the integration to work. I don't want to bother you with the entire script details - but one question: For testing/debugging, once I make modifications to the script in the folder application/default/plugins/protect/MYNEWPLUGIN.php
    I do the following
    - go to setup/config, disable my previous version, save
    - go to setup/config, activate my new version, save
    - go to the plugin page and establish the new DB connection again, save
    - go to products / integration

    Since I keep the script file name the same (mynewplugin.php) while modifying, are these steps really necessary, or does amember automatically detect changes in the plugin script and updates config accordingly?

    Thanks, best!
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    These steps are not necessary. All modifications in that file will affect system right away(of course if you have plugin enabled)

Share This Page