Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    905
    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
    59,807
    Blog Entries
    4
    Plugin Contributions
    133

    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!
    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
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    905
    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
    905
    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
    4,661
    Plugin Contributions
    154

    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
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  6. #6
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    905
    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
    905
    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. Stumped trying to center the logo
    By Chrome Orange in forum Templates, Stylesheets, Page Layout
    Replies: 22
    Last Post: 19 May 2009, 04:08 PM
  2. Attributes prices are Zero - I am stumped!
    By infocom in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 7 Sep 2006, 07:39 PM
  3. Using notifiers
    By Arasii in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2006, 02:39 AM
  4. Shipping Questions, should be easy, but i'm stumped!
    By beskone in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 Jun 2006, 02:29 AM
  5. Stumped on Column by Page Removal
    By jahgriz in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 17 May 2006, 04:11 PM

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
  •