New feild in payments table

Discussion in 'Customization & add-ons' started by dereck_j2, Mar 22, 2008.

  1. dereck_j2

    dereck_j2 Member

    Joined:
    Aug 22, 2006
    Messages:
    42
    Hi All,

    For reasons of the way we have customised our use of aMember I now require an additional feild in the payments table.

    The feild is called "mdiscount" and I need it to hold the coupon discount at the time a new member signs up for my service.

    Is there a way that I can program the sign up script to enter the coupon discount into this new feild.

    Can someone poiunt me in the right direction please.

    Many thanks

    Dereck
  2. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    If you need a new field on the signup form, where the user can enter the coupon number you give them, it's relatively simple. In the aMember admin panel there is "Add Fields" link under "Utilities".

    Click on "Add Fields" and fill in the form. "mdiscount" should be the field name in this case, type "text" and "common field", and allow displaying on signup form. The value of the mdiscount field will then be sent via POST to the payment plugin, together with the other data from the signup form.

    Tomas
  3. dereck_j2

    dereck_j2 Member

    Joined:
    Aug 22, 2006
    Messages:
    42
    Hi Tomas

    I did as your reply stated, but the mdiscount field in the payments table is empty.

    Any ideas.

    Best regards

    Dereck
  4. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    Well, if you need to create a new record in the MySQL database, then there are some differences. I haven't tried this myself but if you select "SQL" instead of "Common" as the field type and choose "String" for the SQL field type, it may work.

    But as I said, I have't tried this myself...

    Tomas
  5. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Amember has the ability to generate & track coupons..

    In Admin CP -> Allow usage of coupons

    This will allow you to create coupons via the Admin CP that can give discounts based on a number of criteria (exact amount, % amount, etc)

    It will also add the coupon field to your signup form automatically.

Share This Page