Changeset 3437092
- Timestamp:
- 01/11/2026 03:12:32 PM (3 months ago)
- Location:
- shieldclimb-auto-complete-orders-for-woocommerce/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
shieldclimb-auto-complete-orders.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shieldclimb-auto-complete-orders-for-woocommerce/trunk/readme.txt
r3327656 r3437092 1 1 === ShieldClimb – Auto Complete Orders for WooCommerce === 2 2 Contributors: shieldclimb 3 Donate link: https://shieldclimb.com/ 3 Donate link: https://shieldclimb.com/product/donate-now/ 4 4 Tags: Order Completion, Digital Products, Payment Integration, Virtual Products, WooCommerce 5 5 Requires at least: 5.8 6 Tested up to: 6. 87 Stable tag: 1.0. 26 Tested up to: 6.9 7 Stable tag: 1.0.3 8 8 Requires PHP: 7.2 9 9 WC requires at least: 5.8 10 WC tested up to: 9.9.510 WC tested up to: 10.4.3 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 66 66 == ChangeLog == 67 67 68 = V1.0.3 = 69 70 * **Updated**: Auto-complete now works more reliably with virtual & downloadable orders 71 * **Fixed**: Compatibility with ShopMagic and other email/automation plugins 72 * **Updated**: Tested up to WordPress 6.9 and WooCommerce 10.4.3 73 68 74 = V1.0.2 = 69 75 -
shieldclimb-auto-complete-orders-for-woocommerce/trunk/shieldclimb-auto-complete-orders.php
r3327656 r3437092 5 5 * Plugin URI: https://shieldclimb.com/free-woocommerce-plugins/auto-complete-orders/ 6 6 * Description: Auto Complete Orders for WooCommerce after payment. Works with downloadable & virtual products. Fast, lightweight & compatible with gateways. 7 * Version: 1.0. 27 * Version: 1.0.3 8 8 * Requires Plugins: woocommerce 9 9 * Requires at least: 5.8 10 * Tested up to: 6. 810 * Tested up to: 6.9 11 11 * WC requires at least: 5.8 12 * WC tested up to: 9.9.512 * WC tested up to: 10.4.3 13 13 * Requires PHP: 7.2 14 14 * Author: shieldclimb.com 15 * Author URI: https://shieldclimb.com/ about-us/15 * Author URI: https://shieldclimb.com/ 16 16 * License: GPLv2 or later 17 17 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 22 22 } 23 23 24 add_action('woocommerce_thankyou', 'shieldclimb_auto_complete_virtual_or_downloadable_order'); 24 add_action( 25 'woocommerce_order_status_processing', 26 'shieldclimb_auto_complete_virtual_or_downloadable_order' 27 ); 25 28 26 29 function shieldclimb_auto_complete_virtual_or_downloadable_order($order_id) { 27 if (!$order_id) return; 30 if (! $order_id) { 31 return; 32 } 28 33 29 34 $order = wc_get_order($order_id); 35 if (! $order) { 36 return; 37 } 30 38 31 // Check if the order contains only virtual or downloadable items 32 $shieldclimb_virtual_or_downloadable = true; 39 $only_virtual_or_downloadable = true; 33 40 34 41 foreach ($order->get_items() as $item) { 35 42 $product = $item->get_product(); 36 43 37 if (!$product || (! $product->is_virtual() && ! $product->is_downloadable())) { 38 $shieldclimb_virtual_or_downloadable = false; 44 if ( 45 ! $product || 46 (! $product->is_virtual() && ! $product->is_downloadable()) 47 ) { 48 $only_virtual_or_downloadable = false; 39 49 break; 40 50 } 41 51 } 42 52 43 // Auto-complete if all items are virtual or downloadable 44 if ($shieldclimb_virtual_or_downloadable && $order->get_status() === 'processing') { 45 $order->update_status('completed'); 53 if ($only_virtual_or_downloadable) { 54 $order->update_status( 55 'completed', 56 'Auto-completed by ShieldClimb for virtual/downloadable products.' 57 ); 46 58 } 47 59 }
Note: See TracChangeset
for help on using the changeset viewer.