#1688 ✓closed
Hiranthi

Hooking into shopp_order_success doesn't do anything

Reported by Hiranthi | April 2nd, 2012 @ 08:40 AM

For the Wishlist Pro plugin I'm relying on the shopp_order_success hook. Since the upgrade to 1.2 it doesn't appear to work anymore.

I've added debug messages to the top of the two functions that hook into shopp_order_success, but the debugging messages never get into the log (and yes, it's set to Debugging Messages).

Errors

None related to the functions I'm using.

Relevant Code
function shoppgiftcert_make_gift_certificate(&$Purchase)
{
    // the following should be added to the log, but isn't
    if(SHOPP_DEBUG) new ShoppError('Inside shoppgiftcert_make_gift_certificate',false,SHOPP_DEBUG_ERR);
}
add_action('shopp_order_success','shoppgiftcert_make_gift_certificate');
Environment

Server OS: Linux
Web Server: Apache
PHP version: 5.3.8
WordPress Version: 3.3.1
Shopp Version: 1.2
Shopp Install: upgrade from 1.1.9

Comments and changes to this ticket

  • Hiranthi

    Hiranthi April 2nd, 2012 @ 08:43 AM

    • Tag changed from shopp_order_success to shopp_order_success, shopp_order_txnstatus_update

    Oh and same goes for the shopp_order_txnstatus_update hook.

    function shoppgiftcert_txnstatus_update(&$status, &$Purchase)
    {
        if(SHOPP_DEBUG) new ShoppError('Inside shoppgiftcert_txnstatus_update',false,SHOPP_DEBUG_ERR);
    } // shoppgiftcert_txnstatus_update
    add_action('shopp_order_txnstatus_update','shoppgiftcert_txnstatus_update', 10, 2);
    
  • Clifton Griffin

    Clifton Griffin April 2nd, 2012 @ 08:51 AM

    Hi Hiranthi,

    I use shopp_order_success in my theme in two instances with no problem. In earlier builds, the action reference didn't pass in the purchase object, but Jonathan fixed this before 1.2's release.

    Perhaps the action is being added too late? I've seen plugin load order screw things up at times.

    Just a thought..
    Clif

  • Hiranthi

    Hiranthi April 2nd, 2012 @ 08:55 AM

    It's added just like I'm stating above. Not from within another hook or anything like it, so it should just initiate without issues.

    I've seen the ticket where it states that the $Purchase object was added again, but that's not the issue in this case: the functions I'm trying to hook into shopp_order_success with don't do anything. No matter what I try.
    For troubleshooting purposes I added the ShoppErrors you can see above. The messages should be added to the debug log, but they're not. So: for whatever reason what I'm trying to add is never loaded/executed.

  • Clifton Griffin

    Clifton Griffin April 2nd, 2012 @ 08:59 AM

    Well the features I'm hooking into with shopp_order_success are mission critical for my site, so I'm confident they are working.

    It is probably worth trying to add the actions in the 'wp' action hook or something that runs after all the plugins are loaded.

    I would also use debug code that doesn't rely on SHOPP_DEBUG being populated which would only be exaggerated if it's a plugin load order issue. I like to use:

    mail('myemail@gmail.com', 'Test', 'This was a test.');
    

    Clif

    -- Clifton H. Griffin
    me@clifgriffin.com | 434.229.2474 | @clifgriffin

    That's the difference between me and the rest of the world! Happiness isn't good enough for me! I demand euphoria! - Calvin and Hobbes
    Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

  • John Dillick

    John Dillick April 3rd, 2012 @ 12:07 PM

    • State changed from “new” to “feedback”
    • Tag changed from shopp_order_success, shopp_order_txnstatus_update to feedback, shopp_order_success, shopp_order_txnstatus_update
    • Milestone set to 1.2.2
    • Milestone order changed from “756” to “0”

    Hiranthi,

    This function can not take a reference.

    function shoppgiftcert_make_gift_certificate(&$Purchase)
    

    In Shopp 1.2, this needs to be (no reference):

    function shoppgiftcert_make_gift_certificate($Purchase)
    

    John

  • Hiranthi

    Hiranthi April 4th, 2012 @ 09:46 AM

    @John, thanks. Changed it but unfortunately it doesn't change anything. For some reason it's still not executing the custom hooks. Do get a lot of these in the error log:

    2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Undefined index: GatewayFramework [orders.php, line 76] [orders.php, line 76] 2012-04-04 13:42:34 - PHP NOTICE: Trying to get property of non-object [orders.php, line 76] [orders.php, line 76]

    @Clifton, thanks for your help, but I know that's not the issue. And I need the debugging messages to be added to the Shopp debugging log, otherwise I wouldn't be using it like that.

  • Hiranthi

    Hiranthi April 24th, 2012 @ 02:29 AM

    Regarding the shopp_order_txnstatus_update hook: there is this in Order.php:

    # line 119
    add_action('shopp_order_txnstatus_update',array($this,'salestats'),10,2);
    

    But nowhere a do_action for this hook.

  • Hiranthi

    Hiranthi May 4th, 2012 @ 06:24 AM

    • Tag changed from feedback, shopp_order_success, shopp_order_txnstatus_update to resolved, shopp_order_success, shopp_order_txnstatus_update

    With some help from John through Skype I got it working.

  • Jonathan

    Jonathan May 15th, 2012 @ 03:42 PM

    • State changed from “feedback” to “closed”
    • Tag changed from resolved, shopp_order_success, shopp_order_txnstatus_update to shopp_order_success, shopp_order_txnstatus_update
    • Milestone cleared.
    • Milestone order changed from “2” to “0”
  • Nurul Umbhiya

    Nurul Umbhiya November 13th, 2015 @ 08:30 AM

    I was trying to use shopp_order_txnstatus_update hooks in one of my plugin. But this hooks doesn't do anything. I searched codebase and didn't find anything with do_action('shopp_order_txnstatus_update'); Can you please help me with this hook ?

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Plugin e-commerce for WordPress

Shared Ticket Bins

People watching this ticket