Coupon only Payment

Discussion in 'Payments processing' started by mikeweeks, Nov 6, 2011.

  1. mikeweeks

    mikeweeks New Member

    Joined:
    Feb 16, 2010
    Messages:
    12
    I want to have a product that only allows payment via coupon although other products will normally be made via paypal.

    Mike
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Mike,
    This can be done as simple customization.
    Do you need this for v3 or v4 ?
  3. mikeweeks

    mikeweeks New Member

    Joined:
    Feb 16, 2010
    Messages:
    12
    at present I am on version 3 but obviously I will be looking at version 4.

    Mike
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    For v3 create file /amember/site.inc.php with this code:
    PHP:
    <?php 
    setup_plugin_hook
    ("validate_signup_form"'vsf');
    function 
    vsf($vars){
      if(
    $vars[product_id]==&& !$vars[coupon]){
         
    $errors[] = "Product 1 can be purchased using coupon code only";
      }
      return 
    $errors;
    }
    ?>
  5. mikeweeks

    mikeweeks New Member

    Joined:
    Feb 16, 2010
    Messages:
    12
    Thanks for that
  6. jprice

    jprice New Member

    Joined:
    Apr 3, 2007
    Messages:
    6
    Hi alexander,
    Can you please share how to do this for version 4?
    Thanks

Share This Page