How to populate coupon code on signup page from PHP session

From aMember Pro Documentation
Jump to: navigation, search

Add this code to site.php file:

if (!isset($_SESSION['amember']['_signup_container'])) {
    $_SESSION['amember']['_signup_container'] = array(
        'datasources' => array(),
        'values' => array(),
        'valid' => array(),
        'opaque' => array()
    );
}
$_SESSION['amember']['_signup_container']['values']['page-0']['coupon'] = 'TEST';

You can replace TEST with your actual coupon code.