Changeset 2289186
- Timestamp:
- 04/22/2020 11:15:53 AM (4 years ago)
- Location:
- autocomplete-woocommerce-orders
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
autocomplete-woocommerce-orders/tags/1.2.1/includes/class-admin.php
r2289148 r2289186 72 72 } 73 73 } elseif ($mode == 'virtual') { 74 add_action( 'woocommerce_payment_complete_order_status', 'silkwave_auto_complete_paid_order', 10, 3 ); 75 function silkwave_auto_complete_paid_order( $status, $order_id, $order ) { 76 return 'completed'; 74 add_action( 'woocommerce_payment_complete_order_status', 'silkwave_auto_complete_virtual_paid_order', 10, 3 ); 75 function silkwave_auto_complete_virtual_paid_order( $status, $order_id, $order ) { 76 $virtual_order = null; 77 if ( count( $order->get_items() ) > 0 ) { 78 foreach ( $order->get_items() as $item ) { 79 if ( 'line_item' == $item['type'] ) { 80 if ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) { 81 $_product = $order->get_product_from_item( $item ); 82 } else { 83 $_product = $item->get_product(); 84 } 85 if ( ! $_product->is_virtual() ) { 86 $virtual_order = false; 87 break; 88 } else { 89 $virtual_order = true; 90 } 91 } 92 } 93 } 94 if ( $virtual_order ) { 95 return 'completed'; 96 } 77 97 } 78 98 } -
autocomplete-woocommerce-orders/trunk/autocomplete-woocommerce-orders.php
r2289157 r2289186 4 4 * Plugin URI: https://wordpress.org/plugins/autocomplete-woocommerce-orders/ 5 5 * Description: Autocomplete your WooCommerce orders with ease. This plugins works with most major payment providers including PayPal, SagePay and Stripe. 6 * Version: 1.2. 16 * Version: 1.2. 7 7 * Author: Liam McArthur 8 8 * Author URI: https://www.silkwave.co.uk -
autocomplete-woocommerce-orders/trunk/includes/class-admin.php
r2289148 r2289186 72 72 } 73 73 } elseif ($mode == 'virtual') { 74 add_action( 'woocommerce_payment_complete_order_status', 'silkwave_auto_complete_paid_order', 10, 3 ); 75 function silkwave_auto_complete_paid_order( $status, $order_id, $order ) { 76 return 'completed'; 74 add_action( 'woocommerce_payment_complete_order_status', 'silkwave_auto_complete_virtual_paid_order', 10, 3 ); 75 function silkwave_auto_complete_virtual_paid_order( $status, $order_id, $order ) { 76 $virtual_order = null; 77 if ( count( $order->get_items() ) > 0 ) { 78 foreach ( $order->get_items() as $item ) { 79 if ( 'line_item' == $item['type'] ) { 80 if ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) { 81 $_product = $order->get_product_from_item( $item ); 82 } else { 83 $_product = $item->get_product(); 84 } 85 if ( ! $_product->is_virtual() ) { 86 $virtual_order = false; 87 break; 88 } else { 89 $virtual_order = true; 90 } 91 } 92 } 93 } 94 if ( $virtual_order ) { 95 return 'completed'; 96 } 77 97 } 78 98 } -
autocomplete-woocommerce-orders/trunk/readme.txt
r2289160 r2289186 43 43 == Changelog == 44 44 45 46 47 45 48 = 1.2.1 = 46 49 * Reverted some core logic. It looks like this isn't working for some other gateways. A fix has also been pushed for Virtual orders
Note: See TracChangeset
for help on using the changeset viewer.