Plugin Directory

Changeset 3346250


Ignore:
Timestamp:
08/18/2025 08:54:00 AM (7 months ago)
Author:
oaron
Message:

Version 3.8.7

Location:
pay-via-barion-for-woocommerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-request.php

    r3338924 r3346250  
    9898                $shipping_cost = (float) wc_get_order_item_meta($item_id, 'cost');
    9999                $shipping_taxes = wc_get_order_item_meta($item_id, 'taxes');
     100               
     101                // Handle shipping taxes safely
     102                $tax_amount = 0;
    100103                if (!empty($shipping_taxes) && is_array($shipping_taxes)) {
    101                     $shipping_cost = floatval($shipping_cost) + floatval(array_sum($shipping_taxes));
     104                    // Check if it's a multidimensional array with 'total' key
     105                    if (isset($shipping_taxes['total']) && is_array($shipping_taxes['total'])) {
     106                        // Sum the 'total' taxes
     107                        foreach ($shipping_taxes['total'] as $tax) {
     108                            $tax_amount += (float) $tax;
     109                        }
     110                    } elseif (!isset($shipping_taxes['total']) && !isset($shipping_taxes['subtotal'])) {
     111                        // It's a simple array, sum directly
     112                        foreach ($shipping_taxes as $tax) {
     113                            if (is_numeric($tax)) {
     114                                $tax_amount += (float) $tax;
     115                            }
     116                        }
     117                    }
    102118                }
     119               
     120                $shipping_cost = floatval($shipping_cost) + floatval($tax_amount);
    103121                $itemModel->UnitPrice = $shipping_cost;
    104122                $itemModel->ItemTotal = $shipping_cost;
  • pay-via-barion-for-woocommerce/trunk/index.php

    r3338924 r3346250  
    44Plugin URI: http://github.com/szelpe/woocommerce-barion
    55Description: Adds the ability to WooCommerce to pay via Barion
    6 Version: 3.8.6
     6Version: 3.8.7
    77Author: Aron Ocsvari <ugyfelszolgalat@bitron.hu>
    88Author URI: https://bitron.hu
  • pay-via-barion-for-woocommerce/trunk/readme.txt

    r3338924 r3346250  
    8989
    9090== Changelog ==
     91= 3.8.7 =
     92* Fix for shipping tax calculation error
    9193= 3.8.6 =
    9294* Fix: Deprecated errors
Note: See TracChangeset for help on using the changeset viewer.