Changeset 3245884
- Timestamp:
- 02/24/2025 04:37:53 PM (13 months ago)
- Location:
- ceretax/trunk
- Files:
-
- 5 edited
-
ceretax.php (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
inc/admin/class-cwafc-admin-action.php (modified) (1 diff)
-
inc/class-cwafc.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ceretax/trunk/ceretax.php
r3243455 r3245884 4 4 * Plugin URI: https://wordpress.org/plugins/ceretax/ 5 5 * Description: Simplify sales tax complexity with CereTax for WooCommerce. 6 * Version: 1.3. 66 * Version: 1.3.7 7 7 * Author: CereTax, Inc. 8 8 * Author URI: https://www.ceretax.com/ -
ceretax/trunk/changelog.txt
r3243455 r3245884 33 33 2025-02-19 - version 1.3.6 34 34 * fix - * fix - If fee name changed from admin option, destroy order calculation issue 35 36 2025-02-24 - version 1.3.7 37 * fix - If the tax showing zero in order calculation issue -
ceretax/trunk/inc/admin/class-cwafc-admin-action.php
r3232301 r3245884 389 389 */ 390 390 public function action__cwafc_admin_footer_function() { 391 391 $order_id = null; 392 392 if ( ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) || ( isset( $_GET['id'] ) && ! empty( $_GET['id'] ) ) ) { 393 393 if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { -
ceretax/trunk/inc/class-cwafc.php
r3243455 r3245884 115 115 116 116 $ceretax_data = get_post_meta( $order_id, 'ceretax_data', true ); 117 if ( empty( $ceretax_data ) ) { 117 118 // If it's empty or an invalid JSON string, return early. 119 if ( empty( $ceretax_data ) || ! is_string( $ceretax_data ) || json_decode( $ceretax_data ) === null ) { 118 120 return; 119 121 } 120 $ceretax_data = json_decode( $ceretax_data ); 122 $ceretax_data = json_decode( $ceretax_data ); 123 124 // Ensure decoding is successful and required property exists. 125 if ( ! $ceretax_data || ! isset( $ceretax_data->invoice->totalTaxInvoice ) ) { 126 return; 127 } 128 121 129 $cere_tax_name = get_option( CWAFC_PREFIX . '_cere_tax_name', 'Tax' ); 122 130 $total_tax_invoice = abs( $ceretax_data->invoice->totalTaxInvoice ); 123 124 131 $order = wc_get_order( $order_id ); 125 132 $fee_amount = null; 126 133 $order_total_fees = $order->get_total_fees(); 127 134 $order_remain_fees = 0; 135 128 136 foreach ( $order->get_fees() as $fee_id => $fee ) { 129 137 if ( $fee->get_name() === $cere_tax_name ) { … … 136 144 } 137 145 } 138 139 146 if ( 0 < $order_remain_fees ) { 140 147 echo '<tr>'; … … 747 754 public function action__cwafc_checkout_field_update_order_meta( $order_id ) { 748 755 $ceretax_data = WC()->session->get( 'ceretax_data' ); 749 update_post_meta( $order_id, 'ceretax_data', wp_json_encode( $ceretax_data ) ); 756 if ( ! empty( $ceretax_data ) ) { 757 update_post_meta( $order_id, 'ceretax_data', wp_json_encode( $ceretax_data ) ); 758 } 750 759 } 751 760 … … 1333 1342 } 1334 1343 update_post_meta( $order->get_id(), 'ceretax_data', wp_json_encode( $data ) ); 1344 WC()->session->set( 'ceretax_data', $data ); 1335 1345 return $data['invoice']['totalTaxInvoice']; 1336 1346 } … … 1372 1382 } 1373 1383 update_post_meta( $order->get_id(), 'ceretax_data', wp_json_encode( $data ) ); 1384 WC()->session->set( 'ceretax_data', $data ); 1374 1385 return $data['invoice']['totalTaxInvoice']; 1375 1386 } -
ceretax/trunk/readme.txt
r3243455 r3245884 5 5 Tested up to: 6.6.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 67 Stable tag: 1.3.7 8 8 License: GNU General Public License v3.0 9 9 URI: http://www.gnu.org/licenses/gpl-3.0.html … … 35 35 36 36 == Changelog == 37 38 = 1.3.7 = 39 * fix - If the tax showing zero in order calculation issue 37 40 38 41 = 1.3.6 = … … 71 74 == Upgrade Notice == 72 75 76 = 1.3.7 = 77 * fix - If the tax showing zero in order calculation issue 78 73 79 = 1.3.6 = 74 80 * fix - If fee name changed from admin option, destroy order calculation issue
Note: See TracChangeset
for help on using the changeset viewer.