How to redirect user to different thanks page after payment

From aMember Pro Documentation
Revision as of 07:37, 26 April 2013 by Caesar (Talk | contribs)

Jump to: navigation, search

You can use our thanks-redirect plugin to do it. This plugin allow you to set up custom redirect url for each product in admin interface.

In case you need some more complex logic you can use the following approach:

Create /amember/application/configs/site.php with this code:

        Am_Di::getInstance()->hook->add(Am_Event::THANKS_PAGE, 'onThanksPage');
        function onThanksPage(Am_Event $event){
            /* @var $di Am_Di */  
            $di = Am_Di::getInstance();
            /* @var $invoice Invoice */ 
            $invoice = $event->getInvoice();
            /* @var $controller ThanksController */ 
            $controller = $event->getController();