Changeset 3248052
- Timestamp:
- 02/27/2025 06:45:22 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
r3245884 r3248052 4 4 * Plugin URI: https://wordpress.org/plugins/ceretax/ 5 5 * Description: Simplify sales tax complexity with CereTax for WooCommerce. 6 * Version: 1.3. 76 * Version: 1.3.8 7 7 * Author: CereTax, Inc. 8 8 * Author URI: https://www.ceretax.com/ -
ceretax/trunk/changelog.txt
r3245884 r3248052 36 36 2025-02-24 - version 1.3.7 37 37 * fix - If the tax showing zero in order calculation issue 38 39 2025-02-27 - version 1.3.8 40 * fix - Restore to 1.3.6 functionality 41 -
ceretax/trunk/inc/admin/class-cwafc-admin-action.php
r3245884 r3248052 389 389 */ 390 390 public function action__cwafc_admin_footer_function() { 391 $order_id = null; 391 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
r3245884 r3248052 115 115 116 116 $ceretax_data = get_post_meta( $order_id, 'ceretax_data', true ); 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 ) { 117 if ( empty( $ceretax_data ) ) { 120 118 return; 121 119 } 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 120 $ceretax_data = json_decode( $ceretax_data ); 129 121 $cere_tax_name = get_option( CWAFC_PREFIX . '_cere_tax_name', 'Tax' ); 130 122 $total_tax_invoice = abs( $ceretax_data->invoice->totalTaxInvoice ); 123 131 124 $order = wc_get_order( $order_id ); 132 125 $fee_amount = null; 133 126 $order_total_fees = $order->get_total_fees(); 134 127 $order_remain_fees = 0; 135 136 128 foreach ( $order->get_fees() as $fee_id => $fee ) { 137 129 if ( $fee->get_name() === $cere_tax_name ) { … … 144 136 } 145 137 } 138 146 139 if ( 0 < $order_remain_fees ) { 147 140 echo '<tr>'; … … 754 747 public function action__cwafc_checkout_field_update_order_meta( $order_id ) { 755 748 $ceretax_data = WC()->session->get( 'ceretax_data' ); 756 if ( ! empty( $ceretax_data ) ) { 757 update_post_meta( $order_id, 'ceretax_data', wp_json_encode( $ceretax_data ) ); 758 } 749 update_post_meta( $order_id, 'ceretax_data', wp_json_encode( $ceretax_data ) ); 759 750 } 760 751 … … 1342 1333 } 1343 1334 update_post_meta( $order->get_id(), 'ceretax_data', wp_json_encode( $data ) ); 1344 WC()->session->set( 'ceretax_data', $data );1345 1335 return $data['invoice']['totalTaxInvoice']; 1346 1336 } … … 1382 1372 } 1383 1373 update_post_meta( $order->get_id(), 'ceretax_data', wp_json_encode( $data ) ); 1384 WC()->session->set( 'ceretax_data', $data );1385 1374 return $data['invoice']['totalTaxInvoice']; 1386 1375 } -
ceretax/trunk/readme.txt
r3245884 r3248052 5 5 Tested up to: 6.6.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 77 Stable tag: 1.3.8 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.8 = 39 * fix - Restore to 1.3.6 functionality 37 40 38 41 = 1.3.7 = … … 74 77 == Upgrade Notice == 75 78 79 = 1.3.8 = 80 * fix - Restore to 1.3.6 functionality 81 76 82 = 1.3.7 = 77 83 * fix - If the tax showing zero in order calculation issue
Note: See TracChangeset
for help on using the changeset viewer.