Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Location
    Texas
    Posts
    209
    Plugin Contributions
    2

    Default Re: Help with notifiers

    It is a model dialog (aka popup) that is designed to go off only once by setting a session variable. Upon logging off the session is destroyed, causing my popup to go off once again. So I reset the session variable after the session destroy to keep it from appearing.

  2. #2
    Join Date
    Jul 2009
    Location
    Texas
    Posts
    209
    Plugin Contributions
    2

    Default Re: Help with notifiers

    Well I'm not sure if I got it 100% right but it seems to be working.

    I created a new observer class in /includes/classes/observers

    PHP Code:
    <?php
    class popup extends base {
      function 
    popup() {
        
    $this->attach($this, array('NOTIFY_HEADER_END_LOGOFF'));
      }
      function 
    update(&$callingClass$notifier$paramsArray) {
        
    $_SESSION['popup'] = 1;
      }
    }
    ?>
    That part I think I understand. Although I'm unsure what the $callingClass could be used for.

    Next I created an autoloader to load my class in /includes/auto_loaders/config.popup.php

    PHP Code:
    <?php
    $autoLoadConfig
    [10][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.popup.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  
    'className'=>'popup',
                                  
    'objectName'=>'popup');
    ?>
    I guess what throws me here is the 10 and 90. I suppose these tell zen cart when to load the particular code. I suppose the first line loads the class and then the second line runs the popup() code which hooks it into the notifier.

    I guess for my purposes this really doesn't matter? That is to say none of my code conflicts with anything else really so when it loads up doesn't matter, just a matter of loading it.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,947
    Plugin Contributions
    96

    Default Re: Help with notifiers

    Another approach you could take, again without modifying core files, is to create a file named header_php_popup.php in the /includes/modules/pages/logoff directory, and include the code there. It will be run after the header_php.php file finishes processing and will provide you the same functionality without the complexity of using a notifier.

 

 

Similar Threads

  1. Stumped on notifiers, help?
    By s_mack in forum General Questions
    Replies: 6
    Last Post: 8 Sep 2006, 11:34 PM
  2. Using notifiers
    By Arasii in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2006, 02:39 AM

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