2

I am setting $_SESSION variable inside a payment response file and need this to display on Thank you page. Somehow nothing seems to work so far.

Tried following things:

$_SESSION['test'] = 'Hello World'; // Inside payment response file

Need this in confirm.tpl file. Tried

{$session->get('test') // does not work
{$smarty.session.test} // does not work

Tried so many other things but nothing seems to work. Also, it's not working for any other variable like $_SERVER, $_POST etc.

Any ideas?

1 Answer 1

3
    Try following:

    // php code;
        $_SESSION['test'] = 'Hello World';

    // assign 'Hello World' to .tpl
        $this->assign('test', $_SESSION['test']);

    // use '{$test}' following in .tpl file to display on Thank you page, For e.g
       <tr>
         <td>{$test}</td> // this will print 'Hello World' on page
       </tr>
1
  • Thanks Rohan but it's not working.
    – Negi
    Nov 3, 2015 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.