Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default message stack - when to use add and add_session?

    Dear experts,

    I'm a noob. But when should one use the add_session method and when should one use the add method in the messageStack class?

    Also, can someone review the messageStack usage in all the payment modules? Most of the payment modules contain lots of messageStack usage code like:

    $messageStack->add_session(MODULE_PAYMENT_PAYPALDP_TEXT_REFUND_FULL_CONFIRM_ERROR, 'error');

    Surely, it's missing the '$class' field in the method parameters?


    Cheers,
    kamion

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: message stack - when to use add and add_session?

    1. add is used when the message doesn't need to be stored in the session.
    add_session is when the message needs to be stored in the session, such as when a page-refresh/reload is about to be triggered

    2. the admin calls to $messageStack don't need the $class parameter, in fact it will break if you use one. And the example you quoted is for code that only runs in admin mode.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: message stack - when to use add and add_session?

    Ok. Thanks for the explanation, DrByte. :)

 

 

Similar Threads

  1. v153 Adding a message into the message stack
    By delia in forum General Questions
    Replies: 9
    Last Post: 22 Oct 2014, 05:29 PM
  2. v151 Add an error to the message stack for checkout shipping?
    By delia in forum General Questions
    Replies: 7
    Last Post: 10 Dec 2012, 02:55 PM
  3. Add span class to the message stack text
    By LissaE in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 4 Mar 2010, 11:55 AM
  4. Moneris and message stack
    By cooperwd in forum General Questions
    Replies: 1
    Last Post: 28 Nov 2007, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg