Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Last active August 29, 2015 14:19

Revisions

  1. WebEndevSnippets revised this gist Apr 14, 2015. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,11 @@
    add_filter( 'woocommerce_payment_complete_order_status', 'bryce_wc_autocomplete_paid_orders' );
    /**
    * Add login/logout and registration links to header menu
    *
    * @author Bryce Adams
    * @link http://bryceadams.com/autocomplete-orders-woocommerce/
    *
    */
    function bryce_wc_autocomplete_paid_orders( $order_status, $order_id ) {

    $order = wc_get_order( $order_id );
  2. WebEndevSnippets renamed this gist Apr 14, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. WebEndevSnippets renamed this gist Apr 14, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. WebEndevSnippets created this gist Apr 14, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    add_filter( 'woocommerce_payment_complete_order_status', 'bryce_wc_autocomplete_paid_orders' );
    function bryce_wc_autocomplete_paid_orders( $order_status, $order_id ) {

    $order = wc_get_order( $order_id );

    if ( $order_status == 'processing' && ( $order->status == 'on-hold' || $order->status == 'pending' || $order->status == 'failed' ) ) {
    return 'completed';
    }

    return $order_status;

    }