Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Location
    Italy
    Posts
    199
    Plugin Contributions
    0

    Default Is notifier/observer system good for this?

    Hello, I need to modify the download process (regarding virtual products).

    The mod needed is that the filename of the file to be downloaded must be custom for each order.

    Example: product A, filename: test.txt

    I want the customer to download this file: order_id_test.txt

    This is easy to achieve, simply modifying order.php, but since I have to create, on the fly, the file too (not a problem) and don't want to modify the core file if not needed I was wondering if I could use

    $zco_notifier->notify('NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN');

    to call a class where I put

    - $filename = what I want
    - call external script passing filename, that create the file

    May I use that notifier to modify the filename and call the external script?
    Is this the correct way to proceed?

    Thanks!
    Paolo De Dionigi
    Co-maintainer of Zen Cart Italia

  2. #2
    Join Date
    Feb 2005
    Location
    Italy
    Posts
    199
    Plugin Contributions
    0

    Default Re: Is notifier/observer system good for this?

    Well, I need help on writing the update function of my class:

    From the example (wiki)

    Code:
      /**
       * Update Method
       * 
       * Called by observed class when any of our notifiable events occur
       *
       * @param object $class
       * @param string $eventID
       */
      function update(&$class, $eventID) {
    Ok does $class must be $class or have I to name it according to the class I want to access?

    $eventID: what's this? in wiki is said that this is the name of the notifier... well I don't understand how I have to define the name of my notifier, since in the example $eventID isn't used through the update function O_o

    I think I'm missing a lot....

    besides the definiton of function parameters, then I'd need to get what in order.php is defined this way: $attributes_values->fields['products_attributes_filename']

    and change that variable value with something else

    how may I access to that value and then replace it with something else?

    I understood how to work with session variables (maybe) and how to access simple variables, but the one I need to access is beyond my knowledge of OOP.

    Thank you very much!
    Last edited by s_p_ike; 15 May 2006 at 05:40 PM.
    Paolo De Dionigi
    Co-maintainer of Zen Cart Italia

  3. #3
    Join Date
    Feb 2005
    Location
    Italy
    Posts
    199
    Plugin Contributions
    0

    Default Re: Is notifier/observer system good for this?

    Hmmm... no one is using the notifier/observer system?
    Paolo De Dionigi
    Co-maintainer of Zen Cart Italia

  4. #4
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Is notifier/observer system good for this?

    Quote Originally Posted by s_p_ike
    Hmmm... no one is using the notifier/observer system?
    Can someone explain more about it?
    There is nothing much on google about it?
    Is it a new concept or just being used in zen-cart?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Is notifier/observer system good for this?

    I'm not sure the notifier system is what you need here.

    You want the customer to download a file whose filename (when they receive it) is comprised of their order number and some text.

    When does this file get uploaded to your server for them to be able to access?
    .

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Is notifier/observer system good for this?

    Quote Originally Posted by superprg
    Can someone explain more about it?
    There is nothing much on google about it?
    Is it a new concept or just being used in zen-cart?
    Separate topic, but here's the information you seek:
    http://www.zen-cart.com/wiki/index.p...Observer_Class
    .

    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.

 

 

Similar Threads

  1. v151 Multiple Observer Classes for Same Notifier Event
    By Dave224 in forum General Questions
    Replies: 6
    Last Post: 8 Jul 2013, 11:07 PM
  2. Good for a basic inventory system?
    By DataDragon in forum General Questions
    Replies: 6
    Last Post: 31 Oct 2012, 01:16 PM
  3. Observer Notifier NOTIFIER_CART_GET_PRODUCTS_END Help
    By Celtic in forum General Questions
    Replies: 2
    Last Post: 9 Jun 2011, 11:22 PM
  4. Notifier/Observer problem editing Real World Example 1
    By dale88 in forum Templates, Stylesheets, Page Layout
    Replies: 23
    Last Post: 12 Mar 2010, 02:03 AM
  5. observer/notifier the "base" class
    By David Bo in forum Basic Configuration
    Replies: 1
    Last Post: 3 Apr 2007, 02:23 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