• Resolved socatech

    (@socatech)


    I have the following php snippet I want to use for my site. If I add the snippet directly to the theme functions.php file, the snippet works fine but if I add it to my install of WPCode Lite it doesn’t work. I have other php snippets I have added to WPCode Lite that work fine so I’m not sure why this one won’t work.

    the code:

    add_action( 'woocommerce_order_status_processing_to_on-hold', 'enable_processing_to_on_hold_notification', 10, 2 );
    function enable_processing_to_on_hold_notification( $order_id, $order ){
        // Getting all WC_emails array objects
        $mailer = WC()->mailer()->get_emails();
    
        // Send the "On Hold" notification
        $mailer['WC_Email_Customer_On_Hold_Order']->trigger( $order_id );
    }

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @socatech,

    You mentioned that other snippets are working so the first thing I suggest looking for is if one of your other snippets have a PHP comment that is not closed or a closing PHP tag “?>” at the end (it should not be possible in the latest version but it could be before).

    Either of those could prevent the execution of other snippets loaded after them.

    Thread Starter socatech

    (@socatech)

    Yes it was another snippet causing the problem. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php snippet not working’ is closed to new replies.