Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2012
    Posts
    406
    Plugin Contributions
    0

    Default Problems with messageStack

    I want to display an error message at the top of a ZC window when an error is encountered. The code I am using is:
    Code:
    $messageStack->add(ENTRY_TOO_MANY, 'error');
    I have set $messageStack as a global. When the code is executed, nothing is displayed. If a redirect occurs after adding a message to the stack, will the message be displayed on the new page? Does messageStack have to be initialized before the above code? Thank you for any assistance!
    Dave

  2. #2
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: Problems with messageStack

    https://www.zen-cart.com/showthread....Stack-question
    "add" adds it for the current page display
    "add_session" adds it for the session, which allows the message to survive a page refresh such as a zen_redirect() call.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Problems with messageStack

    ... and if you're using $messageStack on the storefront, the interface is a bit different:
    Code:
    $messageStack->add('header', ENTRY_TOO_MANY, 'error');
    Replace 'header' with the page-tag for the specific page if you don't want the message in the upper-page header.

  4. #4
    Join Date
    Jun 2012
    Posts
    406
    Plugin Contributions
    0

    Default Re: Problems with messageStack

    Thanks guys! Works perfectly.

 

 

Similar Threads

  1. messageStack question
    By tlahtine in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 28 Feb 2011, 11:46 PM
  2. Using $messagestack with zen_redirect
    By s_p_ike in forum General Questions
    Replies: 1
    Last Post: 9 Nov 2006, 11:09 AM
  3. Fatal error with messagestack instance
    By DWDesigns in forum Installing on a Linux/Unix Server
    Replies: 6
    Last Post: 4 Aug 2006, 03:31 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR