Thread: Using notifiers

Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    5
    Plugin Contributions
    0

    Using notifiers

    Really I've tried several different ways just to get an indication that zc actually runs it.

    I have had absolutely no luck so far.

    I couldn't get it to work where I NEED it to work, so I backed up to test with a dummy variable put in the session cookie attached to the session'cart' class. That didn't work either!

    The set up is:
    in autoloaders/overrides/config.vendorProducts.php
    PHP Code:
    <?php

    $autoLoadConfig
    [90][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.vendorProducts.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  
    'className'=>'vendorProducts',
                                  
    'objectName'=>'vendorProducts');
    ?>

    And in classes/observers/vendorProducts.php
    PHP Code:
    <?php
     
    class vendorProducts extends base {
         
         function 
    vendorProducts() {
    $_SESSION['cart']->attach($this, array('NOTIFIER_CART_SHOW_TOTAL_END'));

        }
        function 
    update(&$class$eventID) {
        
            
    $_SESSION['vendorProducts'] = 'true';
        
        } 
    // end function update
      
    }
    ?>
    So what am I missing here?

    TIA,
    Arasii

  2. #2
    Join Date
    Feb 2006
    Posts
    5
    Plugin Contributions
    0

    Default Re: Using notifiers

    Never mind. Just how dim can I manage to be? LOL

    file is named wrong.

    In config.vendorProducts.php it calls:

    PHP Code:
    $autoLoadConfig[90][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.vendorProducts.php'); 
    Note the class.vendorProducts.php

    The actual file was named just vendorProducts.php.

    Well DUH.

    Off and running again :-) Make no guarantees that I won't be back though LOL

    Arasii

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Using notifiers

    Thanks for the update!
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Feb 2006
    Posts
    5
    Plugin Contributions
    0

    Default Re: Using notifiers (Now officially stumped)

    Okay, I fixed the error I found.

    It's attaching to a class, so my understanding is that it does not have to use the stub notifier class.

    It still does absolutely nothing. It does not even look like it's instantiating.

    Here's the code:

    in auto_loaders/overrides/config.vendorProducts.php
    PHP Code:
    <?php

    $autoLoadConfig
    [90][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.vendorProducts.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  
    'className'=>'vendorProducts',
                                  
    'objectName'=>'vendorProducts');
    ?>

    in classes/observers/class.vendorProducts.php
    PHP Code:
    <?php
    /*
     *  Observer code used to track vendor/artist product sale
     *
     */
     
    class vendorProducts extends base {
         
    /**  add date, product, and amt owed to vendor on product sale
         *
         */
         
         
    function vendorProducts() {
             
    $this->attach('NOTIFY_ORDER_PROCESSING_CREDIT_ACCOUNT_UPDATE_BEGIN');
        }
        function 
    update(&$class$eventID) {
        
        
    $_SESSION['vendorProducts'] = 1;
        
            
    $amt_owed 0;
            
            
    $vendor_product_id $db->Insert_ID();
            
            
    $vendor_product_query $db->Execute(" select manufacturers_id from " TABLE_PRODUCTS "
                                    where products_id = '" 
    zen_get_prid($this->products[$i]['id'] . "'");
                                    
            
    $vendor_order_query $db->Execute(" select customers_id, date_purchased from " TABLE_ORDERS 
                                    where orders_id = '" 
    $zf_insert_id "'");
                                    
            
    $vendor_amt_owed += $this->products[$i]['price'] * VENDOR_CUT;
                                    
             
    sql_vendor_product_query = array('vendor_product_id') => $vendor_product_id,
                                             
    'manufacturers_id' => $vendor_product_query->fields['manufacturers_id'],
                                             
    'purchasers_customer_id' => $vendor_order_query->fields['customers_id'],
                                             
    'order_id' => $zf_insert_id;
                                             
    'product_id' => $this->products[$i]['id'],
                                             
    'order_date' => $vendor_order_query->fields['date_purchased'],
                                             
    'product_price' => $this->products[$i]['price'],
                                             
    'vendor_order_amt_owed' => $vendor_amt_owed);
            
            
    zen_db_perform(TABLE_VENDOR_PRODUCTS$sql_vendor_product_array);

        
        } 
    // end function update
      
    }
    ?>
    I'm missing something but I'm mystified as to what it is. Totally stumped. Help?

    TIA
    Arasii

  5. #5
    Join Date
    Feb 2006
    Posts
    5
    Plugin Contributions
    0

    Default Re: Using notifiers

    Well now I'm really embarrassed.

    You know, it helps when you put the config file in the correct folder.

    Not:
    includes/auto_loaders/overrides

    it's
    includes/auto_loaders


    GEEEEEEEEEZ

    Posting in case some other makes the same mistake.

 

 

Similar Threads

  1. Stumped on notifiers, help?
    By s_mack in forum General Questions
    Replies: 6
    Last Post: 8 Sep 2006, 11:34 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR