Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Stumped on notifiers, help?

    I read through the WIKI and I thought I got the general idea... but all I get is a blank page! I'm trying to get a message header when someone adds an item(s) to their cart.

    this is what I have in /includes/classes/observers/class.addProductMessage.php
    Code:
    <?php
    /**
     * Observer class used to add a free product to the cart if the user spends more than $x
     *
     */
    class addProductMessage extends base {
    
      function addProductMessage() {
        $_SESSION['cart']->attach($this, array('NOTIFIER_CART_ADD_CART_END');
      }
    
      function update(&$class, $eventID) {
      $messageStack->add_session('header', 'test!', 'success');
      }
    }
    ?>
    And this is what I have in /includes/auto_loaders/config.addProductMessage.php
    Code:
    <?php
    $autoLoadConfig[85][] = array('autoType'=>'class',
                                  'loadFile'=>'observers/class.addProductMessage.php');
    $autoLoadConfig[85][] = array('autoType'=>'classInstantiate',
                                  'className'=>'addProductMessage',
                                  'objectName'=>'addProductMessage');
    ?>
    From the examples given, I presumed this would work on the first shot because its so simple! What am I doing wrong???

    - Steven

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Stumped on notifiers, help?

    might try adding this to your update element:

    global $messageStack;
    .

    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
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Stumped on notifiers, help?

    Well, that could explain why I might not get a proper output, but I'm getting no output. Ok, I found I was missing a ) in the function addProductMessage and thought that was the problem... and it was a problem. But still, not the only problem. But if I change the update function to simply
    Code:
      function update(&$class, $eventID) {
    print "hello";
      }
    I still just get a blank screen.

    - Steven

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Stumped on notifiers, help?

    Well, now I'm even more confused. I got it to work but I'm not sure what I did. I tried your globals thing and that didn't do it. I found the rogue bracket, and that didn't do it. Then I changed some more stuff to no avail, but when I changed it back it works. So I'm not sure what I did. The above code with the missing ) put in works as expected now...

    weird.

    - Steven

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Stumped on notifiers, help?

    You probably know this, but just in case:

    If you get a blank screen, then often (but not always!) your server log is a good place to look. You might see a message like this:

    [client 127.0.0.1] PHP Parse error: parse error, unexpected ':', expecting ',' or ';' in /var/www/html/higher_1.3/includes/templates/custom/templates/tpl_product_info_display.php on line 291, referer: http://localhost/higher_1.3/index.php

    This one shows us that l. 291 in tpl_product_info_display.php is broken.

    /var/log/httpd/error_log on my FC4 box running Apache.

    Good luck,
    Scott
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Stumped on notifiers, help?

    Actually, I didn't know that :) Thanks.

    But I don't know where to find the log. I'm running on a local windows server using apache2triad. I found a logs folder, and even an error file within that... but there are absolutely no parse errors in it, just file not found errors (and I know what was generating those).

    I'd like to find the log you speak of.

    - Steven

  7. #7
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Stumped on notifiers, help?

    Found it! In a seperate php folder - how handy!

    So for anyone in a similar setting... look here: C:\apache2triad\php\logs

    Thanks for the tip.

    - Steven

 

 

Similar Threads

  1. Remote MySQL Access Error--STUMPED--HELP!!!
    By DivaVocals in forum Installing on a Linux/Unix Server
    Replies: 14
    Last Post: 14 Sep 2015, 04:54 AM
  2. Please Help!!! I'm Stumped
    By skbhagra in forum General Questions
    Replies: 1
    Last Post: 25 Apr 2011, 04:17 PM
  3. stumped.. really stumped Error 500...again
    By rwslippey in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 1 Jul 2010, 02:40 AM
  4. Help with notifiers
    By llynix in forum Contribution-Writing Guidelines
    Replies: 4
    Last Post: 19 May 2010, 03:13 PM
  5. Stumped on extra space. HELP
    By red8ii8 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Mar 2007, 02:55 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