Support » Plugin: PW WooCommerce Gift Cards » Order Status “Processing” to Send Gift Card Code

  • Resolved José

    (@alquimia)


    Hi,

    How I can change the order status to send de gift card code email, when the order are in “Processing” state.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pimwick

    (@pimwick)

    By default, we only send the gift card email once the order has been marked Complete. Follow these instructions to create and email the gift card when the order is received instead:

    1. Download the functions.php from your FTP server at /wp-content/themes/<your theme>/functions.php
    2. Keep a backup of functions.php in case there are problems.
    3. Edit functions.php and scroll to the very end and add this code.

    Note: if the last line is “?>” then put this code *above* that line. Otherwise, this code goes at the very end of the file:

    function custom_woocommerce_order_status_processing( $order_id, $order ) {
        global $pw_gift_cards_purchasing;
    
        $pw_gift_cards_purchasing->add_gift_cards_to_order( $order_id, $order, "order_id: $order_id completed" );
    }
    add_action( 'woocommerce_order_status_processing', 'custom_woocommerce_order_status_processing', 11, 2 );

    4. Save the functions.php file and re-upload it to your server.

    If you have any problems, replace functions.php with your backup file.

    Let me know if you have any questions!

    José

    (@alquimia)

    Thank you

    Plugin Author pimwick

    (@pimwick)

    You’re welcome, let us know if you need anything else. Best of luck with your store!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order Status “Processing” to Send Gift Card Code’ is closed to new replies.