Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    78
    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
    58,463
    Blog Entries
    3
    Plugin Contributions
    111

    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!
    Donations always welcome: www.zen-cart.com/donate

    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
    78
    Plugin Contributions
    0

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

    Ok. Thanks for the explanation, DrByte. :)

 

 

Similar Threads

  1. Message Stack
    By chris32882 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Oct 2008, 03:07 AM
  2. Stumped by message stack
    By Ryk in forum General Questions
    Replies: 0
    Last Post: 2 Jun 2007, 12:45 AM
  3. Message stack customization
    By stevensmedia in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Dec 2006, 09:52 AM

Bookmarks

Posting Permissions

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