how to create custom plugin with config form

Discussion in 'aMember Pro v.4' started by customcodegeek, Feb 10, 2012.

  1. customcodegeek

    customcodegeek Member

    Joined:
    Feb 10, 2012
    Messages:
    40
    I have just purchased amember 4 and I want to have a modified paypal form so it can have some extra hidden fields to allow me to set a custom return url for a given product.

    I have tried editing the existing paypal.php in /plugins/payment/ but I can't see where the button is added to the admin page under /admin-setup/

    can you tell me how to add a configuration page in a new payment plugin?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Look at _initSetupForm method in paypal.php
  3. customcodegeek

    customcodegeek Member

    Joined:
    Feb 10, 2012
    Messages:
    40
    Thanks Alex,
    I saw that bit but I can't get a new but I can't get a new button to appear at the top of the admin page where the paypal button and all the other buttons are.

    I've used the paypal.php file as a base and named it paypal-ttmm.php and then renamed the class at the beginning to
    Code:
    class Am_Paysystem_Paypal_ttmm extends Am_Paysystem_Abstract
    I can select the new paypal-ttmm in the drop down for adding new plugins but I do not get a new button in the admin page to select the config page.

    is there an example plugin code I can refer to or other documentation?
  4. customcodegeek

    customcodegeek Member

    Joined:
    Feb 10, 2012
    Messages:
    40
    it's ok, I figured it out. I had to name the class as Am_Paysystem_Paypalttmm for it to show the button.

Share This Page