Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Specific notifier question - experts please!

    I'm dumbfounded here... I created some custom functions that are triggered when the following event notifier is triggered:

    NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS

    The functions do some extra stock management duties after an order is completed and I thought this would be the best notifier to use. And it works fine... so long as the customer pays by cheque or money order. If they choose PayPal, it never gets triggered and I can't figure out why.

    Anyone have any ideas? Or if someone is very familiar with the notifiers... is there a better one for me to use? I want my functions to happen right when the stock is decremented at the end of a purchase.

    Thanks.

    - Steven

  2. #2
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,930
    Plugin Contributions
    4

    Default Re: Specific notifier question - experts please!

    Hi,

    The problem occurs because paypal IPN does not use the standard checkout process to create orders. (as the order is only created when the ipn_main_handler code is called by paypal)

    In a sense this is our fault, in that it would have been better to put the notifier in the order class method itself. Rarther than in checkout process.

    Fixing that is a little bit more difficult, as it needs to be done in a way that won't affect upgrades and suits your purpose.

    what should work for u is to add a notifier to the order class. At line 860 directly after

    $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM

    e.g.

    $this->notify('NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS');

    I'll ensure this is added to our SVN so it does not break future code.

    U can then use the new notifier instead of the one u were using. This should then work with paypal ipn.

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

    Default Re: Specific notifier question - experts please!

    Thanks wilt!

    Will this still work as expected if the customer ends up bailing on the order during the PayPal transaction? I want to execute my code if AND ONLY IF the order gets "completed"... that is, an order number is generated and the order is commited to the DB.

    Thanks again.

    - Steven

  4. #4
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,930
    Plugin Contributions
    4

    Default Re: Specific notifier question - experts please!

    yes. The function is only ever called when processing a completed order, whether ftom the checkout_process module for the majority of payment methods, or from paypal IPN handler.

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

    Default Re: Specific notifier question - experts please!

    Thanks again!

    One more question... does this become obsolete in 1.3.7?? I saw one of the "features" was no longer relying on the IPN send back?? I could very well be interpreting what that means incorrectly.

    - Steven

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

    Default Re: Specific notifier question - experts please!

    actually... that's not right either :)

    I tested it and it didn't work at all. Changing it to this seems to work (at least for cheque/money order - still haven't tested for PP yet)

    Code:
    $zco_notifier->notify('NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS');
    - Steven

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

    Default Re: Specific notifier question - experts please!

    $this->notify should work fine from within the order class, as the notifier components are inherited from the base class.
    Not sure why you're having a problem with that ...
    .

    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.

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

    Default Re: Specific notifier question - experts please!

    Quote Originally Posted by s_mack View Post
    Thanks again!

    One more question... does this become obsolete in 1.3.7?? I saw one of the "features" was no longer relying on the IPN send back?? I could very well be interpreting what that means incorrectly.

    - Steven
    The IPN is not totally obsolete in 1.3.7, as even with Express Checkout it is used to process notifications related to events that occur within your PayPal account, such as echeck clearance notices (which also mark the order as Processing and releases downloads etc) and manual accepting of payments from unconfirmed addresses or non-standard currencies, etc.
    And, the original PayPal IPN payment module also still relies on the IPN postback exclusively for its ability to function.
    .

    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.

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

    Default Re: Specific notifier question - experts please!

    Thanks Dr.B

    I don't know why $this doesn't work if it should... but it doesn't on mine. And if it should work, then why does EVERY reference to "notify" in that file have $zco_notifier-> in front of it rather than $this-> ?

    Even though I've come a LONG way, its not like I ever read the PHP book from cover to cover :) And I admit I really don't understand those -> references and how they work (or even what they are called). I just see patterns and try to emulate them when it comes to those, and I saw all the other ones were called with a $zco_notifier.

    Actually, while I'm on it, if you could give me some keywords to search for regarding the -> things, I'd appreciate it because I'd like to learn. Googling "$this->" doesn't really get me much :)

    - Steven

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

    Default Re: Specific notifier question - experts please!

    Hmm... this just crossed my mind. Is it because of the way I've set up my observer that it doesn't do anything??

    Code:
    class stockManager extends base {
    	function stockManager() {
        	global $zco_notifier;
    		$zco_notifier->attach($this, array('NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS', 'NOTIFY_HEADER_END_SHOPPING_CART', 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING', 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION'));
    	}
    	function update(&$callingClass, $notifier, $paramsArray) {
    		if ($notifier ==  'NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS') { ...
    - Steven

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Notifier question
    By hubert in forum Code Collaboration
    Replies: 19
    Last Post: 8 Feb 2016, 12:42 AM
  2. v151 Notifier help please
    By slobadog in forum General Questions
    Replies: 12
    Last Post: 7 Mar 2013, 11:14 AM
  3. zone specific flat rate shipping question
    By Lockerroom in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Jan 2010, 07:21 PM
  4. Shipping question for Zen Experts????????
    By pegog in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 21 Jun 2008, 03:32 PM

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