Changeset 3357953
- Timestamp:
- 09/08/2025 01:53:49 PM (7 months ago)
- Location:
- ceretax
- Files:
-
- 27 added
- 5 edited
-
tags/1.4.4 (added)
-
tags/1.4.4/assets (added)
-
tags/1.4.4/assets/css (added)
-
tags/1.4.4/assets/css/admin.css (added)
-
tags/1.4.4/assets/js (added)
-
tags/1.4.4/assets/js/admin.js (added)
-
tags/1.4.4/assets/js/front.js (added)
-
tags/1.4.4/ceretax.php (added)
-
tags/1.4.4/changelog.txt (added)
-
tags/1.4.4/inc (added)
-
tags/1.4.4/inc/admin (added)
-
tags/1.4.4/inc/admin/class-cwafc-admin-action.php (added)
-
tags/1.4.4/inc/admin/class-cwafc-admin-action.php-live020725 (added)
-
tags/1.4.4/inc/admin/class-cwafc-admin-filter.php (added)
-
tags/1.4.4/inc/admin/class-cwafc-admin.php (added)
-
tags/1.4.4/inc/class-cwafc.php (added)
-
tags/1.4.4/inc/front (added)
-
tags/1.4.4/inc/front/class-cwafc-front-action.php (added)
-
tags/1.4.4/inc/front/class-cwafc-front-filter.php (added)
-
tags/1.4.4/inc/front/class-cwafc-front.php (added)
-
tags/1.4.4/languages (added)
-
tags/1.4.4/languages/ceretax.pot (added)
-
tags/1.4.4/readme.txt (added)
-
tags/1.4.4/woocommerce (added)
-
tags/1.4.4/woocommerce/cart (added)
-
tags/1.4.4/woocommerce/cart/shipping-calculator.php (added)
-
trunk/ceretax.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/inc/admin/class-cwafc-admin-action.php (modified) (3 diffs)
-
trunk/inc/admin/class-cwafc-admin-action.php-live020725 (added)
-
trunk/inc/class-cwafc.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ceretax/trunk/ceretax.php
r3320210 r3357953 3 3 * Plugin Name: CereTax 4 4 * Plugin URI: https://wordpress.org/plugins/ceretax/ 5 * Description: Simplify sales tax complexity with CereTax for WooCommerce. 6 * Version: 1.4. 35 * Description: Simplify sales tax complexity with CereTax for WooCommerce. 6 * Version: 1.4.4 7 7 * Author: CereTax, Inc. 8 8 * Author URI: https://www.ceretax.com/ … … 39 39 // Version of plugin. 40 40 if ( ! defined( 'CWAFC_VERSION' ) ) { 41 define( 'CWAFC_VERSION', '1.4. 2' );41 define( 'CWAFC_VERSION', '1.4.4' ); 42 42 } 43 43 -
ceretax/trunk/changelog.txt
r3320210 r3357953 56 56 * fix - Resolved PHP warning errors 57 57 * add - Included 'shipFromAddress' parameter in the ceretax API request 58 59 2025-08-13 - version 1.4.4 60 * fix : The transactions can be fully refunded 61 * fix : We have resolved the tax amount mismatch in tax total column and summary 62 * fix : Taxes are now displayed for variable items also -
ceretax/trunk/inc/admin/class-cwafc-admin-action.php
r3320210 r3357953 611 611 $ceretax_data_lineitem = json_decode( get_post_meta( $order_id, 'ceretax_data_lineitem', true ) ); 612 612 $ceretax_data = json_decode( get_post_meta( $order_id, 'ceretax_data', true ) ); 613 $parent_order_id = $order->get_meta( '_dws_lo_parent', true ); 614 $order_shipping_total = $order->get_shipping_total(); 615 616 if ( ! empty( $ceretax_data_lineitem ) && ! empty( $ceretax_data ) && ! empty( $order ) ) { 617 618 if ( ! empty( $product ) ) { 619 620 echo '<td class="ceretax_line_value" width="7%">'; 621 622 if ( is_array( $ceretax_data_lineitem ) ) { 623 $ceretax_items_data = $ceretax_data_lineitem['invoice']['lineItems']; 624 } 625 626 if ( is_object( $ceretax_data_lineitem ) && is_object( $ceretax_data ) ) { 627 $ceretax_items_data = $ceretax_data_lineitem->invoice->lineItems; 628 $ceretax_data = $ceretax_data->invoice->lineItems; 629 630 if ( ! empty( $ceretax_items_data ) && ! empty( $ceretax_data ) ) { 631 632 // Correct the product ID for variable products 633 $product = $item->get_product(); 634 $product_id = $product->get_id(); 635 $parent_id = $product->get_parent_id(); 636 $sku = $product->get_sku(); 637 638 $line_item_total_tax_amount = 0; 639 $line_item_calc_base_amount = 0; 640 $line_item_revenue_amount = 0; 641 $line_item_total_tax = 0; 642 643 // Filter the correct line item from Ceretax data 644 if ( ! empty( $parent_order_id ) ) { 645 646 $filtered = array_filter( 647 $ceretax_items_data, 648 function ( $filtered_item ) use ( $product_id, $item_id ) { 649 return isset( $filtered_item->itemNumber ) && (string)$filtered_item->itemNumber === (string)$product_id && isset( $filtered_item->lineId ) && $filtered_item->lineId == $item_id; 650 } 651 ); 652 653 $refunded_filtered = array_filter( 654 $ceretax_data, 655 function ( $refunded_item ) use ( $product_id, $item_id ) { 656 return isset( $refunded_item->itemNumber ) && (string)$refunded_item->itemNumber === (string)$product_id && isset( $refunded_item->lineId ) && $refunded_item->lineId == $item_id; 657 } 658 ); 659 660 } else { 661 $filtered = array_filter( $ceretax_items_data, function ( $filtered_item ) use ( $product_id, $parent_id, $sku ) { 662 return ( 663 ( isset($filtered_item->itemNumber) && ( 664 (string) $filtered_item->itemNumber === (string) $product_id || 665 (string) $filtered_item->itemNumber === (string) $parent_id || 666 (string) $filtered_item->itemNumber === (string) $sku 667 ) ) 668 ); 669 }); 670 671 $refunded_filtered = array_filter( 672 $ceretax_data, 673 function ( $refunded_item ) use ( $product_id ) { 674 return isset( $refunded_item->itemNumber ) && (string)$refunded_item->itemNumber === (string)$product_id; 675 } 676 ); 677 } 678 679 $line_item_revenue_amount = ! empty( $filtered ) ? round( reset( $filtered )->revenue, 2 ) : 0; 680 $line_item_taxe_breaks = ! empty( $filtered ) ? reset( $filtered )->taxes : array(); 681 682 if ( ! empty( $line_item_taxe_breaks ) && is_array( $line_item_taxe_breaks ) ) { 683 foreach ( $line_item_taxe_breaks as $key => $val ) { 684 if ( ! empty( $val->calculationBaseAmt ) && ( $val->calculationBaseAmt >= $line_item_revenue_amount ) ) { 685 $line_item_calc_base_amount = $val->calculationBaseAmt; 686 687 if ( $val->taxTypeClassDesc !== 'RETAIL DELIVERY FEE' ) { 688 $line_item_total_tax_amount += ( $val->totalTax - $val->transactionChargesTax ); 689 } 690 } 691 } 692 } 693 694 if ( ! empty( $line_item_calc_base_amount ) ) { 695 $line_item_total_tax = $line_item_total_tax_amount; 696 } 697 698 $total_line_tax = ! empty( $filtered ) ? reset( $filtered )->totalTaxLine : null; 699 $total_line_refunded_tax = ! empty( $refunded_filtered ) ? reset( $refunded_filtered )->totalTaxLine : null; 700 $ceretax_refunded_line_item_tax = $item->get_meta( '_ceretax_refunded_line_item_tax' ); 701 702 echo '<div class="view">'; 703 echo wp_kses_post( wc_price( $line_item_total_tax, array( 'currency' => $order->get_currency() ) ) ); 704 705 if ( is_array( $order->get_refunds() ) && count( $order->get_refunds() ) > 0 && ! empty( $ceretax_refunded_line_item_tax ) ) { 706 echo '<small class="refunded">' . wp_kses_post( wc_price( -1 * $ceretax_refunded_line_item_tax, array( 'currency' => $order->get_currency() ) ) ) . '</small>'; 707 } 708 709 echo '</div>'; 710 711 echo '<div class="refund" style="display: none;"> 712 <input type="text" name="ceretax_line_total[' . absint( $item_id ) . ']" placeholder="' . esc_attr( wc_format_localized_price( 0 ) ) . '" class="refund_line_tax ceretax_line_total wc_input_price" size="4" data-line-tax="' . esc_attr( wc_format_localized_price( round( $line_item_total_tax, 2 ) ) ) . '" /> 713 </div>'; 714 } 715 } 716 717 echo '</td>'; 718 719 720 } elseif ( $item instanceof WC_Order_Item_Fee && $item->get_name() === $cere_tax_name ) { 721 echo '<td class="ceretax_line_value" width="7%"></td>'; 722 } elseif ( $item instanceof WC_Order_Item_Shipping ) { 723 724 echo '<td class="ceretax_line_value" width="7%">'; 725 726 $shipping_tax_amount = 0; 727 $shipping_line_total = $item['total']; 728 $ceretax_refunded_line_item_tax = $item->get_meta( '_ceretax_refunded_line_item_tax' ); 729 if ( ! empty( $item['total'] ) && is_object( $ceretax_data_lineitem ) ) { 730 $ceretax_items_data = $ceretax_data_lineitem->invoice->lineItems; 731 if ( ! empty( $ceretax_items_data ) ) { 732 $ceretax_items_count = 0; 733 foreach ( $ceretax_items_data as $item_data ) { 734 $line_item_tax_breaks = $item_data->taxes; 735 $transaction_charges_tax = 0; 736 $tras_charge_calc_base_amount = 0; 737 if ( ! empty( $line_item_tax_breaks ) ) { 738 foreach ( $line_item_tax_breaks as $key => $val ) { 739 if ( ! empty( $val->transactionChargesTax ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName 740 // $tras_charge_calc_base_amount = $val->transactionChargesCalculationBaseAmt; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 741 if ( $val->taxTypeClassDesc !== 'RETAIL DELIVERY FEE' ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName 742 $transaction_charges_tax = $transaction_charges_tax + $val->transactionChargesTax; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 743 } 744 } 745 } 746 } 747 if ( ! empty( $transaction_charges_tax ) ) { 748 $ceretax_items_count++; // phpcs:ignore WordPress.PHP.PreIncrement.PreIncrement 749 // $shipping_tax_amount = $shipping_tax_amount + ( $transaction_charges_tax ) * ( $shipping_line_total / $tras_charge_calc_base_amount ); 750 $shipping_tax_amount += $transaction_charges_tax; 751 } 752 } 753 } 754 } 755 if ( ! empty( $shipping_tax_amount ) && ! empty( $order_shipping_total ) ) { 756 $shipping_tax_amount = ( $shipping_tax_amount / $order_shipping_total ) * $shipping_line_total; 757 } else { 758 $shipping_tax_amount = 0; 759 } 760 echo '<div class="view">'; 761 echo wp_kses_post( wc_price( $shipping_tax_amount, array( 'currency' => $order->get_currency() ) ) ); 762 if ( is_array( $order->get_refunds() ) && count( $order->get_refunds() ) > 0 && ! empty( $ceretax_refunded_line_item_tax ) ) { 763 echo '<small class="refunded">' . wp_kses_post( wc_price( -1 * $ceretax_refunded_line_item_tax, array( 'currency' => $order->get_currency() ) ) ) . '</small>'; 764 } 765 echo '</div>'; 766 767 echo '<div class="refund" style="display: none;"> 768 <input type="text" name="ceretax_shipping_line_total[' . absint( $item_id ) . ']" placeholder="' . esc_attr( wc_format_localized_price( 0 ) ) . '" class="refund_line_tax ceretax_shipping_line_total wc_input_price" size="4" data-shipping-tax="' . esc_attr( wc_format_localized_price( round( $shipping_tax_amount, 2 ) ) ) . '" /> 769 </div>'; 770 echo '</td>'; 771 } else { 772 echo '<td class="ceretax_line_value" width="7%">'; 773 echo '</td>'; 774 } 775 } 776 } 777 778 /** 779 * Add admin order line item column header. 780 * 781 * @param object $product Product object. 782 * @param object $item Product item object. 783 * @param string $item_id Order object. 784 * @return void 785 */ 786 public function action__cwafc_woocommerce_admin_order_item_values_bckup( $product, $item, $item_id ) { 787 788 // phpcs:disable WordPress.Security.NonceVerification 789 $order_id = null; 790 if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { 791 $order_id = sanitize_text_field( wp_unslash( $_GET['post'] ) ); 792 } elseif ( isset( $_GET['id'] ) && ! empty( $_GET['id'] ) ) { 793 $order_id = sanitize_text_field( wp_unslash( $_GET['id'] ) ); 794 } else { 795 $order_id = null; 796 } 797 if ( empty( $order_id ) && isset( $_POST['order_id'] ) ) { 798 $order_id = sanitize_text_field( wp_unslash( $_POST['order_id'] ) ); 799 } 800 // phpcs:enable WordPress.Security.NonceVerification 801 802 $cere_tax_name = get_option( CWAFC_PREFIX . '_cere_tax_name', 'Tax' ); 803 $order = wc_get_order( $order_id ); 804 $ceretax_data_lineitem = json_decode( get_post_meta( $order_id, 'ceretax_data_lineitem', true ) ); 805 $ceretax_data = json_decode( get_post_meta( $order_id, 'ceretax_data', true ) ); 613 806 614 807 if ( ! empty( $ceretax_data_lineitem ) && ! empty( $ceretax_data ) && ! empty( $order ) ) { … … 634 827 $filtered = array_filter( 635 828 $ceretax_items_data, 636 function ( $filtered_item ) use ( $product_id ) {637 return isset( $filtered_item->itemNumber ) && $filtered_item->itemNumber == $product_id ; // phpcs:ignore WordPress.NamingConventions.ValidVariableName829 function ( $filtered_item ) use ( $product_id, $item_id ) { 830 return isset( $filtered_item->itemNumber ) && $filtered_item->itemNumber == $product_id && isset( $filtered_item->lineId ) && $filtered_item->lineId == $item_id; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 638 831 } 639 832 ); … … 642 835 $ceretax_data, 643 836 function ( $refunded_item ) use ( $product_id ) { 644 return isset( $refunded_item->itemNumber ) && $refunded_item->itemNumber == $product_id ; // phpcs:ignore WordPress.NamingConventions.ValidVariableName837 return isset( $refunded_item->itemNumber ) && $refunded_item->itemNumber == $product_id && isset( $refunded_item->lineId ) && $refunded_item->lineId == $item_id; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 645 838 } 646 839 ); -
ceretax/trunk/inc/class-cwafc.php
r3320210 r3357953 574 574 $cere_tax_name = get_option( CWAFC_PREFIX . '_cere_tax_name', 'Tax' ); 575 575 576 if ( isset( $custom_tax_rate ) && is_numeric( $custom_tax_rate ) ) { 576 if ( isset( $custom_tax_rate ) && is_numeric( $custom_tax_rate ) ) { 577 577 $tax = $custom_tax_rate; 578 579 // Add recurring fee for subscription product. 578 error_log('tax: '.$tax); 579 // Add recurring fee for subscription product. 580 580 if ( ! empty( $cart->recurring_cart_key ) ) { 581 // Add fee only for recurring carts. 582 $ceretax_tmp_data = get_option( 'ceretax_tmp_data' ); 583 $ceretax_tmp_data = json_decode( $ceretax_tmp_data ); 584 $ceretax_tmp_items_data = $ceretax_tmp_data->invoice->lineItems; 585 $total_line_tran_charges_tax = 0; 581 $ceretax_tmp_data = get_option( 'ceretax_tmp_data' ); 582 $ceretax_tmp_data = json_decode( $ceretax_tmp_data ); 583 $ceretax_tmp_items_data = ! empty( $ceretax_tmp_data->invoice->lineItems ) ? $ceretax_tmp_data->invoice->lineItems : array(); 584 $total_recurring_fee = 0; 586 585 if ( ! WC()->cart->is_empty() && ! empty( $ceretax_tmp_items_data ) && is_array( $ceretax_tmp_items_data ) ) { 587 $item_count = 0; 588 $total_recurring_fee = 0; 589 foreach ( $cart->get_cart() as $cart_item_id => $cart_item ) { 590 $line_item_recurring_tax_amount = 0; 591 $line_item_calc_base_amount = 0; 592 $line_item_revenue_amount = 0; 593 $line_item_total_tax = 0; 594 $product_id = $cart_item['product_id']; 595 586 foreach ( $cart->get_cart() as $cart_item ) { 587 $product_id = $cart_item['product_id']; 588 $variation_id = ! empty( $cart_item['variation_id'] ) ? $cart_item['variation_id'] : 0; 596 589 if ( class_exists( 'WC_Subscriptions_Product' ) && WC_Subscriptions_Product::is_subscription( $product_id ) ) { 597 $filtered = array_filter(590 $filtered = array_filter( 598 591 $ceretax_tmp_items_data, 599 function ( $filtered_item ) use ( $product_id ) { 600 return isset( $filtered_item->itemNumber ) && $filtered_item->itemNumber == $product_id; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison, WordPress.NamingConventions.ValidVariableName 592 function ( $filtered_item ) use ( $product_id, $variation_id ) { 593 return isset( $filtered_item->itemNumber ) && in_array( 594 (string) $filtered_item->itemNumber, 595 array( (string) $product_id, (string) $variation_id ), 596 true 597 ); 601 598 } 602 599 ); 603 $line_item_revenue_amount = ! empty( $filtered ) ? reset( $filtered )->revenue : 0; 604 $line_item_taxe_breaks = ! empty( $filtered ) ? reset( $filtered )->taxes : array(); 605 606 if ( ! empty( $line_item_taxe_breaks ) && is_array( $line_item_taxe_breaks ) ) { 607 foreach ( $line_item_taxe_breaks as $key => $val ) { 608 if ( ! empty( $val->calculationBaseAmt ) && ( $val->calculationBaseAmt >= $line_item_revenue_amount ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName 609 $line_item_calc_base_amount = $val->calculationBaseAmt; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 610 $line_item_recurring_tax_amount += $val->totalTax; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 600 601 if ( ! empty( $filtered ) ) { 602 $line_item_revenue_amount = reset( $filtered )->revenue ?? 0; 603 $line_item_taxe_breaks = reset( $filtered )->taxes ?? array(); 604 605 $line_item_calc_base_amount = 0; 606 $line_item_tax_amount = 0; 607 $retail_delivery_fee_amount = 0; 608 609 if ( ! empty( $line_item_taxe_breaks ) && is_array( $line_item_taxe_breaks ) ) { 610 foreach ( $line_item_taxe_breaks as $val ) { 611 612 // Check for Retail Delivery Fee rows 613 if ( isset( $val->taxTypeClassDesc ) 614 && strtoupper( $val->taxTypeClassDesc ) === 'RETAIL DELIVERY FEE' 615 && isset( $val->totalTax ) 616 && (float) $val->totalTax > 0 617 ) { 618 // Use state-specific fixed amount 619 $state = WC()->customer->get_shipping_state(); 620 if ( strtoupper( $state ) === 'CO' ) { 621 $retail_delivery_fee_amount += $val->rate; 622 623 } elseif ( strtoupper( $state ) === 'MN' && $line_item_revenue_amount >= 100 ) { 624 $retail_delivery_fee_amount += $val->rate; 625 626 } 627 // do NOT add anything if state is different 628 continue; 629 } 630 631 // Normal percentage-based taxes, prorated 632 if ( ! empty( $val->calculationBaseAmt ) && ( $val->calculationBaseAmt >= $line_item_revenue_amount ) ) { 633 $line_item_calc_base_amount = (float) $val->calculationBaseAmt; 634 $line_item_tax_amount += (float) $val->totalTax; 635 } 611 636 } 612 637 } 613 } 614 if ( ! empty( $line_item_calc_base_amount ) ) { 615 $line_item_total_tax = ( $line_item_revenue_amount / $line_item_calc_base_amount ) * $line_item_recurring_tax_amount; 616 $total_recurring_fee = $total_recurring_fee + $line_item_total_tax; 617 continue; 638 639 // Pro-rate percentage-based tax 640 $line_item_total_tax = 0; 641 if ( $line_item_calc_base_amount > 0 ) { 642 $line_item_total_tax = ( $line_item_revenue_amount / $line_item_calc_base_amount ) * $line_item_tax_amount; 643 } else { 644 $line_item_total_tax = $line_item_tax_amount; 645 } 646 647 // Add both prorated taxes + fixed RDF 648 $total_recurring_fee += $line_item_total_tax + $retail_delivery_fee_amount; 649 618 650 } 619 651 } 620 652 } 621 $cart->add_fee( $cere_tax_name, $total_recurring_fee, false ); 622 } 623 } else { 653 } 654 655 //Fallback if nothing matched from Ceretax API 656 if ( $total_recurring_fee <= 0 && ! empty( $custom_tax_rate ) ) { 657 $total_recurring_fee = $custom_tax_rate; 658 } 659 660 $cart->add_fee( $cere_tax_name, $total_recurring_fee, false ); 661 662 } 663 else { 664 //Normal cart 624 665 $cart->add_fee( $cere_tax_name, $tax, false ); 625 666 } 667 626 668 } 627 669 } … … 1379 1421 $shipping_charges = $order->get_shipping_total(); 1380 1422 $shipping_zones = WC_Shipping_Zones::get_zones(); 1381 1423 error_log('inside cwafc_calculate_cere_tax : '.$shipping_charges); 1382 1424 // Get order customer id. 1383 1425 if ( $order->get_customer_id() ) { … … 1436 1478 $product_id = $item->get_product_id(); 1437 1479 $product = wc_get_product( $product_id ); 1480 1481 if ( ! $product || ! is_a( $product, 'WC_Product' ) ) { 1482 continue; // skip invalid products (manual items, deleted products, etc.) 1483 } 1484 1438 1485 $order_item_trial_length = $product->get_meta( '_subscription_trial_length' ); 1486 $item_number = $product_id; 1487 1488 // Check if product is variation. 1489 if ( $product->is_type( 'variable' ) ) { 1490 $item_number = $item->get_variation_id(); 1491 } 1439 1492 1440 1493 // Get PS code. … … 1459 1512 'lineID' => (string) $item_id, 1460 1513 'dateOfTransaction' => gmdate( 'Y-m-d' ), 1461 'itemNumber' => (string) $ product_id,1514 'itemNumber' => (string) $item_number, 1462 1515 'itemDescription' => esc_html( $product->get_title() ), 1463 1516 'revenue' => (float) $item->get_total(), … … 1544 1597 ), 1545 1598 ); 1599 error_log('request body in cwafc_calculate_cere_tax : '.print_r($request_body, true)); 1546 1600 1547 1601 $body = wp_json_encode( $request_body ); … … 1726 1780 $shipping_charges = (float) $refund->get_shipping_total(); 1727 1781 $shipping_zones = WC_Shipping_Zones::get_zones(); 1728 1782 error_log('inside cwafc_calculate_cere_tax_refunded'.$shipping_charges); 1729 1783 // Get order customer id. 1730 1784 if ( $order->get_customer_id() ) { … … 1769 1823 $product = wc_get_product( $product_id ); 1770 1824 $order_item_trial_length = $product->get_meta( '_subscription_trial_length' ); 1825 $item_number = $product_id; 1826 1827 // Check if product is variation. 1828 if ( $product->is_type( 'variable' ) ) { 1829 $item_number = $item->get_variation_id(); 1830 } 1771 1831 1772 1832 // Get PS code. … … 1793 1853 'lineID' => (string) $item_id, 1794 1854 'dateOfTransaction' => gmdate( 'Y-m-d' ), 1795 'itemNumber' => (string) $ product_id,1855 'itemNumber' => (string) $item_number, 1796 1856 'itemDescription' => esc_html( $product->get_title() ), 1797 1857 'revenue' => $item_total, … … 1875 1935 ), 1876 1936 ); 1877 1937 error_log('request body in cwafc_calculate_cere_tax_refunded : '.print_r($request_body, true)); 1878 1938 $body = wp_json_encode( $request_body ); 1879 1939 … … 1990 2050 $shipping_charges = WC()->cart->get_shipping_total(); 1991 2051 $shipping_zones = WC_Shipping_Zones::get_zones(); 1992 2052 error_log('inside cwafc_get_tax_rate_from_api : '.$shipping_charges); 1993 2053 // Get store address. 1994 2054 $store_address = get_option( 'woocommerce_store_address' ); … … 2028 2088 $product = wc_get_product( $product_id ); 2029 2089 $cart_item_trial_length = $product->get_meta( '_subscription_trial_length' ); 2090 $item_number = $product_id; 2091 2092 // Check if product is variation. 2093 if ( $product->is_type( 'variable' ) ) { 2094 $item_number = isset( $cart_item['variation_id'] ) ? $cart_item['variation_id'] : $product_id; 2095 } 2030 2096 2031 2097 // Get PS code. … … 2059 2125 'lineID' => $cart_item_id, 2060 2126 'dateOfTransaction' => gmdate( 'Y-m-d' ), 2061 'itemNumber' => (string) $ product_id,2127 'itemNumber' => (string) $item_number, 2062 2128 'itemDescription' => esc_html( $product->get_title() ), 2063 2129 'revenue' => $line_total, … … 2126 2192 ), 2127 2193 ); 2128 2194 error_log('request body in cwafc_get_tax_rate_from_api : '.print_r($request_body, true)); 2129 2195 $body = wp_json_encode( $request_body ); 2130 2196 -
ceretax/trunk/readme.txt
r3320210 r3357953 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.4. 37 Stable tag: 1.4.4 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.4.4 = 39 * fix - The transactions can be fully refunded 40 * fix - We have resolved the tax amount mismatch in tax total column and summary 41 * fix - Taxes are now displayed for variable items also 37 42 38 43 = 1.4.3 =
Note: See TracChangeset
for help on using the changeset viewer.