Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2012
    Posts
    151
    Plugin Contributions
    0

    Default why does not $zco_notifier->notify(...) work for ipn_main_handler.php?

    why does not $zco_notifier->notify(...) work for ipn_main_handler.php?
    I am sure that my code works in usual pages , such as when I pay with moneyOrder, it will create a xxxxx.txt at basehost.

    \includes\classes\observers\class.observers_linjuming.php codes:
    Code:
    <?php 
    	class observers_linjuming extends base{
    		function __construct(){
    			global $zco_notifier;
    			// $zco_notifier->attach($this,array('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE'));
    			$zco_notifier->attach($this,array('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE'));
    		}
    		function update(&$class,$eventID){
    			// 添加或插入用户积分
    			if($eventID == 'NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE'){
    				file_put_contents('xxxxx.txt','dddf');
    			}
    		}
    	}
    \includes\auto_loaders\config.linjuming.php codes:
    Code:
    <?php 
    
    $autoLoadConfig[1000][] = array(	'autoType'=>'class',
    													'loadFile'=>'observers/class.observers_linjuming.php');
    $autoLoadConfig[1000][] = array(	'autoType'=>'classInstantiate',
    													'className'=>'observers_linjuming',
    													'objectName'=>'observers_linjuming');


  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,723
    Plugin Contributions
    124

    Default Re: why does not $zco_notifier->notify(...) work for ipn_main_handler.php?

    This bug has been fixed in 1.5.0. For 1.3.9h you need to modify the code yourself.

    Edit the file ipn_main_handler.php at the top level of your store, find the line

    $order->send_order_email($insert_id, 2);

    it's line 354 in 1.3.9h (line 253 in 1.3.8, line 219 in 1.3.7). Change this to:

    $order->send_order_email($insert_id, 2);
    require(DIR_WS_CLASSES . 'observers/class.msg_owner.php');
    $mo = new msg_owner();
    $mo->update($this, 'NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL');

    (These notes are from the SMS on Sale plugin, which faced the same issue you are dealing with.)

    Note further that the current recommendation is to use Express Checkout and not IPN. IPN is failure prone.
    Last edited by swguy; 8 Oct 2012 at 11:48 AM.
    That Software Guy. My Store: Zen Cart Support
    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.

  3. #3
    Join Date
    Apr 2012
    Posts
    151
    Plugin Contributions
    0

    Default Re: why does not $zco_notifier->notify(...) work for ipn_main_handler.php?

    thank you very much ,your reply is very great help for me.

 

 

Similar Threads

  1. v138a What does this function "$zco_notifier->notify(" do?
    By rajoo.sharma in forum General Questions
    Replies: 2
    Last Post: 6 Sep 2012, 06:48 AM
  2. Why Does this SQL not work?
    By plymgary1 in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2011, 11:24 AM
  3. Why Does "No Picture Available" Not Work For Subcategories?
    By msmith29063 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jun 2010, 12:32 AM
  4. Replies: 0
    Last Post: 18 Nov 2009, 07:29 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