Changeset 3328213
- Timestamp:
- 07/15/2025 12:25:44 PM (9 months ago)
- Location:
- svea-checkout-for-woocommerce
- Files:
-
- 8 edited
- 1 copied
-
tags/3.3.3 (copied) (copied from svea-checkout-for-woocommerce/trunk)
-
tags/3.3.3/inc/Admin.php (modified) (5 diffs)
-
tags/3.3.3/readme.txt (modified) (3 diffs)
-
tags/3.3.3/svea-checkout-for-woocommerce.php (modified) (2 diffs)
-
tags/3.3.3/vendor/composer/platform_check.php (modified) (1 diff)
-
trunk/inc/Admin.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/svea-checkout-for-woocommerce.php (modified) (2 diffs)
-
trunk/vendor/composer/platform_check.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
svea-checkout-for-woocommerce/tags/3.3.3/inc/Admin.php
r3320066 r3328213 25 25 */ 26 26 const AWAITING_ORDER_STATUS_FULL = 'wc-awaiting-svea'; 27 28 /** 29 * Order items that have been removed in this request 30 * This is used since Svea has a delay in updating their API 31 * 32 * @var array 33 */ 34 protected $cancelled_order_items = []; 27 35 28 36 /** … … 673 681 $payment_admin->cancel_order_row( $svea_order_id, $svea_order_item_id ); 674 682 wp_cache_delete( $svea_order_id, 'svea_co_admin_svea_orders' ); 683 684 // Svea is slow to update the order rows so we make sure that we mark this order item as removed in our cache 685 $this->cancelled_order_items[] = $svea_order_id . '_' . $svea_order_item_id; 675 686 } catch ( \Exception $e ) { 676 687 WC_Gateway_Svea_Checkout::log( sprintf( 'Received error when removing order row in Svea admin: %s', $e->getMessage() ) ); … … 678 689 } 679 690 } 691 692 // Removing an order item triggers a recount of the order totals and taxes so we need to make sure 693 // that everything is in sync 694 WC_Gateway_Svea_Checkout::log( 'Syncing order totals after item removal.' ); 695 add_action( 'woocommerce_order_after_calculate_totals', [ $this, 'admin_update_order' ], 10, 2 ); 680 696 } 681 697 … … 691 707 if ( did_action( 'wp_ajax_woocommerce_save_order_items' ) ) { 692 708 $this->admin_update_order( false, wc_get_order( $order_id ) ); 693 694 709 } else { 695 710 // Recount the order totals and taxes … … 825 840 // Calculate diff for total 826 841 foreach ( $svea_order_items as $svea_order_item ) { 827 if ( $svea_order_item['OrderRowId'] === $rounding_order_row_id || $svea_order_item['IsCancelled'] ) { 842 if ( $svea_order_item['OrderRowId'] === $rounding_order_row_id || $svea_order_item['IsCancelled'] 843 || in_array( $svea_order_id . '_' . $svea_order_item['OrderRowId'], $this->cancelled_order_items, true ) ) { 828 844 continue; 829 845 } -
svea-checkout-for-woocommerce/tags/3.3.3/readme.txt
r3324844 r3328213 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 3.3. 212 Stable tag: 3.3.3 13 13 14 14 Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout! … … 91 91 == Upgrade Notice == 92 92 93 = 3.3.3 = 94 3.3.3 is a patch release 95 93 96 = 3.3.2 = 94 97 3.3.2 is a patch release … … 390 393 391 394 == Changelog == 395 396 = 3.3.3 2025-07-15 = 397 - Sync all order rows when an order item is removed in admin. This ensures that taxes are updated when WooCommerce re-calculates totals triggered by an order item removal. 392 398 393 399 = 3.3.2 2025-07-09 = -
svea-checkout-for-woocommerce/tags/3.3.3/svea-checkout-for-woocommerce.php
r3324844 r3328213 14 14 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/ 15 15 * Description: Process payments in WooCommerce via Svea Checkout. 16 * Version: 3.3. 216 * Version: 3.3.3 17 17 * Requires Plugins: woocommerce 18 18 * Author: The Generation AB … … 47 47 * Version of plugin 48 48 */ 49 const VERSION = '3.3. 2';49 const VERSION = '3.3.3'; 50 50 51 51 /** -
svea-checkout-for-woocommerce/tags/3.3.3/vendor/composer/platform_check.php
r3088414 r3328213 20 20 } 21 21 } 22 trigger_error( 23 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 E_USER_ERROR 22 throw new \RuntimeException( 23 'Composer detected issues in your platform: ' . implode(' ', $issues) 25 24 ); 26 25 } -
svea-checkout-for-woocommerce/trunk/inc/Admin.php
r3320066 r3328213 25 25 */ 26 26 const AWAITING_ORDER_STATUS_FULL = 'wc-awaiting-svea'; 27 28 /** 29 * Order items that have been removed in this request 30 * This is used since Svea has a delay in updating their API 31 * 32 * @var array 33 */ 34 protected $cancelled_order_items = []; 27 35 28 36 /** … … 673 681 $payment_admin->cancel_order_row( $svea_order_id, $svea_order_item_id ); 674 682 wp_cache_delete( $svea_order_id, 'svea_co_admin_svea_orders' ); 683 684 // Svea is slow to update the order rows so we make sure that we mark this order item as removed in our cache 685 $this->cancelled_order_items[] = $svea_order_id . '_' . $svea_order_item_id; 675 686 } catch ( \Exception $e ) { 676 687 WC_Gateway_Svea_Checkout::log( sprintf( 'Received error when removing order row in Svea admin: %s', $e->getMessage() ) ); … … 678 689 } 679 690 } 691 692 // Removing an order item triggers a recount of the order totals and taxes so we need to make sure 693 // that everything is in sync 694 WC_Gateway_Svea_Checkout::log( 'Syncing order totals after item removal.' ); 695 add_action( 'woocommerce_order_after_calculate_totals', [ $this, 'admin_update_order' ], 10, 2 ); 680 696 } 681 697 … … 691 707 if ( did_action( 'wp_ajax_woocommerce_save_order_items' ) ) { 692 708 $this->admin_update_order( false, wc_get_order( $order_id ) ); 693 694 709 } else { 695 710 // Recount the order totals and taxes … … 825 840 // Calculate diff for total 826 841 foreach ( $svea_order_items as $svea_order_item ) { 827 if ( $svea_order_item['OrderRowId'] === $rounding_order_row_id || $svea_order_item['IsCancelled'] ) { 842 if ( $svea_order_item['OrderRowId'] === $rounding_order_row_id || $svea_order_item['IsCancelled'] 843 || in_array( $svea_order_id . '_' . $svea_order_item['OrderRowId'], $this->cancelled_order_items, true ) ) { 828 844 continue; 829 845 } -
svea-checkout-for-woocommerce/trunk/readme.txt
r3324844 r3328213 10 10 License: Apache 2.0 11 11 License URI: https://www.apache.org/licenses/LICENSE-2.0 12 Stable tag: 3.3. 212 Stable tag: 3.3.3 13 13 14 14 Supercharge your WooCommerce Store with powerful features to pay via Svea Checkout! … … 91 91 == Upgrade Notice == 92 92 93 = 3.3.3 = 94 3.3.3 is a patch release 95 93 96 = 3.3.2 = 94 97 3.3.2 is a patch release … … 390 393 391 394 == Changelog == 395 396 = 3.3.3 2025-07-15 = 397 - Sync all order rows when an order item is removed in admin. This ensures that taxes are updated when WooCommerce re-calculates totals triggered by an order item removal. 392 398 393 399 = 3.3.2 2025-07-09 = -
svea-checkout-for-woocommerce/trunk/svea-checkout-for-woocommerce.php
r3324844 r3328213 14 14 * Plugin URI: https://wordpress.org/plugins/svea-checkout-for-woocommerce/ 15 15 * Description: Process payments in WooCommerce via Svea Checkout. 16 * Version: 3.3. 216 * Version: 3.3.3 17 17 * Requires Plugins: woocommerce 18 18 * Author: The Generation AB … … 47 47 * Version of plugin 48 48 */ 49 const VERSION = '3.3. 2';49 const VERSION = '3.3.3'; 50 50 51 51 /** -
svea-checkout-for-woocommerce/trunk/vendor/composer/platform_check.php
r3088414 r3328213 20 20 } 21 21 } 22 trigger_error( 23 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 E_USER_ERROR 22 throw new \RuntimeException( 23 'Composer detected issues in your platform: ' . implode(' ', $issues) 25 24 ); 26 25 }
Note: See TracChangeset
for help on using the changeset viewer.